Game server logic. Handles new connections, RFCs, and pretty much everything else. Example usage: GameServer gs = new GameServer(); gs.Start(5127);
More...
|
| static ushort | gameID = 1 |
| | You will want to make this a unique value. More...
|
| |
|
| virtual bool | Verify (BinaryReader reader) |
| | Extra verification steps, if necessary. More...
|
| |
Game server logic. Handles new connections, RFCs, and pretty much everything else. Example usage: GameServer gs = new GameServer(); gs.Start(5127);
| bool TNet.GameServer.Listen |
( |
int |
port | ) |
|
Listen to the specified port. This will overwrite any previous Listen() call as only one port can be listened to at a time.
| bool TNet.GameServer.Load |
( |
string |
fileName | ) |
|
Load a previously saved server from the specified file.
| bool TNet.GameServer.LoadFrom |
( |
string |
fileName | ) |
|
| delegate void TNet.GameServer.OnCustomPacket |
( |
TcpPlayer |
player, |
|
|
Buffer |
buffer, |
|
|
BinaryReader |
reader, |
|
|
Packet |
request, |
|
|
bool |
reliable |
|
) |
| |
| delegate void TNet.GameServer.OnPlayerAction |
( |
Player |
p | ) |
|
| delegate void TNet.GameServer.OnShutdown |
( |
| ) |
|
| bool TNet.GameServer.Start |
( |
int |
tcpPort = 0, |
|
|
int |
udpPort = 0 |
|
) |
| |
Start listening to incoming connections on the specified port.
| void TNet.GameServer.Stop |
( |
| ) |
|
Accept socket callback.
Stop listening to incoming connections and disconnect all players.
| void TNet.GameServer.Update |
( |
| ) |
|
Call this function when you've disabled multi-threading.
| virtual bool TNet.GameServer.Verify |
( |
BinaryReader |
reader | ) |
|
|
protectedvirtual |
Extra verification steps, if necessary.
| ushort TNet.GameServer.gameID = 1 |
|
static |
You will want to make this a unique value.
| const bool TNet.GameServer.isMultiThreaded = true |
Lobby server link, if one is desired. You can use this to automatically inform a remote lobby server of any changes to this server.
| string TNet.GameServer.name = "Game Server" |
Any packet not already handled by the server will go to this function for processing.
Notification triggered when a player connects and authenticates successfully.
Notification triggered when a player disconnects.
Notification triggered when the server shuts down.
| bool TNet.GameServer.isActive |
|
get |
Whether the server is currently actively serving players.
| bool TNet.GameServer.isListening |
|
getset |
Whether the server is listening for incoming connections.
Set to a client instance if not using sockets.
| int TNet.GameServer.playerCount |
|
get |
How many players are currently connected to the server.
| int TNet.GameServer.tcpPort |
|
get |
Port used for listening to incoming connections. Set when the server is started.
| int TNet.GameServer.udpPort |
|
get |
Listening port for UDP packets.
The documentation for this class was generated from the following file: