Frizikpro 2 Report post Posted August 31, 2019 (edited) Hello pirates and all fans of our game. I want to create a theme so that people share in this group with their own time. Of course I do not know what right now with the game. So I would like to see a job. Well, those who made the game on unity or on any other. Edited August 31, 2019 by Frizikpro 1 Quote Share this post Link to post Share on other sites
XXD 56 Report post Posted August 31, 2019 (edited) NETWORK SYSTEM <== Este é o inicio a base de um servidor em unity, é bem simples e obvio que deve ser melhorado, mas é uma base solida, tora simples a comunicaçao em rede especialmente feita pra suportar um mmorpg, a forma de usar é simples(tem exemplos neste arquivo) mas basicamente voce escreve um methodo no arquivo This is the beginning of a unity server, it is quite simple and of course it should be improved, but it is a solid base, but simple network communication specially made to support a mmorpg, the use is simple (there are examples) in this file) but basically you write a method to the file client -> Commands public void sChat(string text) { string[] msg = { "rChat", text }; con.SendToServer(msg); } other in servidor -> serverCommands (receive message from client) public void rChat(string[] msg, ServerClient client) { string message = msg[1]; string clientName = client.clientName; sChat(message, clientName); } and in serv -> servercommands (send message to clients) **** use serv.sendToClient(msg, specific cline ServerClient) to spesific client kk private void sChat(string message, string clientName) { string[] msg = { "rChat", message, clientName }; serv.SendToClient(msg); } again in clinet -> commands (client recie command and parameters) public void rChat(string[] msg) { Debug.Log("rChat"); string text = msg[2] + " Say: " + msg[1]; Chat.instance.ReadNewMsg(text); } e pronto todos os clientes vao receber este ultimo metodo, eu uso "chat.instance.ReadNewMsg(text)" para colocar a mensagem no chat and all customers will receive this last method, I use "chat.instance.ReadNewMsg(text)" to put the message in the chat. client.rar and serv.rar is a demo Edited August 31, 2019 by XXD Quote Share this post Link to post Share on other sites