Hello, I'm wondering about how to send player data from my database like or config (like coins etc) without permanently saving it somewhere just I have it in array and I want to send this variable another server and make server accept it and just handle as normal array.. I know I can do it with mysql etc, but MySQL save the data and I don't want it... Should I send packet with data to server or something? I really don't know I want the fastest way to make it no lag main thread when connecting to server... I know on bungeecord people use Netty for it, but netty is not for php, so idk.. If you have any idea let me know!! Thx. (No previsous attempts )
Write a custom CGI. That's the best method. Hormones just (ab)uses MySQL as the CGI because it's easily installed. In addition, Hormones has a kidney that cleans up expired hormones regularly.
Having a look at RFC 2810 (Internet Relay Chat network architecture) may inspire you if you don't want a CGI. Perhaps "CGI" is not the correct term. I was referring to a central server that manages all servers' communication. To implement a central server, everything is much easier because it's just like what you do with PocketMine (it's easier to implement the /tell command in PocketMine) as long as you sorted out the protocol (which is just defined by you, so it doesn't matter). Otherwise, if you use direct socket communication among servers, you either have to connect to every other server in the network (I don't think this is nice, because each server will have to unnecessarily handle many connections, which is not optimal), or you have to use IRC's architecture, which is much more complicated (especially if there are netsplits, and also messages arrive slightly slower although it shouldn't impact performance).
Yes, sockets are very simple to use, but network data flow management is a bit less simple than that. Without elaborating, your statement is as meaningless as "write some code that uses the Internet". For example, what happens when the connection breaks? Do you keep retrying connection? Or what do you do?
Because there is no absolute right and wrong. Everything has its pros and cons, e.g. some people really don't like MySQL because it requires saving data, which is really inefficient in terms of hardware utilization. Hormones used MySQL only because MySQL is easy for users to setup.
Solved. I created simple proxy with nette Framework that accept data from server and send it to other servers.