ProtocolEvents.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // Urho3D Engine
  3. // Copyright (c) 2008-2011 Lasse Öörni
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to deal
  7. // in the Software without restriction, including without limitation the rights
  8. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. // copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. // THE SOFTWARE.
  22. //
  23. #pragma once
  24. #include "Object.h"
  25. /// (Server) Client has sent login
  26. EVENT(E_CLIENTLOGIN, ClientLogin)
  27. {
  28. PARAM(P_CONNECTION, Connection); // Connection pointer
  29. PARAM(P_AUTHORIZE, Authorize); // bool (set false to deny access)
  30. // Extra login data may exist if sent by the client
  31. }
  32. /// (Server) Client has joined a scene
  33. EVENT(E_CLIENTJOINEDSCENE, ClientJoinedScene)
  34. {
  35. PARAM(P_CONNECTION, Connection); // Connection pointer
  36. PARAM(P_SCENE, Scene); // Scene pointer
  37. }
  38. /// (Server) Client has left a scene
  39. EVENT(E_CLIENTLEFTSCENE, ClientLeftScene)
  40. {
  41. PARAM(P_CONNECTION, Connection); // Connection pointer
  42. PARAM(P_SCENE, Scene); // Scene pointer
  43. }
  44. /// (Server) Controls have been received from the client
  45. EVENT(E_CLIENTCONTROLS, ClientControls)
  46. {
  47. PARAM(P_CONNECTION, Connection); // Connection pointer
  48. PARAM(P_FRAMENUMBER, FrameNumber); // int (1-65535)
  49. PARAM(P_BUTTONS, Buttons); // int
  50. PARAM(P_YAW, Yaw); // float (degrees)
  51. PARAM(P_PITCH, Pitch); // float (degrees)
  52. // Other parameters may exist as part of the user extra controls variant map
  53. }
  54. /// (Server) Client has been disconnected
  55. EVENT(E_CLIENTDISCONNECTED, ClientDisconnected)
  56. {
  57. PARAM(P_CONNECTION, Connection); // Connection pointer
  58. }
  59. /// (Client) Joined the scene
  60. EVENT(E_JOINEDSCENE, JoinedScene)
  61. {
  62. }
  63. /// (Client) Failed to join the scene
  64. EVENT(E_JOINSCENEFAILED, JoinSceneFailed)
  65. {
  66. PARAM(P_REASON, Reason); // string
  67. }
  68. /// (Client) File transfer completed
  69. EVENT(E_FILETRANSFERCOMPLETED, FileTransferCompleted)
  70. {
  71. PARAM(P_FILENAME, FileName); // string
  72. PARAM(P_FULLPATH, FullPath); // string
  73. }
  74. /// (Client) File transfer failed
  75. EVENT(E_FILETRANSFERFAILED, FileTransferFailed)
  76. {
  77. PARAM(P_FILENAME, FileName); // string
  78. PARAM(P_REASON, FileName); // string
  79. }
  80. /// (Client) Controls update request, sent just before client update packet
  81. EVENT(E_CONTROLSUPDATE, ControlsUpdate)
  82. {
  83. PARAM(P_SCENE, Scene); // Scene pointer
  84. }
  85. /// (Client) Server update received
  86. EVENT(E_SERVERUPDATE, ServerUpdate)
  87. {
  88. PARAM(P_SCENE, Scene); // Scene pointer
  89. }