diff options
Moved more packet types to handlers
Diffstat (limited to 'OpenSim.RegionServer/OpenSimMain.cs')
-rw-r--r-- | OpenSim.RegionServer/OpenSimMain.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 21f4878..ed957af 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs | |||
@@ -353,6 +353,8 @@ namespace OpenSim | |||
353 | protected virtual void RegisterClientPacketHandlers() | 353 | protected virtual void RegisterClientPacketHandlers() |
354 | { | 354 | { |
355 | SimClient.AddPacketHandler(PacketType.ModifyLand, LocalWorld.ModifyTerrain); | 355 | SimClient.AddPacketHandler(PacketType.ModifyLand, LocalWorld.ModifyTerrain); |
356 | SimClient.AddPacketHandler(PacketType.ChatFromViewer, LocalWorld.SimChat); | ||
357 | SimClient.AddPacketHandler(PacketType.UUIDNameRequest, this.RequestUUIDName); | ||
356 | } | 358 | } |
357 | 359 | ||
358 | public void RunCmd(string command, string[] cmdparams) | 360 | public void RunCmd(string command, string[] cmdparams) |
@@ -401,6 +403,29 @@ namespace OpenSim | |||
401 | break; | 403 | break; |
402 | } | 404 | } |
403 | } | 405 | } |
406 | |||
407 | #region Client Packet Handlers | ||
408 | |||
409 | public bool RequestUUIDName(SimClient simClient, Packet packet) | ||
410 | { | ||
411 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | ||
412 | Console.WriteLine(packet.ToString()); | ||
413 | UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet; | ||
414 | UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket(); | ||
415 | nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length]; | ||
416 | |||
417 | for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++) | ||
418 | { | ||
419 | nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); | ||
420 | nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID; | ||
421 | nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name | ||
422 | nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up | ||
423 | } | ||
424 | simClient.OutPacket(nameReply); | ||
425 | return true; | ||
426 | } | ||
427 | |||
428 | #endregion | ||
404 | } | 429 | } |
405 | 430 | ||
406 | 431 | ||