I'm making Checkers game in unity for android platform. I was given a task to make this game multiplayer and implement TCP/IP network in C# language, and for Server side I have to use Golang. I nearly finished the game itself, but I don't know nothing about server and tcp, how to implement them for my game. is there any way to start that or tutorials to show how to do that ? Any advice will be great ! Thanks in advance!
Okay, so, you're trying to build the server-client communication of your app. When we talk about communication, there is a keyword that always appear: socket. In short, sockets allow communication between two different processes on the same or different machines. There are different types of sockets, you can check differences between some of them here and here.
To establish a communication channel, the steps that are needed on the client side are:
And on the server side are:
Normally, on the server side you want to create a socket pool, in order to achieve more performance (instead of creating a new socket for each player that connects to your server).
Check the image below to see how is the interaction flow between server and client. In your case, requests are messages sent from players to the server with game info (e.g., the move a player did in its turn). Messages that go from server to the players can be just an ACK or they can be a more elaborated information (e.g., the move an opponent did in its turn).
Now, the transmission of data: Since Internet just can handle bits and does not understand what an object or a struct are, we have to Serialize and Deserialize the messages when they go out to the Internet or arrive from it. To achieve this in an easy you can use Protocol Buffers, a tool built by Uncle Google that simplifies this process and that can be used by different languages (e.g., Go and C#).
Take some examples below on how to build a server-client app in Go and C#, separately. You can then choose which parts do you need to your project:
Hope it helped!