aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsBase.cs23
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsRemote.cs2
-rw-r--r--OpenSim.RegionServer/SimClient.cs8
-rw-r--r--OpenSim.RegionServer/world/World.cs2
-rw-r--r--OpenSim.Servers/CheckSumServer.cs34
-rw-r--r--OpenSim.Servers/UDPServerBase.cs9
-rw-r--r--OpenSim/OpenSimMain.cs2
7 files changed, 47 insertions, 33 deletions
diff --git a/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
index f784f54..91bc54d 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsBase.cs
+++ b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
@@ -81,8 +81,29 @@ namespace OpenSim
81 this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname; 81 this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; 82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; 83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
84 // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
85
86 }
87
88 }
89
90 public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
91 {
92 if (this.AgentCircuits.ContainsKey(circuitcode))
93 {
94 this.AgentCircuits[circuitcode].child = childstatus;
95
96 }
97 }
98
99 public bool GetAgentChildStatus(uint circuitcode)
100 {
101 if (this.AgentCircuits.ContainsKey(circuitcode))
102 {
103 return this.AgentCircuits[circuitcode].child;
104
84 } 105 }
85 106 return false;
86 } 107 }
87 } 108 }
88} 109}
diff --git a/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
index 57c98e4..0802d75 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
+++ b/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
@@ -34,6 +34,8 @@ namespace OpenSim
34 { 34 {
35 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); 35 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
36 agentData.child = false; 36 agentData.child = false;
37 // Console.WriteLine("expect user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
38
37 } 39 }
38 40
39 this.AddNewCircuit(agentData.circuitcode, agentData); 41 this.AddNewCircuit(agentData.circuitcode, agentData);
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index daaa6dd..9ae08f4 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -118,7 +118,9 @@ namespace OpenSim
118 118
119 if (m_gridServer.GetName() == "Remote") 119 if (m_gridServer.GetName() == "Remote")
120 { 120 {
121 this.m_child = m_authenticateSessionsHandler.GetAgentChildStatus(initialcirpack.CircuitCode.Code);
121 this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code); 122 this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
123 //Console.WriteLine("start pos is " + this.startpos.X + " , " + this.startpos.Y + " , " + this.startpos.Z);
122 } 124 }
123 else 125 else
124 { 126 {
@@ -142,13 +144,15 @@ namespace OpenSim
142 # region Client Methods 144 # region Client Methods
143 public void UpgradeClient() 145 public void UpgradeClient()
144 { 146 {
147 Console.WriteLine("updateclient being called");
145 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); 148 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
146 this.m_child = false; 149 this.m_child = false;
147 this.m_world.RemoveViewerAgent(this); 150 this.m_world.RemoveViewerAgent(this);
148 if (!this.m_sandboxMode) 151 if (!this.m_sandboxMode)
149 { 152 {
150 this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[CircuitCode].startpos; 153 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
151 ((RemoteGridBase)m_gridServer).agentcircuits[CircuitCode].child = false; 154 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
155 //Console.WriteLine("upgrade start pos is " + this.startpos.X + " , " + this.startpos.Y + " , " + this.startpos.Z);
152 } 156 }
153 this.InitNewClient(); 157 this.InitNewClient();
154 } 158 }
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index 72214d4..ecf9c69 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -585,7 +585,7 @@ namespace OpenSim.world
585 } 585 }
586 if (agentClient.ClientAvatar.PhysActor != null) 586 if (agentClient.ClientAvatar.PhysActor != null)
587 { 587 {
588 this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor); 588 //this.phyScene.RemoveAvatar(agentClient.ClientAvatar.PhysActor);
589 } 589 }
590 } 590 }
591 catch (Exception e) 591 catch (Exception e)
diff --git a/OpenSim.Servers/CheckSumServer.cs b/OpenSim.Servers/CheckSumServer.cs
index f0b4124..ae1724f 100644
--- a/OpenSim.Servers/CheckSumServer.cs
+++ b/OpenSim.Servers/CheckSumServer.cs
@@ -17,12 +17,11 @@ namespace OpenSim.Servers
17{ 17{
18 public class CheckSumServer : UDPServerBase 18 public class CheckSumServer : UDPServerBase
19 { 19 {
20 protected ConsoleBase m_console; 20 //protected ConsoleBase m_console;
21 21
22 public CheckSumServer(int port, ConsoleBase console) 22 public CheckSumServer(int port)
23 : base(port)
23 { 24 {
24 listenPort = port;
25 this.m_console = console;
26 } 25 }
27 26
28 protected override void OnReceivedData(IAsyncResult result) 27 protected override void OnReceivedData(IAsyncResult result)
@@ -35,10 +34,8 @@ namespace OpenSim.Servers
35 34
36 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); 35 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
37 36
38 // do we already have a circuit for this endpoint
39 if (packet.Type == PacketType.SecuredTemplateChecksumRequest) 37 if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
40 { 38 {
41
42 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet; 39 SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
43 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket(); 40 TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
44 checkreply.DataBlock.Checksum = 180572585; 41 checkreply.DataBlock.Checksum = 180572585;
@@ -55,23 +52,21 @@ namespace OpenSim.Servers
55 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket(); 52 SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
56 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token; 53 checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
57 this.SendPacket(checkrequest, epSender); 54 this.SendPacket(checkrequest, epSender);
58 */ 55 */
59
60 } 56 }
61 else if (packet.Type == PacketType.TemplateChecksumReply) 57 else if (packet.Type == PacketType.TemplateChecksumReply)
62 { 58 {
63 //echo back the client checksum reply (Hegemon's method) 59 //echo back the client checksum reply (Hegemon's method)
64 TemplateChecksumReplyPacket checksum = (TemplateChecksumReplyPacket)packet; 60 TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
65 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket(); 61 TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
66 checkreply2.DataBlock.Checksum = checksum.DataBlock.Checksum; 62 checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
67 checkreply2.DataBlock.Flags = checksum.DataBlock.Flags; 63 checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
68 checkreply2.DataBlock.MajorVersion = checksum.DataBlock.MajorVersion; 64 checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
69 checkreply2.DataBlock.MinorVersion = checksum.DataBlock.MinorVersion; 65 checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
70 checkreply2.DataBlock.PatchVersion = checksum.DataBlock.PatchVersion; 66 checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
71 checkreply2.DataBlock.ServerVersion = checksum.DataBlock.ServerVersion; 67 checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
72 checkreply2.TokenBlock.Token = checksum.TokenBlock.Token; 68 checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
73 this.SendPacket(checkreply2, epSender); 69 this.SendPacket(checkreply2, epSender);
74
75 } 70 }
76 else 71 else
77 { 72 {
@@ -80,16 +75,13 @@ namespace OpenSim.Servers
80 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 75 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
81 } 76 }
82 77
83
84 private void SendPacket(Packet Pack, EndPoint endp) 78 private void SendPacket(Packet Pack, EndPoint endp)
85 { 79 {
86 if (!Pack.Header.Resent) 80 if (!Pack.Header.Resent)
87 { 81 {
88 // Set the sequence number
89
90 Pack.Header.Sequence = 1; 82 Pack.Header.Sequence = 1;
91
92 } 83 }
84
93 byte[] ZeroOutBuffer = new byte[4096]; 85 byte[] ZeroOutBuffer = new byte[4096];
94 byte[] sendbuffer; 86 byte[] sendbuffer;
95 sendbuffer = Pack.ToBytes(); 87 sendbuffer = Pack.ToBytes();
diff --git a/OpenSim.Servers/UDPServerBase.cs b/OpenSim.Servers/UDPServerBase.cs
index e7feb01..a308052 100644
--- a/OpenSim.Servers/UDPServerBase.cs
+++ b/OpenSim.Servers/UDPServerBase.cs
@@ -24,8 +24,9 @@ namespace OpenSim.Servers
24 protected AsyncCallback ReceivedData; 24 protected AsyncCallback ReceivedData;
25 protected int listenPort; 25 protected int listenPort;
26 26
27 public UDPServerBase() 27 public UDPServerBase(int port)
28 { 28 {
29 listenPort = port;
29 } 30 }
30 31
31 protected virtual void OnReceivedData(IAsyncResult result) 32 protected virtual void OnReceivedData(IAsyncResult result)
@@ -38,8 +39,6 @@ namespace OpenSim.Servers
38 39
39 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); 40 packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
40 41
41
42
43 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 42 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
44 } 43 }
45 44
@@ -60,14 +59,10 @@ namespace OpenSim.Servers
60 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); 59 Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
61 } 60 }
62 61
63
64 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) 62 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
65 { 63 {
66 // find the endpoint for this circuit
67 64
68 } 65 }
69
70
71 } 66 }
72} 67}
73 68
diff --git a/OpenSim/OpenSimMain.cs b/OpenSim/OpenSimMain.cs
index 30fed30..9025316 100644
--- a/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSimMain.cs
@@ -100,7 +100,7 @@ namespace OpenSim
100 //Authenticate Session Handler 100 //Authenticate Session Handler
101 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal(); 101 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
102 this.AuthenticateSessionsHandler = authen; 102 this.AuthenticateSessionsHandler = authen;
103 this.checkServer = new CheckSumServer(12036, m_console); 103 this.checkServer = new CheckSumServer(12036);
104 this.checkServer.ServerListener(); 104 this.checkServer.ServerListener();
105 } 105 }
106 else 106 else