Number of small changes

This commit is contained in:
MW
2007-05-19 11:55:05 +00:00
parent f0261fb51b
commit e2499fbbc1
8 changed files with 224 additions and 279 deletions

View File

@@ -82,6 +82,7 @@ namespace OpenSim
this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
}
}
}
}

View File

@@ -26,7 +26,7 @@ namespace OpenSim
}
}
public void ClientInPacket(uint circuitCode, Packet packet)
public virtual void ClientInPacket(uint circuitCode, Packet packet)
{
if (this.ClientThreads.ContainsKey(circuitCode))
{
@@ -34,22 +34,22 @@ namespace OpenSim
}
}
public bool AddNewCircuitCodeClient(uint circuitCode)
public virtual bool AddNewCircuitCodeClient(uint circuitCode)
{
return false;
}
public void SendPacketToAllClients(Packet packet)
public virtual void SendPacketToAllClients(Packet packet)
{
}
public void SendPacketToAllExcept(Packet packet, SimClient simClient)
public virtual void SendPacketToAllExcept(Packet packet, SimClient simClient)
{
}
public virtual void AddClientPacketHanlder(PacketType packetType, PacketMethod handler)
public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler)
{
}

View File

@@ -33,48 +33,48 @@ namespace OpenSim
RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer;
foreach (Hashtable neighbour in gridServer.neighbours)
{
string neighbourIPStr = (string)neighbour["sim_ip"];
System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
Console.WriteLine(reqUrl);
SimParams = new Hashtable();
SimParams["session_id"] = this.SessionID.ToString();
SimParams["secure_session_id"] = this.SecureSessionID.ToString();
SimParams["firstname"] = this.ClientAvatar.firstname;
SimParams["lastname"] = this.ClientAvatar.lastname;
SimParams["agent_id"] = this.AgentID.ToString();
SimParams["circuit_code"] = (Int32)this.CircuitCode;
SimParams["child_agent"] = "1";
SendParams = new ArrayList();
SendParams.Add(SimParams);
foreach (Hashtable neighbour in gridServer.neighbours)
{
string neighbourIPStr = (string)neighbour["sim_ip"];
System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
Console.WriteLine(reqUrl);
SimParams = new Hashtable();
SimParams["session_id"] = this.SessionID.ToString();
SimParams["secure_session_id"] = this.SecureSessionID.ToString();
SimParams["firstname"] = this.ClientAvatar.firstname;
SimParams["lastname"] = this.ClientAvatar.lastname;
SimParams["agent_id"] = this.AgentID.ToString();
SimParams["circuit_code"] = (Int32)this.CircuitCode;
SimParams["child_agent"] = "1";
SendParams = new ArrayList();
SendParams.Add(SimParams);
GridReq = new XmlRpcRequest("expect_user", SendParams);
GridResp = GridReq.Send(reqUrl, 3000);
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
byte[] byteIP = neighbourIP.GetAddressBytes();
enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
enablesimpacket.SimulatorInfo.Port = neighbourPort;
enablePackets.Add(enablesimpacket);
}
Thread.Sleep(3000);
foreach (Packet enable in enablePackets)
{
this.OutPacket(enable);
}
enablePackets.Clear();
GridReq = new XmlRpcRequest("expect_user", SendParams);
GridResp = GridReq.Send(reqUrl, 3000);
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
byte[] byteIP = neighbourIP.GetAddressBytes();
enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
enablesimpacket.SimulatorInfo.Port = neighbourPort;
enablePackets.Add(enablesimpacket);
}
Thread.Sleep(3000);
foreach (Packet enable in enablePackets)
{
this.OutPacket(enable);
}
enablePackets.Clear();
}
}

View File

@@ -28,26 +28,26 @@ namespace OpenSim
public class UDPServer : OpenSimNetworkHandler
{
private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
public Socket Server;
private IPEndPoint ServerIncoming;
private byte[] RecvBuffer = new byte[4096];
private byte[] ZeroBuffer = new byte[8192];
private IPEndPoint ipeSender;
private EndPoint epSender;
private AsyncCallback ReceivedData;
private PacketServer _packetServer;
private int listenPort;
private Grid m_gridServers;
private World m_localWorld;
private AssetCache m_assetCache;
private InventoryCache m_inventoryCache;
private RegionInfo m_regionData;
private bool m_sandbox = false;
private bool user_accounts = false;
private ConsoleBase m_console;
private AuthenticateSessionsBase m_authenticateSessionsClass;
protected IPEndPoint ServerIncoming;
protected byte[] RecvBuffer = new byte[4096];
protected byte[] ZeroBuffer = new byte[8192];
protected IPEndPoint ipeSender;
protected EndPoint epSender;
protected AsyncCallback ReceivedData;
protected PacketServer _packetServer;
protected int listenPort;
protected Grid m_gridServers;
protected World m_localWorld;
protected AssetCache m_assetCache;
protected InventoryCache m_inventoryCache;
protected RegionInfo m_regionData;
protected bool m_sandbox = false;
protected bool user_accounts = false;
protected ConsoleBase m_console;
protected AuthenticateSessionsBase m_authenticateSessionsClass;
public AuthenticateSessionHandler AuthenticateHandler;
@@ -83,12 +83,17 @@ namespace OpenSim
this.user_accounts = accounts;
this.m_console = console;
this.m_authenticateSessionsClass = authenticateClass;
PacketServer packetServer = new PacketServer(this);
this.CreatePacketServer();
//set up delegate for authenticate sessions
this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
}
protected virtual void CreatePacketServer()
{
PacketServer packetServer = new PacketServer(this);
}
protected virtual void OnReceivedData(IAsyncResult result)
{
ipeSender = new IPEndPoint(IPAddress.Any, 0);
@@ -152,7 +157,7 @@ namespace OpenSim
}
public void RegisterPacketServer(PacketServer server)
public virtual void RegisterPacketServer(PacketServer server)
{
this._packetServer = server;
}