CHATDEFS.H 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef CHATDEFS_HEADER
  19. #define CHATDEFS_HEADER
  20. //
  21. // Response errors (Sent as arguments to the OnFoo calls)
  22. //
  23. // Your nick is still logged into chat
  24. #define CHAT_E_NICKINUSE MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 100)
  25. // Your password is incorrect during login
  26. #define CHAT_E_BADPASS MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 101)
  27. // Reference made to non-existant user or channel
  28. #define CHAT_E_NONESUCH MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 102)
  29. // The network layer is down or cannot be initialized for some reason
  30. #define CHAT_E_CON_NETDOWN MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 103)
  31. // Name lookup (e.g DNS) failed for some reason
  32. #define CHAT_E_CON_LOOKUP_FAILED MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 104)
  33. // Some fatal error occured with the net connection
  34. #define CHAT_E_CON_ERROR MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 105)
  35. // General request timeout for a request
  36. #define CHAT_E_TIMEOUT MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 106)
  37. // Must patch before continuing
  38. #define CHAT_E_MUSTPATCH MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 107)
  39. // Miscellaneous internal status error
  40. #define CHAT_E_STATUSERROR MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 108)
  41. // Server has returned something we don't recognise
  42. #define CHAT_E_UNKNOWNRESPONSE MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 109)
  43. // Tried to join a channel that has enough players already
  44. #define CHAT_E_CHANNELFULL MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 110)
  45. // Tried to create a channel that already exists
  46. #define CHAT_E_CHANNELEXISTS MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 111)
  47. // Tried to join a channel that does not exist
  48. #define CHAT_E_CHANNELDOESNOTEXIST MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 112)
  49. // Tried to join a channel with the wrong password
  50. #define CHAT_E_BADCHANNELPASSWORD MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 113)
  51. // You've been banned from the server / channel
  52. #define CHAT_E_BANNED MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 114)
  53. // You tried to do something that required operator status
  54. #define CHAT_E_NOT_OPER MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 115)
  55. //
  56. // Response success codes (non-error arguments passed to the OnFoo callbacks)
  57. // Note: S_OK is the usual success code
  58. // A network connection is underway
  59. #define CHAT_S_CON_CONNECTING MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 300)
  60. // A network connection is complete
  61. #define CHAT_S_CON_CONNECTED MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 301)
  62. // A network connection is going down
  63. #define CHAT_S_CON_DISCONNECTING MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 302)
  64. // A network connection is closed
  65. #define CHAT_S_CON_DISCONNECTED MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 303)
  66. // Find - Nick not in system
  67. #define CHAT_S_FIND_NOTHERE MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 304)
  68. // Find - Not in any channels
  69. #define CHAT_S_FIND_NOCHAN MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 305)
  70. // Find - user has find turned off
  71. #define CHAT_S_FIND_OFF MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 306)
  72. // Page - Nick not in system
  73. #define CHAT_S_PAGE_NOTHERE MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 307)
  74. // Page - user has page turned off
  75. #define CHAT_S_PAGE_OFF MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 308)
  76. // This channel list is only a ping update
  77. #define CHAT_S_PINGLIST MAKE_HRESULT( SEVERITY_SUCCESS, FACILITY_ITF, 315)
  78. //
  79. // Request errors (returned from the RequestFoo calls)
  80. //
  81. // You are not connected to the chat server
  82. #define CHAT_E_NOTCONNECTED MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 500)
  83. // You are not in a channel
  84. #define CHAT_E_NOCHANNEL MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 501)
  85. // Feature is not implemented
  86. #define CHAT_E_NOTIMPLEMENTED MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 502)
  87. // The request was made while while a conflicting request was still pending
  88. #define CHAT_E_PENDINGREQUEST MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 503)
  89. // Invalid parameter passed - usually a NULL pointer
  90. #define CHAT_E_PARAMERROR MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 504)
  91. // Tried to create or join a channel before leaving the previous one
  92. #define CHAT_E_LEAVECHANNEL MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 508)
  93. // Tried to send something to a channel when not a member of any channel
  94. #define CHAT_E_JOINCHANNEL MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 509)
  95. // Tried to join a non-existant channel
  96. #define CHAT_E_UNKNOWNCHANNEL MAKE_HRESULT( SEVERITY_ERROR, FACILITY_ITF, 510)
  97. //
  98. // Request success codes
  99. // Notes: S_OK is the usual success code
  100. //
  101. // Channel list filter values
  102. //
  103. #define CHAT_CHANNEL_LIST_ALL -99999
  104. //
  105. // User flags (bit field)
  106. //
  107. // The owner of the current channel
  108. #define CHAT_USER_CHANNELOWNER 0x0001
  109. // The person with voice (conch shell...)
  110. #define CHAT_USER_VOICE 0x0002
  111. // The local user
  112. #define CHAT_USER_MYSELF 0x8000
  113. //
  114. // Channel flags (bit field)
  115. //
  116. #define CHAN_MODE_PRIVATE 0x0004
  117. #define CHAN_MODE_SECRET 0x0008
  118. #define CHAN_MODE_MODERATED 0x0010
  119. #define CHAN_MODE_TOPICLIMIT 0x0020
  120. #define CHAN_MODE_INVITEONLY 0x0040
  121. #define CHAN_MODE_NOPRIVMSGS 0x0080
  122. #define CHAN_MODE_KEY 0x0100
  123. #define CHAN_MODE_BAN 0x0200
  124. #define CHAN_MODE_LIMIT 0x0400
  125. #endif