aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/PacketServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/PacketServer.cs')
-rw-r--r--OpenSim/OpenSim.RegionServer/PacketServer.cs40
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs
index 6c6f4ca..dd8de4c 100644
--- a/OpenSim/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs
@@ -1,16 +1,20 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.world;
5using libsecondlife.Packets; 4using libsecondlife.Packets;
5using OpenSim.Framework.Interfaces;
6using System.Net;
7using System.Net.Sockets;
8using OpenSim.Assets;
6 9
7namespace OpenSim 10namespace OpenSim
8{ 11{
9 public class PacketServer 12 public class PacketServer
10 { 13 {
11 private OpenSimNetworkHandler _networkHandler; 14 private OpenSimNetworkHandler _networkHandler;
12 private World _localWorld; 15 private IWorld _localWorld;
13 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); 16 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
17 public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>();
14 18
15 public PacketServer(OpenSimNetworkHandler networkHandler) 19 public PacketServer(OpenSimNetworkHandler networkHandler)
16 { 20 {
@@ -18,7 +22,7 @@ namespace OpenSim
18 _networkHandler.RegisterPacketServer(this); 22 _networkHandler.RegisterPacketServer(this);
19 } 23 }
20 24
21 public World LocalWorld 25 public IWorld LocalWorld
22 { 26 {
23 set 27 set
24 { 28 {
@@ -59,27 +63,23 @@ namespace OpenSim
59 63
60 } 64 }
61 65
62 #region Client Packet Handlers 66 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AuthenticateSessionsBase authenticateSessionsClass)
63
64 public bool RequestUUIDName(ClientView simClient, Packet packet)
65 { 67 {
66 System.Text.Encoding enc = System.Text.Encoding.ASCII; 68 ClientView newuser = new ClientView(epSender, useCircuit, this.ClientThreads, assetCache, this, inventoryCache, authenticateSessionsClass);
67 Console.WriteLine(packet.ToString()); 69 this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
68 UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet; 70 this.ClientAPIs.Add(useCircuit.CircuitCode.Code, (IClientAPI)newuser);
69 UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket();
70 nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length];
71 71
72 for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++)
73 {
74 nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
75 nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID;
76 nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name
77 nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up
78 }
79 simClient.OutPacket(nameReply);
80 return true; 72 return true;
81 } 73 }
82 74
83 #endregion 75 public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
76 {
77 this._networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
78 }
79
80 public virtual void RemoveClientCircuit(uint circuitcode)
81 {
82 this._networkHandler.RemoveClientCircuit(circuitcode);
83 }
84 } 84 }
85} 85}