Closed Lartza closed 4 years ago
I also noticed operator status isn't being saved, so this could mean anything database related just doesn't work for some reason. But the bot isn't complaining
Hi, thanks for the bug report, I'll have a look at it soon. Have you tried deleting conf/server_one.sqlite
?
Thanks, no rush :) Hadn't had much time to debug apart from updating to the dev version after first trying 0.1.5.
Argh I wrote all of the quoted below before figuring out the issue, and it was pretty much my fault, and I even thought about it but just had no time to figure things out. The webadmin tweaks I applied were breaking magicked's ability to read steamid from the webadmin. Joys of games with subpar administration tools <3
Now, it's kind of impossible to spot this because the bot never says anything, without knowing how to look inside the sqlite database. Even when the bot is working it console prints "Player Lartza joined server_one from Unknown" where I assume Unknown is supposed to be a country? I can also see spots like https://github.com/th3-z/kf2-magicked-admin/blob/690faa8d82d1962b111720a95eb3e983b27334e5/magicked_admin/server/server.py#L173-L179 can print the steamid out but don't? Even in debug mode?
Would probably be worthwhile to look at what debug info is currently being printed and add more to it to prevent cases like this.
I took a look inside the database first before doing anything and at least maps and map_records seem to be stored correctly. Now players though...
sqlite> select * from players where username = 'Lartza'; 256_0x011000010162CAC3_2064.6575|Lartza|7|1|299|0|1|1|0|147.900616645813 257_0x011000010162CAC3_12.8046|Lartza|25|0|630|0|0|1|0|209.638657331467 281_0x011000010162CAC3_558.2925|Lartza|39|1|1109|0|0|3|0|351.008404254913 293_0x011000010162CAC3_4.8015|Lartza|168|0|5745|0|0|1|0|1202.80857086182 297_0x011000010162CAC3_12.4046|Lartza|32|0|1055|0|2|1|0|670.59761762619 306_0x011000010162CAC3_28.2106|Lartza|48|0|6817|0|0|1|0|1498.77288746834 310_0x011000010162CAC3_13.8053|Lartza|116|0|5473|0|0|1|0|1442.45944404602 259_0x011000010162CAC3_85.8332|Lartza|186|0|7487|0|2|1|0|1684.60661411285 264_0x011000010162CAC3_8.0027|Lartza|232|0|6638|0|1|1|0|1270.26294612885 403_0x011000010162CAC3_768.2405|Lartza|89|0|4935|0|1|1|0|1261.55472183228 407_0x011000010162CAC3_15.0617|Lartza|137|0|7578|0|0|1|0|1627.53972911835 413_0x011000010162CAC3_20.0389|Lartza|118|0|8911|0|1|1|0|1836.99426627159 422_0x011000010162CAC3_4.0013|Lartza|117|0|5987|0|0|1|0|1369.3295943737 431_0x011000010162CAC3_22.4081|Lartza|107|0|7002|0|0|1|0|1536.63228058815
So it seems there is an issue with the steam_id value?
I let the bot create a new database and this was the result. Attached debug output of the bot too but I doubt it's useful. I'm fluent with Python but the codebase is alien so I couldn't immediately spot an easy mistake in the code.
sqlite> .tables map_records maps players sqlite> select * from map_records; KF-BIOTICSLAB|0.0|7|1.0000|0|0|0 KF-BURNINGPARIS|419.569530010223|4|0.0000|5|0|0 KF-BIOTICSLAB|16.3524153232574|7|1.0000|1|0|0 KF-OUTPOST|0.0|7|1.0000|0|0|0 sqlite> select * from maps; KF-BIOTICSLAB|Biotics Lab|3|0|0|0|0|1 KF-BURNINGPARIS|Burning Paris|1|0|0|0|0|5 KF-OUTPOST|Outpost|1|0|0|0|0|0 sqlite> select * from players; 256_0x011000010162CAC3_43.4277|Lartza|127|0|11238|0|0|1|0|828.75891828537 257_0x011000010162CAC3_17.4070|Lartza|0|0|250|0|0|1|0|37.5251090526581
Yeah, (unknown)
is supposed to be a country, the API I use for it started rejecting my requests so I need something new.
Your logs have a player or network id where there should be a Steam ID. KF2-MA thinks its the Steam ID because the indexes have been misaligned by modifications. That is, it assumes that the Steam ID is in column X, but another modification shifted it into column Y. If you want to keep both you can probably work around it for now by moving the modification's new columns (country/city) to the end of the table. That said, I'm not sure if it will play nice with the links it adds to the SteamID column, you may be able to fiddle with the IDs to make it work, not sure.
The network/player keys change all the time so that's why nothing was saving, it thought you were a new player with the same name each time you joined believing that value to be your SteamID.
Theres an easy solution this, I need to look for a column heading that looks like "Steam ID" and use that index rather than assume it to be static. The code for this is already in place for the server_info page because people commonly modify it. I'll sort that out soon, I want KF2-MA to be as flexible as it can be to these sort of modifications.
You're right in saying there should be more debug for this too, it would've been obvious if the Steam ID was presented upon player join in debug mode. That's a simple enough thing to add.
I'll close the issue once the above is done so I don't forget about it.
Addressed in 14b0da202fc10570e36a54188f6260dbb1161868
Describe the bug Stat totals aren't tracked. Greeter shows zeroes and !kills etc show current round as both values.
To Reproduce Steps to reproduce the behavior:
Expected behavior Greeter and commands show correct totals for kills, time and sessions
Server:
Log