Connection.pkg 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 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. const Vector3& GetPosition() const;
  29. const Quaternion& GetRotation() const;
  30. bool IsClient() const;
  31. bool IsConnected() const;
  32. bool IsConnectPending() const;
  33. bool IsSceneLoaded() const;
  34. bool GetLogStatistics() const;
  35. String GetAddress() const;
  36. unsigned short GetPort() const;
  37. String ToString() const;
  38. unsigned GetNumDownloads() const;
  39. const String GetDownloadName() const;
  40. float GetDownloadProgress() const;
  41. tolua_property__get_set VariantMap& identity;
  42. tolua_property__get_set Scene* scene;
  43. tolua_property__get_set Controls& controls;
  44. tolua_property__get_set Vector3& position;
  45. tolua_property__get_set Quaternion& rotation;
  46. tolua_readonly tolua_property__is_set bool client;
  47. tolua_readonly tolua_property__is_set bool connected;
  48. tolua_property__is_set bool connectPending;
  49. tolua_readonly tolua_property__is_set bool sceneLoaded;
  50. tolua_property__get_set bool logStatistics;
  51. tolua_readonly tolua_property__get_set String address;
  52. tolua_readonly tolua_property__get_set unsigned short port;
  53. tolua_readonly tolua_property__get_set unsigned numDownloads;
  54. tolua_readonly tolua_property__get_set String downloadName;
  55. tolua_readonly tolua_property__get_set float downloadProgress;
  56. };