Clone of PhatAC @ https://github.com/floaterxk/PhatAC

NetworkDefs.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. struct BlobHeader_s //Size: 0x14
  3. {
  4. DWORD dwSequence; //0x00
  5. DWORD dwFlags; //0x04
  6. DWORD dwCRC; //0x08
  7. WORD wRecID; //0x0C
  8. WORD wTime; //0x0E
  9. WORD wSize; //0x10
  10. WORD wTable; //0x12
  11. };
  12. struct BlobPacket_s
  13. {
  14. BlobHeader_s header;
  15. BYTE data[];
  16. };
  17. #define DUPEBLOB(name, source) \
  18. BlobPacket_s *name = (BlobPacket_s *)new BYTE[ BLOBLEN(source) ]; \
  19. memcpy(name, source, BLOBLEN(source));
  20. #define CREATEBLOB(name, size) \
  21. BlobPacket_s *name = (BlobPacket_s *)new BYTE[ sizeof(BlobHeader_s) + (size) ]; \
  22. name->header.wSize = (WORD)(size);
  23. #define DELETEBLOB(name) delete [] name
  24. #define BLOBLEN(x) (sizeof(BlobHeader_s) + (x)->header.wSize)
  25. struct FragHeader_s
  26. {
  27. DWORD dwSequence;
  28. DWORD dwID;
  29. WORD wCount;
  30. WORD wSize;
  31. WORD wIndex;
  32. WORD wGroup;
  33. };
  34. struct FragPacket_s
  35. {
  36. FragHeader_s header;
  37. BYTE data[];
  38. };
  39. #pragma pack(pop)
  40. #pragma warning(default: 4200)
  41. //Blob types.
  42. #define BT_NULL 0x00000000 //Used on account login packets.
  43. #define BT_RESENT 0x00000001 //
  44. #define BT_REQUESTLOST 0x00001000 // What value is this now?
  45. // #define BT_FLUSH 0x00000004 // What value is this now?
  46. #define BT_DENY 0x00002000 //
  47. #define BT_ACKSEQUENCE 0x00004000 //
  48. #define BT_DISCONNECT 0x00008000 //
  49. #define BT_CONNECTIONACK 0x00080000 //
  50. // #define BT_CRCUPDATE 0x00000100 Not sure what this is now //
  51. #define BT_FRAGMENTS 0x00000004 // 0x00000200 //
  52. #define BT_RESETTIME 0x00000400 //
  53. //#define BT_STRANSFER 0x00000800 0x100? //Server transfers. Used on login servers, primarily.
  54. #define BT_LOGIN 0x00010000 //
  55. //#define BT_WTRANSFER 0x00020000 0x100? //Server transfers. Used on world servers, primarily.
  56. #define BT_LOGINREPLY 0x00040000 //
  57. // #define BT_WAKE 0x00080000 //
  58. #define BT_TIMEUPDATE 0x01000000 //
  59. #define BT_ECHOREQUEST 0x02000000 //hi u
  60. #define BT_ECHORESPONSE 0x04000000 //hi u
  61. #define BT_FLOW 0x08000000 //hi u
  62. #define BT_ERROR 0x00800000 //
  63. #define BT_USES_CRC 0x2
  64. #define OBJECT_MSG 10 // old value was 0x03?
  65. #define PRIVATE_MSG 9 // old value was 0x04?
  66. #define EVENT_MSG 5 // old value was 0x07?
  67. #define MAX_BLOB_LEN 0x1E8
  68. #define MAX_FRAGMENT_LEN 0x1C0
  69. #define MAX_MESSAGE_LEN (0x1C0 * 0x10)