Local score log for server

Local score log for server

Postby DeathByDenim » 12 May 2023, 18:34

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?
User avatar
DeathByDenim
 
Posts: 2
Joined: 12 May 2023, 18:22

Re: Local score log for server

Postby kimden » 13 May 2023, 15:15

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!
I make servers, addons, online events, and many others things.
my page, my STK fork, my youtube channel
User avatar
kimden
 
Posts: 148
Joined: 23 Jun 2019, 18:42

Re: Local score log for server

Postby DeathByDenim » 14 May 2023, 19:52

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.
User avatar
DeathByDenim
 
Posts: 2
Joined: 12 May 2023, 18:22

Re: Local score log for server

Postby kimden » 15 May 2023, 19:04

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)
I make servers, addons, online events, and many others things.
my page, my STK fork, my youtube channel
User avatar
kimden
 
Posts: 148
Joined: 23 Jun 2019, 18:42

Re: Local score log for server

Postby QwertyChouskie » 29 May 2023, 06:07

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.
Contributor to/fan of STK (Upstreamed Cartoon theme, numerous random big fixes/tweaks)
User avatar
QwertyChouskie
 
Posts: 559
Joined: 29 Jun 2016, 14:57

Re: Local score log for server

Postby kimden » 29 May 2023, 16:58

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.
I make servers, addons, online events, and many others things.
my page, my STK fork, my youtube channel
User avatar
kimden
 
Posts: 148
Joined: 23 Jun 2019, 18:42

Who is online

Users browsing this forum: No registered users and 1 guest