From 52a4c4d82f9c5b808e6c61fd51c1c70e42865565 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Sep 2008 20:12:03 +0000 Subject: * Check in first part of http://opensimulator.org/mantis/view.php?id=2073 * This patch aims to introduce look at direction persistence between logins. It won't be active until the second part of the patch is committed in about two weeks time. At this point, region servers that haven't upgraded past this revision may run into problems * This checkin upgrades the user database. As always, we recommend you have backups in case something goes wrong. * Many thanks to tyre for this patch. --- OpenSim/Data/MySQL/MySQLManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 6048f93..5f830bb 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -512,6 +512,8 @@ namespace OpenSim.Data.MySQL Vector3 tmp_v; Vector3.TryParse((string) reader["currentPos"], out tmp_v); retval.Position = tmp_v; + Vector3.TryParse((string)reader["currentLookAt"], out tmp_v); + retval.LookAt = tmp_v; } else { @@ -1095,8 +1097,8 @@ namespace OpenSim.Data.MySQL { string sql = String.Empty; sql += "REPLACE INTO "; - sql += "agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos) VALUES "; - sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos);"; + sql += "agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos, currentLookAt) VALUES "; + sql += "(?UUID, ?sessionID, ?secureSessionID, ?agentIP, ?agentPort, ?agentOnline, ?loginTime, ?logoutTime, ?currentRegion, ?currentHandle, ?currentPos, ?currentLookAt);"; Dictionary parameters = new Dictionary(); parameters["?UUID"] = agentdata.ProfileID.ToString(); @@ -1109,7 +1111,8 @@ namespace OpenSim.Data.MySQL parameters["?logoutTime"] = agentdata.LogoutTime.ToString(); parameters["?currentRegion"] = agentdata.Region.ToString(); parameters["?currentHandle"] = agentdata.Handle.ToString(); - parameters["?currentPos"] = "<" + ((int)agentdata.Position.X).ToString() + "," + ((int)agentdata.Position.Y).ToString() + "," + ((int)agentdata.Position.Z).ToString() + ">"; + parameters["?currentPos"] = "<" + (agentdata.Position.X).ToString() + "," + (agentdata.Position.Y).ToString() + "," + (agentdata.Position.Z).ToString() + ">"; + parameters["?currentLookAt"] = "<" + (agentdata.LookAt.X).ToString() + "," + (agentdata.LookAt.Y).ToString() + "," + (agentdata.LookAt.Z).ToString() + ">"; bool returnval = false; -- cgit v1.1