Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2018-08-07 00:00:00Z and 2018-08-08 00:00:00Z
Avatar
eb1b4a8 Add back Vanilla maps for compatibility - def-
Avatar
8ee5a9a Try to fix screenshot issue again - def-
Avatar
@Ryozuki make changelog and dont forget me :p
10:54
Yo, is it possible to add a skin file to a map and players that dont have this skin will see it and get it from the map somehow?
Avatar
only vanilla i guess. or you have to embed it
Avatar
yes sure
10:55
but i want that the skin then applies to a tee
10:56
so if i run vanilla client and have greensward skin in the map file i want that the vanilla player see the greensward skin, can that be done by code?
Avatar
i think infclass has something similar
Avatar
not really
10:57
they have just the skins in the map for use them as quads
Avatar
It could be cool af
Avatar
Hey I'd like to select all ranks that are not the players best rank and delete them to make space. I currently have a solution that loops programmatically and has multiple queries, I'd like to do it in one. My only idea right now is to select the ranks I want to keep in a subquery using MIN(Time) and then using LEFT JOIN/IS NULL with all the ranks to get the ranks I don't want to keep and delete them. Though for the JOIN condition i'd need a unique key which the _race table doesn't have currently. Any ideas? (edited)
Avatar
make a new table, put in the top times, delete old table, rename new table to old name
Avatar
Hm, I don't know how the locking works, there is a way to lock the database right? I don't know if my lib is doing that, I can try figuring it out
Avatar
or join the original table against the top times, then remove entries with != NULL on one side (indicating that they are the top times), remove rest
11:35
yeah, you can lock
Avatar
but what should i use for the join condition, there is no unique/primary key (edited)
11:36
brb
Avatar
(Name, Map, Time, Timestamp) ? 😄
11:37
And why do you even want to delete bad ranks? Are some queries getting slow? You might just need good indices in that case
Avatar
mostly to keep backups small
11:51
(on race servers people improve there times a lot)
Avatar
change the source code to only save the top time?
11:53
if the data is not in your backup, you apparently don't need it
Avatar
yeah thats right
Avatar
or gzip the backup
Avatar
back when i made this i didn't change much to make merging upstream easier, i'm just trying to clean this up currently
Avatar
now i am trying to find point entries of players without ranks because they got removed. Any idea why this query is very slow?
15:30
SELECT * FROM race_points t1 LEFT JOIN (SELECT Name FROM race_race GROUP BY Name) t2 ON t1.Name = t2.Name WHERE t2.Name IS NULL;
15:31
takes 2 minutes 27 seconds
Avatar
tad late but you probably could delete the non top records with Group by and Order by
16:22
e.g. SELECT * FROM record_race GROUP BY Name, Map ORDER BY Time ASC;
Avatar
@Learath2 shouldn't give you this always an entry for each Name, Map pair, even if its already the only record left for that pair? (edited)
Avatar
Isn't that what you want? Only the best record for each Player, Map pair
16:46
SELECT * FROM record_points WHERE Name NOT IN (SELECT DISTINCT Name FROM record_race); might be slower or faster for the second query, idk 😛 (edited)
16:47
Takes about 5 seconds on the ddnet db
16:49
Intterestingly enough we have those, and recalculate points doesn't get rid of them
Avatar
oh, actually I'd like to delete the rest and only keep the best ranks
16:58
@Learath2 yeah i tried the NOT IN approach as well, also takes that long. could you give me SHOW COLUMNS FROM record_race; SHOW COLUMNS FROM record_points; SHOW INDEX FROM record_race; SHOW INDEX FROM record_points; EXPLAIN SELECT * FROM record_points WHERE Name NOT IN (SELECT DISTINCT Name FROM record_race); (edited)
17:01
for deleting the worse ranks I now settled on DELETE t1 FROM race_race t1 LEFT JOIN (SELECT Map, Name, MIN(Time) AS minTime FROM race_race GROUP BY Map, Name) t2 ON t1.Map = t2.Map AND t1.Name = t2.Name AND t1.Time = t2.minTime WHERE t2.Map IS NULL Can't handle cases where a player has the same time 2 times in the database but that shouldn't happen anyways
Avatar
thanks 😃
Avatar
@timakro well you could create a new table, put the top ranks from my command and just DROP the old one no?
Avatar
wow those PRIMARY keys 😄
17:17
i don't have 1 primary key in my _race table ^^
Avatar
My SQL-fu is not that good tbh, no idea what the PRIMARY keys do 😛
Avatar
hm, shouldn't this be in the server code creating the tables?
Avatar
again as I have no idea what a primary key is, I have no idea if it belongs in the code
17:19
does it do some caching of those to allow quick selects?
Avatar
something like that ^^, i'm no expert either but yes, it caches and makes lookups easier, there are also other types of indices, it seems complicated. adding indices at the right columns can decrease execution time extremly
17:21
maybe deen or heinrich know more, i wonder who set those indices anyways ^^
Avatar
@heinrich5991 what's the idea behind uuid's for ranks?
18:00
@heinrich5991 what is the map compatibility thing?
Avatar
@timakro which uuid are you talking about? the one at the very end? GameID?
Avatar
Teehistorian records in sessions, recording from map change to map change, each session has a uuid, which we add to the rank itself on the database so we can know which th file to look at
Exported 61 message(s)