diff options
author | gareth | 2007-03-05 17:44:59 +0000 |
---|---|---|
committer | gareth | 2007-03-05 17:44:59 +0000 |
commit | 560b46357e36cad4d1a976819e187463bf9fe13d (patch) | |
tree | eb8076c505a6844077341f5d7bbe73db6ea0a3db /src/OpenSimClient.cs | |
parent | Added MW's fix for smooth movement (diff) | |
download | opensim-SC-560b46357e36cad4d1a976819e187463bf9fe13d.zip opensim-SC-560b46357e36cad4d1a976819e187463bf9fe13d.tar.gz opensim-SC-560b46357e36cad4d1a976819e187463bf9fe13d.tar.bz2 opensim-SC-560b46357e36cad4d1a976819e187463bf9fe13d.tar.xz |
Added sandbox mode and setup facility
Diffstat (limited to 'src/OpenSimClient.cs')
-rw-r--r-- | src/OpenSimClient.cs | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs index 2e8dbb5..6b00a0f 100644 --- a/src/OpenSimClient.cs +++ b/src/OpenSimClient.cs | |||
@@ -80,6 +80,7 @@ namespace OpenSim | |||
80 | } | 80 | } |
81 | 81 | ||
82 | public void AssetLoader() { | 82 | public void AssetLoader() { |
83 | if(OpenSim_Main.cfg.sandbox==false) { | ||
83 | Console.WriteLine("OpenSimClient.cs:AssetLoader() - Starting new thread"); | 84 | Console.WriteLine("OpenSimClient.cs:AssetLoader() - Starting new thread"); |
84 | TransferRequestPacket reqPacket = AssetRequests.Dequeue(); | 85 | TransferRequestPacket reqPacket = AssetRequests.Dequeue(); |
85 | Console.WriteLine("OpenSimClient.cs:AssetLoader() - Got a request, processing it"); | 86 | Console.WriteLine("OpenSimClient.cs:AssetLoader() - Got a request, processing it"); |
@@ -128,6 +129,7 @@ namespace OpenSim | |||
128 | OutPacket(TransferPacket); | 129 | OutPacket(TransferPacket); |
129 | } | 130 | } |
130 | AssetResponse.Close(); | 131 | AssetResponse.Close(); |
132 | } | ||
131 | } | 133 | } |
132 | 134 | ||
133 | public void ProcessInPacket(Packet Pack) { | 135 | public void ProcessInPacket(Packet Pack) { |
@@ -156,14 +158,16 @@ namespace OpenSim | |||
156 | lock(OpenSim_Main.local_world.Entities) { | 158 | lock(OpenSim_Main.local_world.Entities) { |
157 | OpenSim_Main.local_world.Entities.Remove(this.AgentID); | 159 | OpenSim_Main.local_world.Entities.Remove(this.AgentID); |
158 | } | 160 | } |
159 | WebRequest DeleteSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + this.AgentID.ToString() + this.CircuitCode.ToString() + "/delete"); | 161 | |
162 | if(OpenSim_Main.cfg.sandbox==false) { | ||
163 | WebRequest DeleteSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + this.AgentID.ToString() + this.CircuitCode.ToString() + "/delete"); | ||
160 | WebResponse GridResponse = DeleteSession.GetResponse(); | 164 | WebResponse GridResponse = DeleteSession.GetResponse(); |
161 | StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); | 165 | StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); |
162 | String grTest = sr.ReadLine(); | 166 | String grTest = sr.ReadLine(); |
163 | sr.Close(); | 167 | sr.Close(); |
164 | GridResponse.Close(); | 168 | GridResponse.Close(); |
165 | Console.WriteLine("DEBUG: " + grTest); | 169 | Console.WriteLine("DEBUG: " + grTest); |
166 | 170 | } | |
167 | this.ClientThread.Abort(); | 171 | this.ClientThread.Abort(); |
168 | break; | 172 | break; |
169 | case PacketType.AgentUpdate: | 173 | case PacketType.AgentUpdate: |
@@ -426,24 +430,32 @@ namespace OpenSim | |||
426 | } | 430 | } |
427 | 431 | ||
428 | private void AuthUser() { | 432 | private void AuthUser() { |
429 | Console.WriteLine("OpenSimClient.cs:AuthUser() - Authenticating new user request with grid"); | 433 | if(OpenSim_Main.cfg.sandbox==false) { |
430 | WebRequest CheckSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + cirpack.CircuitCode.ID.ToString() + "/" + cirpack.CircuitCode.Code.ToString() + "/exists"); | 434 | Console.WriteLine("OpenSimClient.cs:AuthUser() - Authenticating new user request with grid"); |
431 | Console.WriteLine(OpenSim_Main.cfg.GridURL); | 435 | WebRequest CheckSession = WebRequest.Create(OpenSim_Main.cfg.GridURL + "/usersessions/" + OpenSim_Main.cfg.GridSendKey + "/" + cirpack.CircuitCode.ID.ToString() + "/" + cirpack.CircuitCode.Code.ToString() + "/exists"); |
432 | WebResponse GridResponse = CheckSession.GetResponse(); | 436 | Console.WriteLine(OpenSim_Main.cfg.GridURL); |
433 | StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); | 437 | WebResponse GridResponse = CheckSession.GetResponse(); |
434 | String grTest = sr.ReadLine(); | 438 | StreamReader sr = new StreamReader(GridResponse.GetResponseStream()); |
435 | sr.Close(); | 439 | String grTest = sr.ReadLine(); |
436 | GridResponse.Close(); | 440 | sr.Close(); |
437 | if(String.IsNullOrEmpty(grTest) || grTest.Equals("1")) { // YAY! Valid login | 441 | GridResponse.Close(); |
438 | Console.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); | 442 | if(String.IsNullOrEmpty(grTest) || grTest.Equals("1")) { // YAY! Valid login |
443 | Console.WriteLine("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); | ||
444 | this.AgentID=cirpack.CircuitCode.ID; | ||
445 | this.SessionID=cirpack.CircuitCode.SessionID; | ||
446 | this.CircuitCode=cirpack.CircuitCode.Code; | ||
447 | InitNewClient(); | ||
448 | ClientLoop(); | ||
449 | } else { // Invalid | ||
450 | Console.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); | ||
451 | ClientThread.Abort(); | ||
452 | } | ||
453 | } else { | ||
439 | this.AgentID=cirpack.CircuitCode.ID; | 454 | this.AgentID=cirpack.CircuitCode.ID; |
440 | this.SessionID=cirpack.CircuitCode.SessionID; | 455 | this.SessionID=cirpack.CircuitCode.SessionID; |
441 | this.CircuitCode=cirpack.CircuitCode.Code; | 456 | this.CircuitCode=cirpack.CircuitCode.Code; |
442 | InitNewClient(); | 457 | InitNewClient(); |
443 | ClientLoop(); | 458 | ClientLoop(); |
444 | } else { // Invalid | ||
445 | Console.WriteLine("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); | ||
446 | ClientThread.Abort(); | ||
447 | } | 459 | } |
448 | } | 460 | } |
449 | } | 461 | } |