|
group2 0.1.0
CSE 125 Group 2
|
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. | |
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.
| bool ServerGame::init | ( | const char * | addr, |
| Uint16 | port, | ||
| int | tickRateHz = 128 |
||
| ) |
Bind to the given address and port, spawn test entities.
| addr | Hostname or IP to bind to (e.g. "127.0.0.1"). |
| port | TCP port to listen on. |
| tickRateHz | Physics tick rate in Hz (default 128). |
| void ServerGame::run | ( | ) |
Block and run the game loop until shutdown() is called.
| void ServerGame::shutdown | ( | ) |
Signal the loop to stop and release all resources.