DELOCH
08-04-2009, 05:55 PM
This question has been puzzling me for a long while, I came up with an answer but it's so crude that I want to know alternatives.
The core of an online game is server client communication, while ideally client only has resources and ability to ask server for information which can be used to render the resources into a visible game, the server checks each request and responds with the necessary data if the request is legal.
The problem is that my solution to this follows:
Make a ten million line if statement checking each request on the server and respond properly: this makes my code unreadable and noode'ish.
Make client's sensitive(touchable) areas send messages conditionally (again, gonna require many millions of nested conditions)
I need a less... heavy method to check messages and send messages.
Any hints?
The core of an online game is server client communication, while ideally client only has resources and ability to ask server for information which can be used to render the resources into a visible game, the server checks each request and responds with the necessary data if the request is legal.
The problem is that my solution to this follows:
Make a ten million line if statement checking each request on the server and respond properly: this makes my code unreadable and noode'ish.
Make client's sensitive(touchable) areas send messages conditionally (again, gonna require many millions of nested conditions)
I need a less... heavy method to check messages and send messages.
Any hints?