Posts

Setting up the game-server by C# socket

Image
Input from the client and server returns the position We're trying to set up the socket-server instead of using "Photon Engine", which the flexibility is much higher. In this week, I am trying to let the player sending input from the client-side and let the server to return the position of the player. This design could prevent player cheats through the client-side. Client-side PlayerController - a class which detect player's input and sending them to server public class PlayerController : MonoBehaviour { private void FixedUpdate() { SendInputToServer(); } private void SendInputToServer() { bool[] _inputs = new bool[] { Input.GetKey(KeyCode.W), Input.GetKey(KeyCode.A), Input.GetKey(KeyCode.S), Input.GetKey(KeyCode.D) }; ClientSend.PlayerMovement(_inputs); } } ClientHandle.PlayerPosition - a function that receives the position from the server public static v

A Draft Design Pattern

Image