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

Sending packet to each serves by plugin

Discussion in 'Development' started by Kenn Fatt, Mar 12, 2018.

  1. Kenn Fatt

    Kenn Fatt Slime

    Messages:
    82
    GitHub:
    kennfatt
    Is it possible to sending packet to each servers with plugin?
    I want make all my servers 'communicating', in this case I want send a player to another server. But the receiver have to check if the player come from acceptable server. (Like sending Hub to it's subs).

    I have no idea if you recommend to creating "Proxy", it would take much time to develop.

    Current idea:
    Playing with serverAddress inside LoginPacket

    Even MySQL are not designed for that :(
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Not sure if this is the best approach - You can open a socket on each of your servers, then have the sockets communicate with each other. You'll need to write a dedicated \Thread class for the socket and recreate some parts of the AsyncTask in the process.

    If you use a proxy and have all servers interconnected to it, the proxy will be filtering each and every packet it gets and may slow down the overall server latency.

    Check this: http://php.net/manual/en/sockets.examples.php
     
    Pab45O likes this.
  3. Kenn Fatt

    Kenn Fatt Slime

    Messages:
    82
    GitHub:
    kennfatt
    I also think about that way, threading new socket to receive some (UDP) packets. Then, how to let that threading process notice the other server?

    Here is my thought:
    Hub Server -> Sending packet to Threaded process (We call it PacketAdapter) -> PacketAdapter receive the packet and store it somewhere -> Sub Server running task to check if there is a packet on PacketAdapter.

    Anyway, someone can flooding that traffic to PacketAdapter. Could you please give some flowchart or work-progress? So I (or others) can assume it easily.
     
  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.