group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ServerGame Class Reference

Top-level server game loop. More...

#include <ServerGame.hpp>

Public Member Functions

bool init (const char *addr, Uint16 port, int tickRateHz=128)
 Bind to the given address and port, spawn test entities.
 
void run ()
 Block and run the game loop until shutdown() is called.
 
void shutdown ()
 Signal the loop to stop and release all resources.
 

Detailed Description

Top-level server game loop.

Owns the ECS registry and the network Server. Each tick it drains incoming messages, runs all ECS systems, and broadcasts state.

Member Function Documentation

◆ init()

bool ServerGame::init ( const char *  addr,
Uint16  port,
int  tickRateHz = 128 
)

Bind to the given address and port, spawn test entities.

Parameters
addrHostname or IP to bind to (e.g. "127.0.0.1").
portTCP port to listen on.
tickRateHzPhysics tick rate in Hz (default 128).
Returns
True on success, false on network or initialisation failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void ServerGame::run ( )

Block and run the game loop until shutdown() is called.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown()

void ServerGame::shutdown ( )

Signal the loop to stop and release all resources.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: