|
| Connection (Context *context, bool isClient, const SLNet::AddressOrGUID &address, SLNet::RakPeerInterface *peer) |
| Construct with context, RakNet connection address and Raknet peer pointer.
|
|
| ~Connection () override |
| Destruct.
|
|
PacketType | GetPacketType (bool reliable, bool inOrder) |
| Get packet type based on the message parameters.
|
|
void | SendMessage (int msgID, bool reliable, bool inOrder, const VectorBuffer &msg, unsigned contentID=0) |
| Send a message.
|
|
void | SendMessage (int msgID, bool reliable, bool inOrder, const unsigned char *data, unsigned numBytes, unsigned contentID=0) |
| Send a message.
|
|
void | SendRemoteEvent (StringHash eventType, bool inOrder, const VariantMap &eventData=Variant::emptyVariantMap) |
| Send a remote event.
|
|
void | SendRemoteEvent (Node *node, StringHash eventType, bool inOrder, const VariantMap &eventData=Variant::emptyVariantMap) |
| Send a remote event with the specified node as sender.
|
|
void | SetScene (Scene *newScene) |
|
void | SetIdentity (const VariantMap &identity) |
| Assign identity. Called by Network.
|
|
void | SetControls (const Controls &newControls) |
| Set new controls.
|
|
void | SetPosition (const Vector3 &position) |
|
void | SetRotation (const Quaternion &rotation) |
|
void | SetConnectPending (bool connectPending) |
| Set the connection pending status. Called by Network.
|
|
void | SetLogStatistics (bool enable) |
|
void | Disconnect (int waitMSec=0) |
| Disconnect. If wait time is non-zero, will block while waiting for disconnect to finish.
|
|
void | SendServerUpdate () |
| Send scene update messages. Called by Network.
|
|
void | SendClientUpdate () |
| Send latest controls from the client. Called by Network.
|
|
void | SendRemoteEvents () |
| Send queued remote events. Called by Network.
|
|
void | SendPackages () |
| Send package files to client. Called by network.
|
|
void | SendBuffer (PacketType type) |
| Send out buffered messages by their type.
|
|
void | SendAllBuffers () |
| Send out all buffered messages.
|
|
void | ProcessPendingLatestData () |
| Process pending latest data for nodes and components.
|
|
bool | ProcessMessage (int msgID, MemoryBuffer &buffer) |
| Process a message from the server or client. Called by Network.
|
|
void | Ban () |
| Ban this connections IP address.
|
|
const SLNet::AddressOrGUID & | GetAddressOrGUID () const |
| Return the RakNet address/guid.
|
|
void | SetAddressOrGUID (const SLNet::AddressOrGUID &addr) |
| Set the the RakNet address/guid.
|
|
VariantMap & | GetIdentity () |
| Return client identity.
|
|
Scene * | GetScene () const |
|
const Controls & | GetControls () const |
| Return the client controls of this connection.
|
|
unsigned char | GetTimeStamp () const |
| Return the controls timestamp, sent from client to server along each control update.
|
|
const Vector3 & | GetPosition () const |
|
const Quaternion & | GetRotation () const |
|
bool | IsClient () const |
|
bool | IsConnected () const |
|
bool | IsConnectPending () const |
|
bool | IsSceneLoaded () const |
|
bool | GetLogStatistics () const |
|
String | GetAddress () const |
|
unsigned short | GetPort () const |
|
float | GetRoundTripTime () const |
|
unsigned | GetLastHeardTime () const |
|
float | GetBytesInPerSec () const |
|
float | GetBytesOutPerSec () const |
|
int | GetPacketsInPerSec () const |
|
int | GetPacketsOutPerSec () const |
|
String | ToString () const |
| Return an address:port string.
|
|
unsigned | GetNumDownloads () const |
|
const String & | GetDownloadName () const |
|
float | GetDownloadProgress () const |
|
void | SendPackageToClient (PackageFile *package) |
| Trigger client connection to download a package file from the server. Can be used to download additional resource packages when client is already joined in a scene. The package must have been added as a requirement to the scene the client is joined in, or else the eventual download will fail.
|
|
void | ConfigureNetworkSimulator (int latencyMs, float packetLoss) |
| Set network simulation parameters. Called by Network.
|
|
void | SetPacketSizeLimit (int limit) |
| Buffered packet size limit, when reached, packet is sent out immediately.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
|
virtual const String & | GetTypeName () const =0 |
|
virtual const TypeInfo * | GetTypeInfo () const =0 |
| Return type info.
|
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
|
bool | IsInstanceOf (StringHash type) const |
| Check current instance is type of specified type.
|
|
bool | IsInstanceOf (const TypeInfo *typeInfo) const |
| Check current instance is type of specified type.
|
|
template<typename T > |
bool | IsInstanceOf () const |
| Check current instance is type of specified class.
|
|
template<typename T > |
T * | Cast () |
| Cast the object to specified most derived class.
|
|
template<typename T > |
const T * | Cast () const |
| Cast the object to specified most derived class.
|
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
|
void | SubscribeToEvent (StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to a specific sender's event.
|
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events).
|
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
VariantMap & | GetEventDataMap () const |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
template<typename... Args> |
void | SendEvent (StringHash eventType, Args... args) |
| Send event with variadic parameter pairs to all subscribers. The parameter pairs is a list of paramID and paramValue separated by comma, one pair after another.
|
|
Context * | GetContext () const |
| Return execution context.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
|
const VariantMap & | GetGlobalVars () const |
|
void | SetGlobalVar (StringHash key, const Variant &value) |
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
|
bool | HasEventHandlers () const |
| Return whether has subscribed to any event.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
const String & | GetCategory () const |
|
void | SetBlockEvents (bool block) |
| Block object from sending and receiving events.
|
|
bool | GetBlockEvents () const |
| Return sending and receiving events blocking status.
|
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
|
| RefCounted (const RefCounted &rhs)=delete |
| Prevent copy construction.
|
|
RefCounted & | operator= (const RefCounted &rhs)=delete |
| Prevent assignment.
|
|
void | AddRef () |
|
void | ReleaseRef () |
|
int | Refs () const |
|
int | WeakRefs () const |
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|
|
| URHO3D_OBJECT (Connection, Object) |
|
void | HandleAsyncLoadFinished (StringHash eventType, VariantMap &eventData) |
| Handle scene loaded event.
|
|
void | ProcessLoadScene (int msgID, MemoryBuffer &msg) |
| Process a LoadScene message from the server. Called by Network.
|
|
void | ProcessSceneChecksumError (int msgID, MemoryBuffer &msg) |
| Process a SceneChecksumError message from the server. Called by Network.
|
|
void | ProcessSceneUpdate (int msgID, MemoryBuffer &msg) |
| Process a scene update message from the server. Called by Network. More...
|
|
void | ProcessPackageDownload (int msgID, MemoryBuffer &msg) |
| Process package download related messages. Called by Network.
|
|
void | ProcessIdentity (int msgID, MemoryBuffer &msg) |
| Process an Identity message from the client. Called by Network.
|
|
void | ProcessControls (int msgID, MemoryBuffer &msg) |
| Process a Controls message from the client. Called by Network.
|
|
void | ProcessSceneLoaded (int msgID, MemoryBuffer &msg) |
| Process a SceneLoaded message from the client. Called by Network.
|
|
void | ProcessRemoteEvent (int msgID, MemoryBuffer &msg) |
| Process a remote event message from the client or server. Called by Network.
|
|
void | ProcessNode (unsigned nodeID) |
| Process a node for sending a network update. Recurses to process depended on node(s) first.
|
|
void | ProcessNewNode (Node *node) |
| Process a node that the client has not yet received.
|
|
void | ProcessExistingNode (Node *node, NodeReplicationState &nodeState) |
| Process a node that the client has already received. More...
|
|
void | ProcessPackageInfo (int msgID, MemoryBuffer &msg) |
| Process a SyncPackagesInfo message from server.
|
|
void | ProcessUnknownMessage (int msgID, MemoryBuffer &msg) |
| Process unknown message. All unknown messages are forwarded as an events.
|
|
bool | RequestNeededPackages (unsigned numPackages, MemoryBuffer &msg) |
| Check a package list received from server and initiate package downloads as necessary. Return true on success, or false if failed to initialze downloads (cache dir not set).
|
|
void | RequestPackage (const String &name, unsigned fileSize, unsigned checksum) |
| Initiate a package download.
|
|
void | SendPackageError (const String &name) |
| Send an error reply for a package download.
|
|
void | OnSceneLoadFailed () |
| Handle scene load failure on the server or client.
|
|
void | OnPackageDownloadFailed (const String &name) |
| Handle a package download failure on the client.
|
|
void | OnPackagesReady () |
| Handle all packages loaded successfully. Also called directly on MSG_LOADSCENE if there are none.
|
|
Connection to a remote network host.