Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Shobu Network Library

Usage

###Initialize the network

ShobuNetwork network;

// You must register required callbacks before establishing a connection with a remote client
network.registerCallbacks( gameUpdate, storeState, restoreState, checkSync, &user_data);

If hosting


// Set the number of game updates to delay input
network.setInputDelay(3);

network.initializeHost(port);

// Returns when a client as connected or a time out occured
network.waitForClient();

if(network.connected()) {
   // Host specific initialization code here
   ...
}

If connecting to the host

network.initializeClient(host_ip, host_port);

// Returns when connected to the host or timed out
network.connectToHost();

if(network.connected()) {
   // Client specific initialization code here
   ...
}

After a connection is established you update your game like so

if(network.connected()) {
    network.update(local_input);
}

About

A Networking Library for Games

Resources

Stars

32 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages