magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.86k stars 761 forks source link

misleading/incorrect server log "found cheating player" #11877

Open xenohedron opened 7 months ago

xenohedron commented 7 months ago

A message like this appeared in the server log for every player in a draft, sometimes multiple times per player, all during deck construction before the first match. I am quite sure none of them were doing anything unsavory.

ERROR 2024-02-29 02:44:54,521 Found cheating player bobwoco with changed deck, main 40, side 19 =>[CALL main-434] TournamentPlayer.updateDeck

JayDi85 commented 7 months ago

It's need research for reproduce able steps. Can be related to deck construction timeout or wrong deck/sideboard saving logic.

JayDi85 commented 7 months ago

BTW that's "cheated" players gets empty deck on game start -- it's old logic for last years: shot_240303_172101

Some research and possible reason (I don't have workable steps, just an idea)

Auto-submit in 1 minute take deck AFTER one minute to submit, not current deck on button press. So if a user press 1 minute button, but continue to edit current deck then he will submit a wrong deck after timeout: shot_240303_174023

BUT hash calculated by all sorted card names only. So it will fail on cards amount change in main/sideboard only, not on cards moving between main/side or layout change.

So "cheated" players somehow lost some cards or adds additional. I think it's a "lost cards bug" (due server logs, see below). In old days I saw some bug reports with cards lost while deck editor but was unable to constantly reproduce it (only few times). Maybe drag and drop code do some bad things or cards hiding feature.

P.S. Looks like it two different problems:

Logs for a same player in different times (deck editor problem):

changed deck, main 40, side 3
changed deck, main 40, side 4
changed deck, main 40, side 6

Logs on tourney started (not deck editor problem):

User xxx tournament started
User yyy tournament started
Found cheating player yyy with changed deck, main 0, side 90
Found cheating player xxx with changed deck, main 0, side 90
JayDi85 commented 7 months ago

Reproduceable in AI constructed tourney with 2 wins settings (sideboarding). Caused by auto-save deck feature.

JayDi85 commented 5 months ago

@xenohedron found many "Found cheating player" and "Found cheating tourney" logs after update. If you catch same logs with known use case then report here. Can be a normal use case again, not real cheating.

xenohedron commented 5 months ago

Yep, normal draft and there were logs like this for each player:

ERROR 2024-04-18 01:56:50,405 Found cheating tourney player xenohedron with changed deck, main 40, side 22 =>[CALL main-538] TournamentPlayer.updateDeck ERROR 2024-04-18 01:56:55,450 Found cheating tourney player xenohedron with changed deck, main 40, side 22 =>[CALL main-538] TournamentPlayer.updateDeck ERROR 2024-04-18 01:57:00,480 Found cheating tourney player xenohedron with changed deck, main 40, side 22 =>[CALL main-538] TournamentPlayer.updateDeck ERROR 2024-04-18 01:57:05,521 Found cheating tourney player xenohedron with changed deck, main 40, side 22 =>[CALL main-538] TournamentPlayer.updateDeck ERROR 2024-04-18 01:57:10,558 Found cheating tourney player xenohedron with changed deck, main 40, side 22 =>[CALL main-538] TournamentPlayer.updateDeck

JayDi85 commented 3 months ago

Current draft allow to change deck between games and allow to add any amount of land cards (by add lands button). That’s the reason of the message.

I thinks add lands must be restricted to first construction only. Am I right? Or lands must be allowed at any time and must be ignored in deck validation (on checking deck for cheat)?

Susucre commented 3 months ago

The 5 basic lands are allowed to be added during sideboarding in any quantity for limited games. I'll try to find tournament rules. Deck validation should ignore them being in excess amount for limited tournaments/games.

Susucre commented 3 months ago

Ok there is not strictly a rule allowing you to add during sideboard, but since the 5 basic lands can be added in unlimited amount at deck construction, it is a feel bad to want to add some during sideboard but have not thought to add them during deck construction. I am quite in favor of letting basics being added post sideboard and adjust the validation accordingly (for limited games mode only obviously).

From https://media.wizards.com/ContentResources/WPN/MTG_MTR_2024_May13.pdf :

image

xenohedron commented 3 months ago

I agree, there is no practical difference between adding basic lands to sideboard at the start, and adding them directly during sideboarding. So it would be best if we didn't enforce the technical distinction.

JayDi85 commented 3 months ago

There aren't easy access to normal or draft tourney, so current rules:

xenohedron commented 3 months ago

Well, that's a workaround, and not correct in all use cases, for example:

It's okay for now as long as it's just a log error, but should add comment explaining workaround and remaining todo

JayDi85 commented 3 months ago

@xenohedron can you check deck editor - is it correctly enable/disable add lands button for all use cases?

xenohedron commented 3 months ago

I'll investigate and get back to you