Search code examples
javaappletnetwork-programmingmmo

Data, Networking, Thin Clients & MMORPGs


I'm creating a 2D MMORPG game (in an applet form) and I had a simple question.

I understand that for security purposes as a general anti-hacking technique, the clients should contain the least amount of logical data as possible (so it cannot be manipulated and exploited).

My question is this: Lets say I send data from a server to a client (which is happening quite frequently one would presume). In my client code that received the packet, I parse said packet into its "chunks" and store that data logically in their accurate counter-parted variable. Lets say that one of the variables stores the health of a player. Does that mean that this variable is practically unusable for calculations - in the sense that since it is a logical piece of data (and can be therefore manipulated since it is stored on the client), and that the sole alternative is to read the packet containing the information pertaining the health if I were to ever require the health amount?

Thank you for taking the time to read my question. -Bryan


Solution

  • I would say that it depends on which calculations you're using it for. For unimportant things, like UI display, you can safely use the local variable. If you're using it to determine whether the player is dead or not, then you need to let the server make that determination. You may be able to use the local variable temporarily, until the server is able to update the client, in high-latency situations; but the client's version should never be the canonical version.

    To elaborate: use the local variable where the only person affected is the player, so it doesn't matter if they manipulate their own data. Rely on the server variable for all other situations.