-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
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.
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.
This page is under construction...
Radiko Project — 2020
This wiki is under construction yet, so somethings may change in the future.