Patch login reply exploding in a fireball
This commit is contained in:
parent
dbc2371fde
commit
9f2fcdedda
1 changed files with 31 additions and 27 deletions
|
|
@ -460,37 +460,41 @@ namespace OpenMetaverse
|
|||
Logger.Log("Login server returned (some) invalid data: " + e.Message, Helpers.LogLevel.Warning);
|
||||
}
|
||||
if (!Success)
|
||||
return;
|
||||
|
||||
// Home
|
||||
return;
|
||||
|
||||
// Home
|
||||
HomeRegion = 0;
|
||||
HomePosition = Vector3.Zero;
|
||||
HomeLookAt = Vector3.Zero;
|
||||
if (reply.ContainsKey("home"))
|
||||
{
|
||||
OSD osdHome = OSDParser.DeserializeLLSDNotation(reply["home"].ToString());
|
||||
|
||||
if (osdHome.Type == OSDType.Map)
|
||||
{
|
||||
var home = (OSDMap)osdHome;
|
||||
|
||||
OSD homeRegion;
|
||||
if (home.TryGetValue("region_handle", out homeRegion) && homeRegion.Type == OSDType.Array)
|
||||
{
|
||||
OSDArray homeArray = (OSDArray)homeRegion;
|
||||
if (homeArray.Count == 2)
|
||||
HomeRegion = Utils.UIntsToLong((uint)homeArray[0].AsInteger(),
|
||||
(uint)homeArray[1].AsInteger());
|
||||
else
|
||||
HomeRegion = 0;
|
||||
try
|
||||
{
|
||||
OSD osdHome = OSDParser.DeserializeLLSDNotation(reply["home"].ToString());
|
||||
|
||||
if (osdHome.Type == OSDType.Map)
|
||||
{
|
||||
var home = (OSDMap)osdHome;
|
||||
|
||||
OSD homeRegion;
|
||||
if (home.TryGetValue("region_handle", out homeRegion) && homeRegion.Type == OSDType.Array)
|
||||
{
|
||||
OSDArray homeArray = (OSDArray)homeRegion;
|
||||
if (homeArray.Count == 2)
|
||||
HomeRegion = Utils.UIntsToLong((uint)homeArray[0].AsInteger(),
|
||||
(uint)homeArray[1].AsInteger());
|
||||
else
|
||||
HomeRegion = 0;
|
||||
}
|
||||
|
||||
HomePosition = ParseVector3("position", home);
|
||||
HomeLookAt = ParseVector3("look_at", home);
|
||||
}
|
||||
|
||||
HomePosition = ParseVector3("position", home);
|
||||
HomeLookAt = ParseVector3("look_at", home);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HomeRegion = 0;
|
||||
HomePosition = Vector3.Zero;
|
||||
HomeLookAt = Vector3.Zero;
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log("Unable to unpack home location: " + e.Message, Helpers.LogLevel.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
CircuitCode = (int)ParseUInt("circuit_code", reply);
|
||||
|
|
|
|||
Loading…
Reference in a new issue