SLASHEM-Extended / SLASHEM-Extended

SLASH'EM Extended (a SLASH'EM fork)
123 stars 29 forks source link

Issue with Anti-Cheat #30

Open GageWilliamErvin opened 5 years ago

GageWilliamErvin commented 5 years ago

There was a comment somewhere that the current anti-cheat method isn't perfect. Please improve it.

Thank you.

AmyBSOD commented 5 years ago

Well I have no idea how to fix it, as the game doesn't save the current state of execution when you lose the connection. You'd have lost the wish either way; the paralysis is a necessary evil because otherwise it would be easy to cheat away monsters' attacks that would have otherwise killed you. "Please improve it" makes it sound like it would be a trivial task to improve it, but it isn't; you're welcome to supply a patch that makes it better.

moon-chilled commented 5 years ago

If you call dosave0() at judicious points (e.g. every turn and every --More-- prompt), then the player wouldn't be able to escape evil effects: if you see 'you are slowing down', it's already been saved to disc. If you did that though, then you would have to give monsters the first turn after a hung up game, instead of the player, but that would still be a lot more fair than paralysis.

GageWilliamErvin commented 5 years ago

I appologize if I minimized the issue. I'm just starting to read this code so I wasn't familiar with it. Thank you for your hard work; I only meant to bring this to your attention since it was a big hangup for me after I began playing this variant (pardon the pun). If Elronnd's solution is feasible, that would be excellent.

AmyBSOD commented 5 years ago

Elronnd: Sadly, your solution wouldn't help. If you already saw the "You are slowing down" and the status line shows "Stone", hangup will already save the fact that you've been stoned - hangup does call dosave0() if I'm not mistaken. In any case, the exact state of your character at that point will be saved. The problem is that if you hang up at "The cockatrice touches you!--More--", i.e. BEFORE the game has rolled whether you get petrified, restoring the game will then give you the next turn instead of processing the rest of the cockatrice's attack. Therefore the paralysis is necessary: because you might hangup cheat while next to a monster that is slower than you, so I had to make it so that the monsters get at least a few turns for a chance to actually get their attacks to process.

As I said, the solution is far from perfect, but I have zero idea how to make it so that hanging up doesn't "cheat away" the rest of what would happen in that turn. My general advice to players is to avoid leaving the game open at a prompt if they have a shaky internet connection. Sorry.

moon-chilled commented 5 years ago

The problem is that if you hang up at "The cockatrice touches you!--More--", i.e. BEFORE the game has rolled whether you get petrified, restoring the game will then give you the next turn instead of processing the rest of the cockatrice's attack

This is what I am suggesting: if you hang up, then when you reconnect, all monsters get their turns before you. This is much less brutal, while still not allowing you to actually escape any attacks. You don't have to process the rest of the cock's attack if it gets to restart its attack next time you start the game, before you have opportunity to do anything.