mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
* 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.
This commit is contained in:
@@ -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<string, string> parameters = new Dictionary<string, string>();
|
||||
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user