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);
|
Logger.Log("Login server returned (some) invalid data: " + e.Message, Helpers.LogLevel.Warning);
|
||||||
}
|
}
|
||||||
if (!Success)
|
if (!Success)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Home
|
// Home
|
||||||
|
HomeRegion = 0;
|
||||||
|
HomePosition = Vector3.Zero;
|
||||||
|
HomeLookAt = Vector3.Zero;
|
||||||
if (reply.ContainsKey("home"))
|
if (reply.ContainsKey("home"))
|
||||||
{
|
{
|
||||||
OSD osdHome = OSDParser.DeserializeLLSDNotation(reply["home"].ToString());
|
try
|
||||||
|
{
|
||||||
if (osdHome.Type == OSDType.Map)
|
OSD osdHome = OSDParser.DeserializeLLSDNotation(reply["home"].ToString());
|
||||||
{
|
|
||||||
var home = (OSDMap)osdHome;
|
if (osdHome.Type == OSDType.Map)
|
||||||
|
{
|
||||||
OSD homeRegion;
|
var home = (OSDMap)osdHome;
|
||||||
if (home.TryGetValue("region_handle", out homeRegion) && homeRegion.Type == OSDType.Array)
|
|
||||||
{
|
OSD homeRegion;
|
||||||
OSDArray homeArray = (OSDArray)homeRegion;
|
if (home.TryGetValue("region_handle", out homeRegion) && homeRegion.Type == OSDType.Array)
|
||||||
if (homeArray.Count == 2)
|
{
|
||||||
HomeRegion = Utils.UIntsToLong((uint)homeArray[0].AsInteger(),
|
OSDArray homeArray = (OSDArray)homeRegion;
|
||||||
(uint)homeArray[1].AsInteger());
|
if (homeArray.Count == 2)
|
||||||
else
|
HomeRegion = Utils.UIntsToLong((uint)homeArray[0].AsInteger(),
|
||||||
HomeRegion = 0;
|
(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);
|
|
||||||
}
|
}
|
||||||
}
|
catch (Exception e)
|
||||||
else
|
{
|
||||||
{
|
Logger.Log("Unable to unpack home location: " + e.Message, Helpers.LogLevel.Warning);
|
||||||
HomeRegion = 0;
|
}
|
||||||
HomePosition = Vector3.Zero;
|
|
||||||
HomeLookAt = Vector3.Zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CircuitCode = (int)ParseUInt("circuit_code", reply);
|
CircuitCode = (int)ParseUInt("circuit_code", reply);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue