Advertisement
Guest User

wizards

a guest
Jun 12th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. using Arrowgene.Services.Buffers;
  2. using Arrowgene.Services.Networking.Tcp;
  3.  
  4. namespace Necromancy.Server
  5. {
  6. public class MessageServer : NecromancyServer
  7. {
  8. public override void OnReceivedData(ITcpSocket socket, byte[] data)
  9. {
  10. IBuffer buffer = new StreamBuffer(data);
  11. PacketLogIn(buffer);
  12. buffer.SetPositionStart();
  13.  
  14. int size = buffer.ReadInt16(Endianness.Big);
  15. int opCode = buffer.ReadInt16(Endianness.Big);
  16.  
  17. switch (opCode)
  18. {
  19. case 0x0557: // network::proto_msg_implement_client::send_base_check_version
  20. {
  21. uint unknown = buffer.ReadUInt32();
  22. uint major = buffer.ReadUInt32();
  23. uint minor = buffer.ReadUInt32();
  24. _logger.Info($"{major} - {minor}");
  25. IBuffer res = new StreamBuffer();
  26.  
  27. res.WriteInt32(0);
  28. res.WriteInt32(unknown);
  29. res.WriteInt32(major);
  30. res.WriteInt32(minor);
  31.  
  32. Send(socket, 0xDDEF, res); // network::proto_msg_implement_client::recv_base_check_version_r
  33. break;
  34. }
  35. case 0x3DA5: // network::proto_msg_implement_client::send_base_login
  36. {
  37. byte otherBytes = 0;
  38. //buffer.Position = 7;
  39. //string macAddress = buffer.ReadFixedString(17);
  40. IBuffer res = new StreamBuffer();
  41. res.WriteByte(otherBytes);
  42. res.WriteByte(otherBytes);
  43. res.WriteByte(otherBytes);
  44. res.WriteByte(otherBytes);
  45. res.WriteByte(otherBytes);
  46. res.WriteByte(otherBytes);
  47. //res.WriteByte(otherBytes);
  48. //res.WriteByte(otherBytes);
  49. //res.WriteByte(otherBytes);
  50. //res.WriteByte(otherBytes);
  51. //res.WriteByte(otherBytes);
  52. //res.WriteByte(otherBytes);
  53. //res.WriteByte(otherBytes);
  54. //res.WriteByte(otherBytes);
  55. //res.WriteByte(otherBytes);
  56. //res.WriteByte(otherBytes);
  57. //res.WriteByte(otherBytes);
  58. //res.WriteByte(otherBytes);
  59. //res.WriteByte(otherBytes);
  60. //res.WriteByte(otherBytes);
  61. //res.WriteByte(otherBytes);
  62. //res.WriteByte(otherBytes);
  63. //res.WriteByte(otherBytes);
  64. //res.WriteByte(otherBytes);
  65.  
  66. Send(socket, 0xF31A, res);
  67.  
  68. // TODO find proto_msg_implement_client::send_base_login
  69. break;
  70. }
  71. default:
  72. {
  73. _logger.Error($"[World]OPCode: {opCode} not handled");
  74. break;
  75. }
  76.  
  77. // MessageServer Switch - 0x004E4210
  78. // OP Codes: (all Hex 0X)
  79. // 831C //unable to figure this one out 24+opcode max
  80. // 4090 proto_msg_implement_client::recv_party_notify_update_map 00 13 90 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  81. // 1AF3
  82. // 087D
  83. // 0482
  84.  
  85. // 082 - 019C
  86. // 082 - 019C - 002A
  87. // 082 - 019C - 002A - 0003
  88.  
  89. // BA73 proto_msg_implement_client::recv_cpf_authentication 00 06 73 BA 00 00 00 00
  90. // 9AD1 proto_msg_implement_client::recv_chara_delete_r 00 06 D1 9A 00 00 00 00
  91. // 8E0A proto_msg_implement_client::recv_party_notify_kick (no structure)
  92. // 8D24
  93. // 8D24 - 853F
  94. // 8D24 - 853F - 0637
  95. // 8D24 - 853F - 0637 - 003B
  96.  
  97. }
  98. }
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement