penta2019 / mahjong_server

日本リーチ麻雀のゲームサーバー
MIT License
16 stars 2 forks source link

AFK detection problem. #4

Closed celie1 closed 3 years ago

celie1 commented 3 years ago

AFK in-game notice will pop up even in the middle of a match and get forced to switch to auto discard mode.

penta2019 commented 3 years ago

Ok, it's a side effect of replacing mouse operation with direct function call. I'm looking for a workaround now.

penta2019 commented 3 years ago

I added a code to make a click after every discard. But, I'm not sure if it works. If you still have the same issue, please inform me.

celie1 commented 3 years ago

Well I tried it for an hour and can confirm the issue is still there.

penta2019 commented 3 years ago

Thanks. I reverted 'action_dapai' to the previous mouse operation since I couldn't find out the root cause of the issue.

celie1 commented 3 years ago

Hi, after intensively trying for a few days with the previous mouse operation js, I found out that sometimes the AFK detection will still pop up in the middle of a game, it's just far less frequently than what I experienced with direct function call.

Since I didn't know what prompted the game AFK detection so I'm shooting in the dark here, but I think maybe adding in automation of sending emoji will help? (Such as, send emoji 1 when game start; emoji 2 when someone riichi; emoji 3 when we tsumo; and all these will trigger at random times in game.) Well, at the very least it can avoid player detection though.

Cheers.

penta2019 commented 3 years ago

As far as I know, the AFK popup only appears if you exhaust all the thinking time and time out twice in a row. I guess it is occurring because of failure of MSC actions caused by some reasons (network delay, other players activities or etc...). Using emoji won't work if it is the case. I'm going to try another two solutions.

  1. Retry MSC action when the game won't give a next message.
  2. Check AFK UI before every MSC action and click OK if it is shown.
penta2019 commented 3 years ago

If you see AFK mode again, please reopen this issue.