Skip to content

opera-aberglund/nimble-server-lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nimble Server lib

Server implementing the Nimble Protocol.

Nimble Server weaves together authoritative steps from the predicted steps sent by the clients, as well as provide a recently stored game state to joining clients. The game state is provided by one of the clients, since the Nimble Server does not do any simulation.

Usage

Initialize

typedef struct NimbleServerSetup {
    NimbleSerializeVersion applicationVersion;
    struct ImprintAllocator* memory;
    size_t maxParticipantConnectionCount;
    size_t maxParticipantCount;
    size_t maxSingleParticipantStepOctetCount;
    size_t maxParticipantCountForEachConnection;
    size_t maxGameStateOctetCount;
    DatagramTransportMulti multiTransport;
    MonotonicTimeMs now;
    Clog log;
} NimbleServerSetup;

int nimbleServerInit(NimbleServer* self, NimbleServerSetup setup);

Update

int nimbleServerUpdate(NimbleServer* self, MonotonicTimeMs now);

Local Usage

if Server Library is used embedded in a client, call nimbleServerMustProvideGameState every tick:

bool nimbleServerMustProvideGameState(const NimbleServer* self);

and if it returns true, set the latest authoritative state:

void nimbleServerSetGameState(NimbleServer* self, const uint8_t* gameState, size_t gameStateOctetCount, StepId stepId);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 71.9%
  • C++ 23.5%
  • CMake 4.6%