Thread: Client Proxy Concept (support any revision without rewriting network code)

Results 1 to 6 of 6
  1. #1 Client Proxy Concept (support any revision without rewriting network code) 
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,602
    Thanks given
    234
    Thanks received
    968
    Rep Power
    1244
    So for a little backstory, I've implemented a gateway server to handle connections and message codecs then translating them into messages sent into a channel (publish/subscribe system) to decouple the logic that handles and emits game commands/events so that I can implement the logic in any language that supports publish and subscribe (redis for my case). The server and the game can be implemented in the same language or two different languages if desired.

    While that's working great, I also realized a possibility as a result of this design!

    Multi-revision support:
    Say you have a client and server that implements the 317 protocol. What happens when you want to change revisions? Well, the answer varies depending on how well you've implemented the networking code in your server. In most new servers, it's as simple as re-implementing the message codecs. In others, it's rewriting a bunch of functions that are in a single class.

    Luckily, new servers have proper abstraction of the incoming and outgoing messages, so this is just taking that and rewriting it a bit.

    Load balancing:
    Easier scalability and resilience in the face of a denial of service attack or sudden heavy load. Scaling down saves money during off-peak hours and can be easily configured by a daemon to create new instances with more demand. Note, this is mostly for demonstration and learning purposes as an instance can already handle >7k messages per second (super high for any server). This could also help in mitigating denial of service attacks, if configured correctly. You could also improve latency for users by decreasing max connections per instance.


    Now, seeing the possibilities, I am considering adding a mode to the gateway server:
    Publish/subscribe (redis, but can be made to use any such as AMQP) - Already implemented
    Proxy (any other RS client protocol)

    Using publish/subscribe mode will allow servers to accept connections from clients with any supported protocol without needing to implement any client-specific protocol at all. All that's necessary is to write/read messages to/from publish/subscribe channels. This solves a lot of problems by clearly separating the responsibility of the network code vs the game code. The two never interact directly besides through the channels. Already gains all the aforementioned advantages.

    Using proxy mode will allow clients with any supported protocol to translate messages sent in one protocol to another revision's protocol. This makes it compatible with typical RSPS that only support one protocol.
    EX:
    Server implementing 317
    Accepts connections from 377

    EX:
    Server implementing OSRS (latest rev)
    Accepts connections from select OSRS rev clients

    EX:
    Server and client implements same revision
    Uses proxy as a load balancer


    Thoughts?
    .
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member Devenir's Avatar
    Join Date
    May 2018
    Posts
    28
    Thanks given
    4
    Thanks received
    16
    Rep Power
    36
    I tried a similar thing for load balancing with little results, it's really about how your server uses its resources.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #3  
    ???

    funkE's Avatar
    Join Date
    Feb 2008
    Posts
    2,602
    Thanks given
    234
    Thanks received
    968
    Rep Power
    1244
    Quote Originally Posted by Devenir View Post
    I tried a similar thing for load balancing with little results, it's really about how your server uses its resources.
    True, the server itself uses very little, it's just an added benefit. I like to think of RS as unnecessarily self-limiting, and so I like to design for more large-scale MMO situations. Limiting yourself by RS' standards and capabilities means that these skills you learn programming have difficulty translating into the real world (it's not early 2000s anymore). Once you hit 10k, you might start seeing the benefits. The major benefit, in my opinion, is that this design forces you to separate IO logic and game logic. I remember that servers in the past like PI would have problems because of things that happen to data over the wire (nothing is guaranteed) and that a malformed packet does weird things... Modern servers like Apollo will handle those types of errors fine but as a monolithic application, still responsible for ensuring that. That scenario is impossible in this design leading to the game logic only focusing on the things that it is really concerned with.
    .
    Reply With Quote  
     

  5. #4  
    Registered Member Glader's Avatar
    Join Date
    Mar 2015
    Posts
    22
    Thanks given
    3
    Thanks received
    18
    Rep Power
    51
    I wrote something like this for World of Warcraft. Connecting 3.3.5 clients to a 1.12.1 public private server. You will go insane trying to do this, and if you have source access to both the client and the server it's NOT worth the effort. Basically, you have to be 10x better of a developer to accomplish what you're describing with a packet proxy vs just implementing it in the client/server source itself. 10x harder and 10x more work. So imo it is not worth it. But yes, 100% possible and can be done.

    If you're interested, you can see some videos I made about that here. It worked:

    Reply With Quote  
     

  6. Thankful users:


  7. #5  
    Jire

    Jire's Avatar
    Join Date
    Nov 2008
    Posts
    16
    Thanks given
    10
    Thanks received
    18
    Rep Power
    286
    While this is a cool idea, I don't see why not just implement the conversions on the server end? Kinda like Parabolika's old OSGi-server, [Only registered and activated users can see links. ] except you would allow using multiple protocols at once with the version identifier that remains the same
    Reply With Quote  
     

  8. #6  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    22
    Posts
    1,339
    Thanks given
    2,635
    Thanks received
    584
    Rep Power
    585
    Really good idea; would love to see you progress with it.
    Spoiler for sig too large:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 21
    Last Post: 07-08-2014, 12:49 PM
  2. Replies: 1
    Last Post: 08-25-2013, 02:02 AM
  3. how to removed client background any revision
    By Coder Joker in forum Help
    Replies: 0
    Last Post: 07-24-2012, 01:19 PM
  4. Making client ip change[any revision]
    By mgi125 in forum Tutorials
    Replies: 5
    Last Post: 07-21-2010, 05:01 AM
  5. Replies: 5
    Last Post: 11-21-2009, 08:40 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •