-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to simulate a match with two player using LUA client #2
Comments
That all looks correct to me. Two Lua clients connected and played 'Checkers' in game session '2'. I've added a markdown doc the the parent repo, Cadre here: https://github.com/JacobFischer/Cadre/blob/master/howToPlay.md It details, with screenshots, what (and to some extend why and how) to do to play games using Cadre. Does this new document help you? |
That's awesome! That document help me so much! Now i can understand that two client play by AI. But after match end, nothing in my output/gamelogs folder, so i can not see match detail on web under "Game Archieves". So can you take a look at that? |
And if i try to use --log flag, it shows: taka$ sudo node main.js --log ReferenceError: utilities is not defined |
Hmm. That's weird. Files should be generated in Cadre/Cerveau/output/gamelogs after you play a game. Make sure there's read/write access to those folders? What OS are you using? The code for saving gamelogs happens in Cadre/Cerveau/gameplay/gameLogger.js:55 in the You could try this: var gzip = zlib.createGzip();
gzip.on("error", function(err) {
log.error("Could not save gamelog '" + gamelog.gameName + "' - '" + gamelog.gameSession + "'.", err);
}); add in another error handler like this: var gzip = zlib.createGzip();
// maybe the writeStream need an error handler?
writeSteam.on("error", function(err) {
log.error("Could not save gamelog '" + gamelog.gameName + "' - '" + gamelog.gameSession + "'.", err);
});
gzip.on("error", function(err) {
log.error("Could not save gamelog '" + gamelog.gameName + "' - '" + gamelog.gameSession + "'.", err);
}); See if that catches the error for you. As for the --log error, thanks for catching that. I have no idea why I commented out the utilities require up top, but I fixed it in in my most recent Cerveau commit. Now console output should be logged in Cadre/Cerveau/output/logs/. See if that works too, or if those output files too won't generate for you. |
--log works with logged log-Lobby.@.1056-2015.10.01.00.17.30.271.txt and log-Checkers.-.1.@.1074-2015.10.01.00.18.41.554.txt |
So I've actually never tested Cerveau on Mac OS X. It could be an error there only on that OS. On Linux and Windows it works fine. |
OK I just try to debug by print log to console and see that: line 167 of session.js run as normal: That means i guest that process.send can not reach to gamelog? I test it by print to console. Maybe would you please teach me how to setup debug or using debug tool in nodejs. So i can help you to find some bugs in mac os. :) |
I created a new issue in the server repo at siggame/Cerveau#2 that documents this error better, hopefully I can find a siggame dev with a mac computer to find the bug. If you want to try to find this error I debug Cerveau using the wonderful node-inspector, though debugging on multiple threads is hackish. I'm closing the issue here as it does not appear to (and I have no idea how it could) be an issue with this Lua client. Thanks for all your support in finding these bugs, and I invite you to continue taxing this framework as I've moved it to my development organization it was originally intended for. |
Hi,
Can you explain how to setup two player playing Checkers game or a player play with an AI using LUA?
I just run: lua ./main.lua -s localhost -p 3000 -n taka Checkers
and it shows:
connecting to: localhost:3000
successfully connected to server...
In Lobby for game 'Checkers' in session '2'
And then i create new terminal and run the same command as above, and then it shows: (It seems to game start and then over immediately)
connecting to: localhost:3000
successfully connected to server...
In Lobby for game 'Checkers' in session '2'
Game starting
Game is over. I Won! because: All enemy checkers jumped
(In 1st terminal, it shows: Game starting
Game is over. I Lost :( because: No checkers remaining
)
In server side:
Checkers - 2 @ 1043 Received new connection!
Checkers - 2 @ 1043 Received new connection!
Checkers - 2 @ 1043 Game is starting.
Checkers - 2 @ 1043 Game is over.
Checkers - 2 @ 1043 Client Checkers Lua Player disconnected
Checkers - 2 @ 1043 Client Checkers Lua Player disconnected
Lobby @ 1008 Game Session @ 1043 exited
Thanks very much!
The text was updated successfully, but these errors were encountered: