I'm just wondering how other games handle the problem of ensuring scripts are identical across clients in a multiplayer game. If one client modifies one of their scripts before joining the game, it could allow them to run different logic that could in some way give them an advantage or allow them to cheat. Obviously, you would use an authoritative server model to prevent most cheating, but there could still be client side cheats by modifying the client side scripts. For example, you could display the positions of enemy players on the screen using a modified client script by reading the positions received from the server for those players.
I'm guessing the most common way to solve this problem would be to simply compare scripts between the client and the server. More specifically, you could compare perhaps a hash value of the script's content and then load the script and run it from memory rather than from file. This would prevent the user from modifying a script while the game is running as it would already be loaded in memory. However, I'm not sure if this is a good solution (or the only solution). There are two things that concern me.
Firstly the hash value would need to be transmitted, which means it could be intercepted and tampered with to ensure it will always "match" regardless of the content of the script it was generated from. Perhaps this could be solved by encrypting the hash before the server sends it and then decrypting it on the client. However, this requires the decryption algorithm to be included in the client, which could be compromised somehow. Worst yet, the client could be compromised to always "match" or to always send the expected hash.
Secondly, hash values and such could be tampered with directly in memory using a memory editor attached to the running executable. Obviously this sort of stuff is not for the casual cheater, but a dedicated cheater will find ways to do this and more often than not broadcast such methods on the Internet with step-by-step instructions so that every kid is doing it before too long.
So I'm just wondering what other methods might be available or am I stuck with the above solutions and just have to deal with the problem as it comes up. Stopping cheaters is an on-going battle for developers and often results in game patches to plug holes found. I just want to put a bit of thought into this first to help minimize problems later.