|
Nebula
|
#include <basemultiplayerserver.h>
Inherited by Multiplayer::StandardMultiplayerServer.
Public Member Functions | |
| BaseMultiplayerServer () | |
| constructor | |
| virtual | ~BaseMultiplayerServer () |
| destructor | |
| virtual bool | Open () |
| open the server | |
| virtual void | Close () |
| close the server | |
| bool | IsOpen () const |
| return true if server is open | |
| void | DrawNetworkDebugInfo () |
| draw imgui network debug information | |
| void | Broadcast (void *buf, int size) |
| broadcast message to all clients | |
| virtual bool | OnClientIsConnecting (ClientConnection *connection) |
| Called when client is trying to connect. Override and return true if the connection should be accepted. | |
| virtual void | OnClientConnected (ClientConnection *connection) |
| Called when client has successfully connected to the server. | |
| virtual void | OnClientDisconnected (ClientConnection *connection) |
| Called when client has disconnected from the server. | |
| virtual void | OnMessageReceived (ClientConnection *connection, Timing::Time recvTime, byte *data, size_t size) |
| Called when a message has been received from a client. | |
| virtual void | OnFrame () |
| Called every "frame". | |
| virtual void | OnTick () |
| Called every tickInterval seconds, after OnFrame. | |
| Timing::Time | GetTickInterval () const |
| Returns the interval between ticks, in seconds. | |
| void | SetTickInterval (Timing::Time interval) |
| Sets the interval (seconds) between ticks. | |
| void | SetClientGroupPollInterval (ClientGroup group, Timing::Time msBetweenTicks) |
| void | SyncAll () |
| Checks for connection changes, polls messages and calls OnFrame/OnTick. | |
| void | OnNetConnectionStatusChanged (SteamNetConnectionStatusChangedCallback_t *info) |
| Used internally by GameNetworkingSockets at connection status changes. | |
Public Attributes | |
| SizeT | maxMessagesPerFrame = 1024 |
Protected Member Functions | |
| void | AddClientConnection (ClientConnection *connection) |
| add a client connection (called by the listener thread) | |
| void | PollIncomingMessages () |
| void | PollConnectionChanges () |
Protected Attributes | |
| friend | ClientConnection |
| bool | isOpen |
| Util::HashTable< HSteamNetConnection, ClientConnection *, 128 > | clientConnections |
| ISteamNetworkingSockets * | netInterface |
| HSteamListenSocket | listenSock |
| HSteamNetPollGroup | pollGroups [(int) ClientGroup::NumClientGroups] |
| Timing::Timer | pollGroupTimers [(int) ClientGroup::NumClientGroups] |
| Timing::Time | pollGroupIntervals [(int) ClientGroup::NumClientGroups] |
| Timing::Timer | tickTimer |
| Timing::Time | tickInterval |
| Multiplayer::BaseMultiplayerServer::BaseMultiplayerServer | ( | ) |
constructor
|
virtual |
destructor
|
protected |
add a client connection (called by the listener thread)
| void Multiplayer::BaseMultiplayerServer::Broadcast | ( | void * | buf, |
| int | size ) |
broadcast message to all clients
|
virtual |
close the server
Reimplemented in Multiplayer::StandardMultiplayerServer.
| void Multiplayer::BaseMultiplayerServer::DrawNetworkDebugInfo | ( | ) |
draw imgui network debug information
|
inline |
Returns the interval between ticks, in seconds.
|
inline |
return true if server is open
|
virtual |
Called when client has successfully connected to the server.
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
virtual |
Called when client has disconnected from the server.
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
virtual |
Called when client is trying to connect. Override and return true if the connection should be accepted.
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
virtual |
Called every "frame".
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
virtual |
Called when a message has been received from a client.
Reimplemented in Multiplayer::StandardMultiplayerServer.
| void Multiplayer::BaseMultiplayerServer::OnNetConnectionStatusChanged | ( | SteamNetConnectionStatusChangedCallback_t * | info | ) |
Used internally by GameNetworkingSockets at connection status changes.
|
virtual |
Called every tickInterval seconds, after OnFrame.
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
virtual |
open the server
Reimplemented in Multiplayer::StandardMultiplayerServer.
|
protected |
|
protected |
| void Multiplayer::BaseMultiplayerServer::SetClientGroupPollInterval | ( | ClientGroup | group, |
| Timing::Time | msBetweenTicks ) |
|
inline |
Sets the interval (seconds) between ticks.
| void Multiplayer::BaseMultiplayerServer::SyncAll | ( | ) |
Checks for connection changes, polls messages and calls OnFrame/OnTick.
|
protected |
|
protected |
|
protected |
|
protected |
| SizeT Multiplayer::BaseMultiplayerServer::maxMessagesPerFrame = 1024 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |