mirror of
https://github.com/opensim/opensim.git
synced 2026-08-14 09:25:45 +08:00
Partial rewrite of client IP verification. Not completely finished yet, and untested. Committing to move to my other computer.
This commit is contained in:
@@ -38,6 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Imaging;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using Nwc.XmlRpc;
|
||||
using log4net;
|
||||
|
||||
@@ -268,5 +269,48 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
|
||||
{
|
||||
HttpWebRequest AgentCreateRequest = null;
|
||||
myipaddress = String.Empty;
|
||||
reason = String.Empty;
|
||||
|
||||
if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
|
||||
{
|
||||
string response = GetResponse(AgentCreateRequest, out reason);
|
||||
bool success = true;
|
||||
UnpackResponse(response, out success, out reason, out myipaddress);
|
||||
return success;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void UnpackResponse(string response, out bool result, out string reason, out string ipaddress)
|
||||
{
|
||||
result = true;
|
||||
reason = string.Empty;
|
||||
ipaddress = string.Empty;
|
||||
|
||||
if (!String.IsNullOrEmpty(response))
|
||||
{
|
||||
try
|
||||
{
|
||||
// we assume we got an OSDMap back
|
||||
OSDMap r = Util.GetOSDMap(response);
|
||||
result = r["success"].AsBoolean();
|
||||
reason = r["reason"].AsString();
|
||||
ipaddress = r["your_ip"].AsString();
|
||||
}
|
||||
catch (NullReferenceException e)
|
||||
{
|
||||
m_log.InfoFormat("[GATEKEEPER SERVICE CONNECTOR]: exception on UnpackResponse of DoCreateChildAgentCall {0}", e.Message);
|
||||
reason = "Internal error";
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
}
|
||||
|
||||
public bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint ipaddress, out string reason)
|
||||
{
|
||||
// not available over remote calls
|
||||
reason = "Method not available over remote calls";
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
|
||||
{
|
||||
reason = String.Empty;
|
||||
|
||||
Reference in New Issue
Block a user