Skip to content

How to login to the server

King Kong edited this page Dec 8, 2019 · 1 revision

When a request is sent to the server, it can be one of some types: TCP, UDP or WebSocket. The first time the server receives a request, it creates an instance call Connection to handle that one. Now, you can make a bi-direction communication with your anonymous client. In this step, you can also determine that this current request can be upgraded from a Connection to a Player or not. To do that, a client sends a request with the right credentials data and if it passes your own conditionals, you can upgrade it to be a Player. You can assign a name to your connection to make it becomes a player but need to make sure that that name is unique in your server or your database. One Player is an authenticated Connection with a unique name that is treated as an ID. Working with the Player, you can define your own variables or attributions to manage all its states in the server.