Page 1 of 1

Local score log for server

PostPosted: 12 May 2023, 18:34
by DeathByDenim
Hi there,

I'm looking for a way to get a local server to store a log of race results. That is, for each completed race on the server, I'd like to log what the players see in the result screen after a race.

I've been digging through the documentation, this forum, all GitHub issues about servers and even parts of the source code, but I can't find anything like this. The closest I found is the sqlite3 database, but from what I can tell that only stores some player stats like when they connected and how long. Nothing really about scores.

So, I'm reasonable sure that what I am looking for currently does not exist. Although happy to be proven wrong though! :)

Does anybody know of such a thing?

Re: Local score log for server

PostPosted: 13 May 2023, 15:15
by kimden
You can modify the source code and the database so that the race results are stored there. I guess most of things related to database are in src/network/protocols/server_lobby.cpp (as there are initialization queries, etc), so you can look there for functions responsible for race ending and stuff

I kinda do exactly that, storing results in the database, and then I have record tables per track like this: https://stk.kimden.online/records/addon ... n_n_3.html . You can check out my fork (message footer) for the reference what exactly I do there (but keep in mind there are also too many other things, so maybe looking only at server_lobby.cpp changes is sufficient if you want to do it yourself - the changes are huge anyway), but it stores results only for races (and battle results too if you choose the latest branch)

Of course you can do the same with only printing results into the server log, but keep in mind logs are rotating then.

Best of luck experimenting!

Re: Local score log for server

PostPosted: 14 May 2023, 19:52
by DeathByDenim
Thanks! Yeah, I think I came across your fork too. The 448 commits behind scared me a bit. :)
Did you try to upstream your changes or was there no appetite for that?
I'm thinking that if I have to dive into the code anyway, I'd like to get it included upstream so I don't have to worry about keeping in sync with custom patches.

Re: Local score log for server

PostPosted: 15 May 2023, 19:04
by kimden
It's 448 behind because I'm mostly committing now on command-manager-prototype branch (pr #5), which should be adding something to commands - and at the same time I'm lazy to push unrelated commits to master so I push it there too, but at some point it will be merged to my master branch. Probably not a good tactic from myself

Currently I don't even have time to fix new issues I have or implement additional things I wanted to (altogether for both things, I counted once and there were around 200, pretty scary for me), and I think merging anything to upstream would require me even more time anyway... but who knows what I will do next.

Maybe to start with I could simplify things and separate logical parts (e.g. storing results) into different branches so it's easier to look at (unlike it's now)

Re: Local score log for server

PostPosted: 29 May 2023, 06:07
by QwertyChouskie
kimden {l Wrote}:It's 448 behind because I'm mostly committing now on command-manager-prototype branch (pr #5), which should be adding something to commands - and at the same time I'm lazy to push unrelated commits to master so I push it there too, but at some point it will be merged to my master branch. Probably not a good tactic from myself

Currently I don't even have time to fix new issues I have or implement additional things I wanted to (altogether for both things, I counted once and there were around 200, pretty scary for me), and I think merging anything to upstream would require me even more time anyway... but who knows what I will do next.

Maybe to start with I could simplify things and separate logical parts (e.g. storing results) into different branches so it's easier to look at (unlike it's now)


FWIW, I'd love to see the additional features make their way upstream. I'm sure some cleanup will be required (you should have seen my working branch for the Cartoon skin vs what actually got merged, the working branch was a mess lol), but having the features available to everybody would be worth the effort IMHO.

Re: Local score log for server

PostPosted: 29 May 2023, 16:58
by kimden
Maybe you are right indeed. But before offering the commits somewhere else, I guess it's better to polish them so that they at least work fully as expected :D

That being said, I published my todo list since the last time I mentioned it here — it looks large but that is roughly what I'm trying to fix now (apart from my usual gaming, organizing, and making addons a few times per year of course). So I guess it won't happen right right now :D but I guess I'll take my time.

And thanks for the advice, I will surely look at what was merged before when it's time — would be useful for me anyway because I'm not really familiar with collaboration that much.