Ludii Forum
Troble with being unable to play Throngs - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Ludii Player Problems (https://ludii.games/forums/forumdisplay.php?fid=6)
+--- Thread: Troble with being unable to play Throngs (/showthread.php?tid=444)

Pages: 1 2


Troble with being unable to play Throngs - dale walton - 02-18-2021

lsvor and I have been trying to set up a game of Throngs remotely.

First he set up a game,
Later he cancelled and set up a game with a different script. I also used the same script, but had errors mentioned in my Throngs thread.

Then he when back and set up another Standard Throngs game.  He got the same illigal move mesages As I got.

I then tried adding 2 more  games, but choosing the "standard" = fixed starting position option,  intending to make myself 2nd player, but being assigned 1st player becuase choosing options rest the player sequence choice.
I then levet one of them and created another with myself as 2nd player.  So now there are three game offers: one with both joined,but hung, and 2 as offers.

It also worries me that all these games show the same Hash code -232107942 

I am attaching the terminal output from the last few actions.

Note that this is  to be an asyncronous game.
To start do we need to be logged in at the same time?

Also note that for many hours I was logged in with my computer on standby - so technically we could have been loggedinto the game at the same time, but my side unresponsive.  -- But I suspect there is something else wrong, like if the hashes for the games are the same , and in the first game I was 2nd player, but in the recreated game I was first player?

How can the hashes be the same: the game id 608, 612, 613, 614, etc. or some other unique ID should be created before hashing and be included in the hash, right? Even the options chosen for the game, and who goes first should affect the hash, if you really need to risk hashing without a unique id.


RE: Troble with being unable to play Throngs - MatthewStephenson - 02-18-2021

Hi,

I've been able to replicate your issue with the illegal moves, so I'll look into this.



Quote:To start do we need to be logged in at the same time?


No you do not need to both be logged in at the same time. One of you can make a move while the other is offline and vice versa.


Quote:How can the hashes be the same


The hash value is just for the game description, to verify that this has not been tampered with. The hash code should be the same if the same game name/options are being played.
Other details such as the players, game Id, etc. are not in this hash.

I'll let you know when I believe the issue is fixed.

Cheers,
Matthew


RE: Troble with being unable to play Throngs - dale walton - 02-19-2021

Thanks for looking into it.

It appears that the hash does not seem to include the options chosen, as I chose different options for the games than the first one, so you might want to change that if it doesn't impact all your play histories.

So, for anti-tampering (of games, rather than of tournaments), you probably should hash the expanded game that we see in the ludeme tab instead of the packed game prior to the application of options, or recheck that the option selection is actually making it into the hash somehow.


RE: Troble with being unable to play Throngs - MatthewStephenson - 02-19-2021

Hi,

Sorry I should revise my original statement to be clearer.

Quote:The hash value is just for the game description, to verify that this has not been tampered with. The hash code should be the same if the same game .lud description being played.


Simply put, the entire contents of game description is included in the hash, including all options it has, but not specifically which option was selected. You can think of this hash as a check that the actual .lud file has not been tampered with at all.

We record which options have been selected in another field in our database, separate from this hash.

Cheers,
Matthew


RE: Troble with being unable to play Throngs - dale walton - 02-19-2021

File protection. Got it.

So if I play a custom version with someone else, we need to 1) use a file with the same name, and 2) the file contents must be  identical. But the file location is not important as long as each of our players can find it. Right?
 
I saw you were experimenting with the game, any luck on isolating the bug.  It also affected my revised script.


RE: Troble with being unable to play Throngs - MatthewStephenson - 02-19-2021

Hi,


Quote:So if I play a custom version with someone else, we need to 1) use a file with the same name, and 2) the file contents must be  identical. But the file location is not important as long as each of our players can find it. Right?




Yes I think this is correct.


Quote:I saw you were experimenting with the game, any luck on isolating the bug.  It also affected my revised script.

Are you referring to the illegal move issue? If so yes we have isolated the cause of it and should have it fixed soon.

Cheers,
Matthew


RE: Troble with being unable to play Throngs - dale walton - 02-19-2021

Also just tried spectating another game, and then logged out of the remote. after which I see this error:

The submitted player hashcode does not match that stored in the database. (0:315131)
You have logged out.

What is the meaning of that error (which I have seen before with different numbers...)


Compiled Throngs successfully.
dale walton to move.
to move.
Logged in as: dale walton.
-------------------------------------------------
Joined game as a spectator
Compiled Zola successfully.
MikeZapawa to move.
The submitted player hashcode does not match that stored in the database. (0:315131)
You have logged out.

Terminal shows:
Compiled Zola successfully.
java.lang.NumberFormatException: For input string: "Please enter id."
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at manager.network.DatabaseFunctionsRemote.checkRemainingTime(DatabaseFunctionsRemote.java:239)
at manager.network.DatabaseFunctionsRemote$1.run(DatabaseFunctionsRemote.java:92)
at java.base/java.lang.Thread.run(Thread.java:834)


RE: Troble with being unable to play Throngs - MatthewStephenson - 02-19-2021

Hi,

Yes I can replicate that one too Smile

It seems to be just a timing error. When you log out we set your player hashcode to 0, but the server was expecting 315131 to get some information about the game you were spectating. Essentially after you logged out, the ludii app still tried to get some information about the game with a request that had already been queued up before you logged out.

This issue shouldn't cause any problems to manifest, but I'll still try and deal with this case a bit nicer so you don't see the error.

Cheers,
Matthew


RE: Troble with being unable to play Throngs - dale walton - 02-19-2021

Great, Thanks a lot. Didn't mean to put you onto a minor issue, but one never knows, and these were not difficult to document on my side, unlike scripting issues.

PS. On the next release can you update to my lastest Throngs version: Even if it has a couple "warts" I think it is easier to understand and play because of the state labeling and one-click movements.


RE: Troble with being unable to play Throngs - MatthewStephenson - 02-19-2021

No trouble, thanks for pointing them out.

Testing the network functionality is always a time consuming task for us and we can never test everything completely.... so its nice to have the extra help Smile