diff options
author | MW | 2007-04-01 12:02:44 +0000 |
---|---|---|
committer | MW | 2007-04-01 12:02:44 +0000 |
commit | f0a3edfb34580334a2b8c8ebced8ee380ec733d7 (patch) | |
tree | e839080d14b2bd7aa69769c0e0dc6e9287671154 /OpenSim.RegionServer/OpenSimMain.cs | |
parent | More work on adding Packets handlers and tested the first handler. (diff) | |
download | opensim-SC-f0a3edfb34580334a2b8c8ebced8ee380ec733d7.zip opensim-SC-f0a3edfb34580334a2b8c8ebced8ee380ec733d7.tar.gz opensim-SC-f0a3edfb34580334a2b8c8ebced8ee380ec733d7.tar.bz2 opensim-SC-f0a3edfb34580334a2b8c8ebced8ee380ec733d7.tar.xz |
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 | ||