Connection.pkg 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. $#include "Connection.h"
  2. struct RemoteEvent
  3. {
  4. unsigned senderID_ @ senderID;
  5. StringHash eventType_ @ eventType;
  6. VariantMap eventData_ @ eventData;
  7. bool inOrder_ @ inOrder;
  8. };
  9. class Connection : public Object
  10. {
  11. void SendMessage(int msgID, bool reliable, bool inOrder, const VectorBuffer& msg, unsigned contentID = 0);
  12. void SendMessage(int msgID, bool reliable, bool inOrder, const VectorBuffer& msg);
  13. void SendMessage(int msgID, bool reliable, bool inOrder, const unsigned char* data, unsigned numBytes, unsigned contentID = 0);
  14. void SendMessage(int msgID, bool reliable, bool inOrder, const unsigned char* data, unsigned numBytes);
  15. void SendRemoteEvent(StringHash eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  16. void SendRemoteEvent(StringHash eventType, bool inOrder);
  17. void SendRemoteEvent(const char* eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  18. void SendRemoteEvent(const char* eventType, bool inOrder);
  19. void SendRemoteEvent(Node* node, StringHash eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  20. void SendRemoteEvent(Node* node, StringHash eventType, bool inOrder);
  21. void SendRemoteEvent(Node* node, const char* eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  22. void SendRemoteEvent(Node* node, const char* eventType, bool inOrder);
  23. void SetScene(Scene* newScene);
  24. void SetIdentity(const VariantMap& identity);
  25. void SetControls(const Controls& newControls);
  26. void SetPosition(const Vector3& position);
  27. void SetConnectPending(bool connectPending);
  28. void SetLogStatistics(bool enable);
  29. void Disconnect(int waitMSec = 0);
  30. void SendServerUpdate();
  31. void SendClientUpdate();
  32. void SendRemoteEvents();
  33. void SendPackages();
  34. void ProcessPendingLatestData();
  35. bool ProcessMessage(int msgID, MemoryBuffer& msg);
  36. const VariantMap& GetIdentity() const;
  37. Scene* GetScene() const;
  38. const Controls& GetControls() const;
  39. const Vector3& GetPosition() const;
  40. bool IsClient() const;
  41. bool IsConnected() const;
  42. bool IsConnectPending() const;
  43. bool IsSceneLoaded() const;
  44. bool GetLogStatistics() const;
  45. String GetAddress() const;
  46. unsigned short GetPort() const;
  47. String ToString() const;
  48. unsigned GetNumDownloads() const;
  49. const String& GetDownloadName() const;
  50. float GetDownloadProgress() const;
  51. tolua_property__get_set VariantMap& identity;
  52. tolua_property__get_set Scene* scene;
  53. tolua_property__get_set Controls& controls;
  54. tolua_property__get_set Vector3& position;
  55. tolua_readonly tolua_property__is_set bool client;
  56. tolua_readonly tolua_property__is_set bool connected;
  57. tolua_property__is_set bool connectPending;
  58. tolua_readonly tolua_property__is_set bool sceneLoaded;
  59. tolua_property__get_set bool logStatistics;
  60. tolua_readonly tolua_property__get_set String address;
  61. tolua_readonly tolua_property__get_set unsigned short port;
  62. tolua_readonly tolua_property__get_set unsigned numDownloads;
  63. tolua_readonly tolua_property__get_set String& downloadName;
  64. tolua_readonly tolua_property__get_set float downloadProgress;
  65. };