Connection.pkg 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. $#include "Network/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 SendRemoteEvent(StringHash eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  13. void SendRemoteEvent(const String eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  14. void SendRemoteEvent(Node* node, StringHash eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  15. void SendRemoteEvent(Node* node, const String eventType, bool inOrder, const VariantMap& eventData = Variant::emptyVariantMap);
  16. void SetScene(Scene* newScene);
  17. void SetIdentity(const VariantMap& identity);
  18. void SetControls(const Controls& newControls);
  19. void SetPosition(const Vector3& position);
  20. void SetRotation(const Quaternion& rotation);
  21. void SetConnectPending(bool connectPending);
  22. void SetLogStatistics(bool enable);
  23. void Disconnect(int waitMSec = 0);
  24. void SendPackageToClient(PackageFile* package);
  25. VariantMap& GetIdentity();
  26. Scene* GetScene() const;
  27. const Controls& GetControls() const;
  28. unsigned char GetTimeStamp() const;
  29. const Vector3& GetPosition() const;
  30. const Quaternion& GetRotation() const;
  31. bool IsClient() const;
  32. bool IsConnected() const;
  33. bool IsConnectPending() const;
  34. bool IsSceneLoaded() const;
  35. bool GetLogStatistics() const;
  36. String GetAddress() const;
  37. unsigned short GetPort() const;
  38. float GetRoundTripTime() const;
  39. float GetLastHeardTime() const;
  40. float GetBytesInPerSec() const;
  41. float GetBytesOutPerSec() const;
  42. float GetPacketsInPerSec() const;
  43. float GetPacketsOutPerSec() const;
  44. String ToString() const;
  45. unsigned GetNumDownloads() const;
  46. const String GetDownloadName() const;
  47. float GetDownloadProgress() const;
  48. tolua_property__get_set VariantMap& identity;
  49. tolua_property__get_set Scene* scene;
  50. tolua_property__get_set Controls& controls;
  51. tolua_readonly tolua_property__get_set unsigned char timeStamp;
  52. tolua_property__get_set Vector3& position;
  53. tolua_property__get_set Quaternion& rotation;
  54. tolua_readonly tolua_property__is_set bool client;
  55. tolua_readonly tolua_property__is_set bool connected;
  56. tolua_property__is_set bool connectPending;
  57. tolua_readonly tolua_property__is_set bool sceneLoaded;
  58. tolua_property__get_set bool logStatistics;
  59. tolua_readonly tolua_property__get_set String address;
  60. tolua_readonly tolua_property__get_set unsigned short port;
  61. tolua_readonly tolua_property__get_set float roundTripTime;
  62. tolua_readonly tolua_property__get_set float lastHeardTime;
  63. tolua_readonly tolua_property__get_set float bytesInPerSec;
  64. tolua_readonly tolua_property__get_set float bytesOutPerSec;
  65. tolua_readonly tolua_property__get_set float packetsInPerSec;
  66. tolua_readonly tolua_property__get_set float packetsOutPerSec;
  67. tolua_readonly tolua_property__get_set unsigned numDownloads;
  68. tolua_readonly tolua_property__get_set String downloadName;
  69. tolua_readonly tolua_property__get_set float downloadProgress;
  70. };