Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Getting Started

Malyson Breno edited this page Mar 4, 2020 · 4 revisions

Radiko Netcode is a free framework made to be easy to understand the basic of multiplayer games.
Feel free to use it in your game.

Connecting to the server

We get started connecting your game to the server.

its pretty simple to do it. You just need to get your client to send a string to the server by this way:

—Obsolete code—
string message = "Hello"+'|'+PlayerName;

"Hello" means that it wants to connect to the server.
'|' is the separator of strings.
PlayerName is the name of the player that will be sent to the server.

use this instead:

You will need to use an array of bytes (char if you are coding a client in c)
The header byte is the signal, the client or the server will know what to do with the data ahead.

you just need to put the first byte with the 4 value, and the other bytes needs to be the name of the user in ASCII.

in a simple view using will be like this way:
4+PlayerName

if you want to know more about the header byte click here

But be calm, there's a lot of code pre-made to help you. PackageManager.cs will do all the job for you.

This way the server will translate it to an incoming new player to the server, and will create a reference in the memory to it.

Now the user is "connected" the server will send a ping request every 2 seconds,
your client will need to answer that request to keep connected to the server.

If you lost more then 10 request the server will disconnect you.

Synchronizing positions

This page is under construction...

This wiki is under construction yet, so somethings may change in the future.

Clone this wiki locally