* did the try get thing and introduced some variables for readability

zircon^2
lbsa71 2007-05-17 13:46:26 +00:00
parent 60ceda3cfc
commit 831c7a27ff
1 changed files with 9 additions and 4 deletions

View File

@ -277,11 +277,16 @@ namespace OpenSim
agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode))
uint circuitcode = (uint)agent_data.circuitcode;
RemoteGridBase gridServer = (RemoteGridBase)this.GridServers.GridServer;
AgentCircuitData agentCircuit;
if (gridServer.agentcircuits.TryGetValue(circuitcode, out agentCircuit))
{
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname;
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname;
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos;
agentCircuit.firstname = agent_data.firstname;
agentCircuit.lastname = agent_data.lastname;
agentCircuit.startpos = agent_data.startpos;
}
return new XmlRpcResponse();