1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Move player data between servers in array

Discussion in 'Development' started by Kyd, Dec 6, 2017.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    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 :eek::eek:)
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I would recommend taking a look at Horomones
    https://github.com/LegendOfMCPE/Hormones
     
    Muqsit likes this.
  3. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    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.
     
    Last edited: Dec 7, 2017
  5. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I'm not enough skilled for it xD Can you give me any documentation or anything that can help me?
     
    jasonwynn10 likes this.
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    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).
     
    Last edited: Dec 7, 2017
    jasonwynn10 and Kyd like this.
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    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?
     
    jasonwynn10, dktapps and EdwardHamHam like this.
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    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.
     
    jasonwynn10 likes this.
  9. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Solved. I created simple proxy with nette Framework that accept data from server and send it to other servers.
     
    EdwardHamHam and jasonwynn10 like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.