00:14 <+bridge> [ddnet] Anyone got an idea how to make this query faster? 00:14 <+bridge> [ddnet] ``` 00:14 <+bridge> [ddnet] select distinct r.Name, r.ID, r.Time, r.Timestamp, n.Server from (select distinct ID from record_teamrace where Map = 'Multeasymap' ORDER BY Time limit 20) as l left join (select * from record_teamrace where Map = 'Multeasymap') as r on l.ID = r.ID inner join ((select distinct Map, Name, Time, SUBSTRING(Server, 1, 3) as Server from record_race) as n) on r.Map = n.Map and r.Name = n.Name and r.Time = n.Time order by r.Time, r.ID, r.Name; 00:14 <+bridge> [ddnet] ``` 00:14 <+bridge> [ddnet] Explain for context: 00:14 <+bridge> [ddnet] ``` 00:14 <+bridge> [ddnet] | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | 00:14 <+bridge> [ddnet] +------+-------------+-----------------+------+------------------------------------+--------------+---------+---------------------------------------------------------------+--------+-----------------------------------------------------------+ 00:14 <+bridge> [ddnet] | 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 20 | Using temporary; Using filesort | 00:14 <+bridge> [ddnet] | 1 | PRIMARY | record_teamrace | ref | PRIMARY,Name,Map,ID,MapID | ID | 532 | l.ID,const | 1 | Using where; Using index | 00:14 <+bridge> [ddnet] | 1 | PRIMARY | | ref | key0 | key0 | 70 | teeworlds.record_teamrace.Name,teeworlds.record_teamrace.Time | 10 | Using where | 00:14 <+bridge> [ddnet] | 4 | DERIVED | record_race | ref | Map,Map_2,MapTimestamp,MapNameTime | MapTimestamp | 514 | const | 161796 | Using where; Using index; Using temporary | 00:14 <+bridge> [ddnet] | 2 | DERIVED | record_teamrace | ref | PRIMARY,Map,MapID | PRIMARY | 514 | const | 20044 | Using where; Using index; Using temporary; Using filesort | 00:14 <+bridge> [ddnet] ``` 00:15 <+bridge> [ddnet] Ok, I think I got it myself 😄 00:16 <+bridge> [ddnet] Got from ~20 s to 0.01 s, seems good enough for now: 00:16 <+bridge> [ddnet] ``` 00:16 <+bridge> [ddnet] select distinct r.Name, r.ID, r.Time, r.Timestamp, SUBSTRING(n.Server, 1, 3) from (select distinct ID from record_teamrace where Map = 'Multeasymap' ORDER BY Time limit 20) as l left join record_teamrace as r on l.ID = r.ID inner join record_race as n on r.Map = n.Map and r.Name = n.Name and r.Time = n.Time order by r.Time, r.ID, r.Name; 00:16 <+bridge> [ddnet] ``` 09:04 <+bridge> [ddnet] i dont think anyone knows sql here better than u 09:04 <+bridge> [ddnet] :justatest: 10:28 <+bridge> [ddnet] Hey, I need some help, I think. 10:28 <+bridge> [ddnet] I have 2 issues, first one is this crash: https://pastebin.com/raw/CzcgPjRr 10:28 <+bridge> [ddnet] And second one is this: 10:28 <+bridge> [ddnet] https://github.com/fokkonaut/F-DDrace/blob/F-DDrace/src/game/server/entities/trail.cpp#L121-L122 10:28 <+bridge> [ddnet] if i uncomment this line it crashes due to out of bounds (historypos + 1), but i dont know a good fix for it since I cant reach timakro who originally made the trail 11:53 <+bridge> [freenode] @Learath2 If you're considering pass, at least for android you wouldn't have to write your own app. I use android password store It's awesome 12:04 <+bridge> [ddnet] timakro: @fokkonaut was looking for you 😛 12:43 <+bridge> [freenode] It's too long ago that I wrote that code, I don't know any more about what I did there than you do @fokkonaut 12:43 <+bridge> [ddnet] ouch 13:03 <+bridge> [ddnet] ouch 13:23 <+bridge> [ddnet] game/collision.cpp : 1093 13:23 <+bridge> [ddnet] ```cpp 13:23 <+bridge> [ddnet] dbg_msg("collision", "something is VERY wrong with the %s layer please report this at https://github.com/ddnet/ddnet, you will need to post the map as well and any steps that u think may have led to this", aBuf); 13:23 <+bridge> [ddnet] ``` 13:23 <+bridge> [ddnet] nice error message lol 13:37 <+bridge> [ddnet] got that couple of times 😅 13:40 <+bridge> [ddnet] still from ddrace times where we had the random tile bug 13:40 <+bridge> [ddnet] that one was *very* annoying 13:40 <+bridge> [ddnet] it caused random tiles to appear in the map, but only for the server 13:41 <+bridge> [ddnet] so then you'll find you're 90% through a map, and the server has decided to spawn a blocker at just the right place to block you from finishing 13:41 <+bridge> [ddnet] or a random death tile 13:41 <+bridge> [ddnet] (not seen in entities btw) 13:42 <+bridge> [ddnet] good that you fixed it 13:42 <+bridge> [ddnet] idk who fixed it, probably GreYFoX 15:32 <+bridge> [ddnet] Sorry if this isnt the proper channel but who should i ask to have a flag added 15:32 <+bridge> [ddnet] It would be nice for Québec people to find each other if we had our flag 15:40 <+bridge> [ddnet] Isnt quebec a city? 15:44 <+bridge> [ddnet] I think the idea is to only support countries. So you would search for people with a canadian flag 16:02 <+bridge> [ddnet] yeah exactly lets docs ourselfs to random people on the internet 16:23 <+bridge> [ddnet] @NeXus Quebec is a province in canada, the main point is that quebec is a french province so it would help identify french speakers 16:54 <+bridge> [ddnet] @Learath2 let's deploy now? 🙂 17:00 <+bridge> [ddnet] Can you also commit or pr a bump in the version cutoff for the new messages so we can deploy master? 17:01 <+bridge> [ddnet] add Tatarstan flag too xdd 17:01 <+bridge> [ddnet] comment on github 😉 17:02 <+bridge> [ddnet] @Learath2 bump to which version? 17:03 <+bridge> [ddnet] 99999 I guess, we can bump it down when releasing 15.4 with the new messages 17:04 <+bridge> [ddnet] hm 17:05 <+bridge> [ddnet] Or 15040 if you want to make sure we don’t forget as it’ll break 17:08 <+bridge> [ddnet] Taking one last look over the mysql pr 17:09 <+bridge> [ddnet] Huh, why did you cancel that? Doesn’t fix the issue? 😛 17:10 <+bridge> [ddnet] @Learath2 forgot that I had <= instead of < 17:10 <+bridge> [ddnet] fixed it now 17:11 <+bridge> [ddnet] Um, <= sounds correct to me 17:12 <+bridge> [ddnet] depends on whether `VERSION_DDNET_MSG_LEGACY` is on the right or the left side 😛 17:12 <+bridge> [ddnet] Oh yeah 😄 17:25 <+bridge> [ddnet] @heinrich5991 I spotted another assert 17:26 <+bridge> [ddnet] m_InUse 17:27 <+bridge> [ddnet] I guarantee that all my other code also relies on asserts firing 😛 will fix 17:27 <+bridge> [ddnet] I mean we will compile this in release mode, which means it won’t be thread safe really. That’s why I’m concerned 17:28 <+bridge> [ddnet] there's only one thread (I do crash on a failed assert after all) 17:28 <+bridge> [ddnet] (I assumed a crash on a failed assert after all*) 17:33 <+bridge> [ddnet] @Learath2 fixed 17:33 <+bridge> [ddnet] oh, boost 17:35 <+bridge> [ddnet] Whatever it’s only on CI 17:36 <+bridge> [ddnet] I pushed 7 seconds before your last review, I could have sneaked in code 😛 17:36 <+bridge> [ddnet] (removed boost) 17:36 <+bridge> [ddnet] Lol 17:36 <+bridge> [ddnet] maybe bors should decline to do its job if the latest push is <1min ago? 17:38 <+bridge> [ddnet] suggest braces around empty if block 17:38 <+bridge> [ddnet] fine.. 17:39 <+bridge> [ddnet] I wonder why I forgot the braces there anyway 😄 17:52 <+bridge> [ddnet] That CodeQL step takes some time 17:54 <+bridge> [ddnet] so, now let's deploy it on ger2, and if not everything catches fire, deploy it everywhere? 17:55 <+bridge> [ddnet] @Learath2 I'll do that, okay? 17:55 <+bridge> [ddnet] Lets deploy it on ger2, restart a single server and finish a map 17:55 <+bridge> [ddnet] That sounds a good enough test 18:00 <+bridge> [ddnet] @Learath2 8313 18:11 <+bridge> [ddnet] @heinrich5991 I'll get back to doing some math, lmk if you need anything 18:11 <+bridge> [ddnet] ye 18:11 <+bridge> [ddnet] works locally obviously 18:11 <+bridge> [ddnet] wouldn't be fun otherwise 18:12 <+bridge> [ddnet] Could it be that many servers are connected to the same mysql server and you need some magic flag to get it to work in parallel? 18:12 <+bridge> [ddnet] I don't htink so 18:12 <+bridge> [ddnet] I had that error in testing as well 18:13 <+bridge> [ddnet] it happened when I wasn't correctly finishing processing the results 18:13 <+bridge> [ddnet] Maybe you still have a result lying around? 18:14 <+bridge> [ddnet] oh wait 18:14 <+bridge> [ddnet] You could try wrapping MYSQL_RES in a smart object aswell to make sure it gets freed even if we don't use all of it when it goes out of scope 18:14 <+bridge> [ddnet] I reproduced sth locally 19:02 <+bridge> [ddnet] does master server support 15.3 clients already? 19:15 <+bridge> [ddnet] @deen should but now master has broken mysql 19:16 <+bridge> [ddnet] not should, it does we checked 19:25 <+bridge> [ddnet] Can I not bind gfx_fullscreen? 19:25 <+bridge> [ddnet] I did: bind ctrl+f5 gfx_fullscreen 1 19:27 <+bridge> [ddnet] Ok it works 19:28 <+bridge> [ddnet] what was the cmd for deepfly ? 19:29 <+bridge> [ddnet] the cmd that make that when u shoot ur dummy shoot 19:29 <+bridge> [ddnet] For standard deepfly you can just use the dummy hammerfly command normally 19:30 <+bridge> [ddnet] If you want to time your shots the deepfly bind is `bind x "bind mouse1 \"+fire; +toggle cl_dummy_hammer 1 0\""` 19:32 <+bridge> [ddnet] :brownbear: 19:33 <+bridge> [ddnet] i am very bad bcs dont work lmao 19:34 <+bridge> [ddnet] i mean he doesnt hit me, he hit but deep 19:59 <+bridge> [ddnet] If you are trying it on the new map it has been disabled 20:00 <+bridge> [ddnet] @timakro could you at least take a look at the backtrace and guess what could be changed? 20:20 <+bridge> [ddnet] im quite the guessing type of guy 20:26 <+bridge> [freenode] @fokkonaut I'd guess in line 120 of trail.cpp the index HistoryPos is out of bounds? 20:26 <+bridge> [ddnet] yea 20:26 <+bridge> [ddnet] but i dont know what a good fix for this is 20:26 <+bridge> [ddnet] and it doesnt happen always xd 20:27 <+bridge> [freenode] Looks like floating point inaccuracy 20:28 <+bridge> [freenode] I don't know the reasoning for having an extra m_TrailHistoryLength variable that needs to be kept in sync with the data in the deque 20:41 <+bridge> [freenode] Try saving a little extra history 20:41 <+bridge> [freenode] Maybe just to be 100% sure break before accessing an invalid indec 20:42 <+bridge> [freenode] The line you commented was for interpolating between two history points 20:42 <+bridge> [freenode] Might look fine without 20:46 <+bridge> [ddnet] @Learath2 ^ 20:46 <+bridge> [freenode] I'd be curious how the code looked before your edit 20:48 <+bridge> [ddnet] @timakro https://github.com/DDNetPP/DDNetPP/blob/master/src/game/server/entities/character.cpp#L1854-L1934 20:49 <+bridge> [ddnet] unrelated, @Learath2: you said you worked with swagger before. does one have to design one's API with that tool in mind, or can you describe the API with it later on? 21:18 <+bridge> [ddnet] @heinrich5991 I only ever used it to design an api, but I think there are tools that generate it from php code 21:18 <+bridge> [ddnet] (Using annotations) 21:59 <+bridge> [ddnet] <Андрей Рудой> I used swagger and openapi even wrotey own codegen. What I got to say - it's pretty shitty permissive tool without any contracts in mind 22:00 <+bridge> [ddnet] <Андрей Рудой> And all codegenerators for it are shitty generating degenerative code that doesn't work / poorly designed 22:00 <+bridge> [ddnet] <Андрей Рудой> If you ask me what to use I'd say use gRPC 22:49 <+bridge> [ddnet] @timakro https://pastebin.com/raw/JrVBkyq4 23:05 <+bridge> [ddnet] @timakro could you look into it again maybe? i am trying to fix it but i cant reproduce the bug at all, it just happens randomly sometimes 23:15 <+bridge> [freenode] If its so seldom just break the loop before accessing an out of bounds value 23:16 <+bridge> [freenode] @fokkonaut ^ 23:17 <+bridge> [ddnet] https://github.com/fokkonaut/F-DDrace/commit/9cea7be036e12959102ef8992f65f726c891da25 23:17 <+bridge> [ddnet] like this? 23:18 <+bridge> [ddnet] it may look weird if i break at certain places 23:19 <+bridge> [ddnet] this seems to work, but i also dont understand what you did with AdditionalLength, since I am unable to use it because HistoryPos + 1 will instantly crash so i worked around it which seems to work nicely 23:19 <+bridge> [freenode] No I mean just check if HistoryPos >= m_TrailHistory.size() before indexing 23:19 <+bridge> [freenode] And break in that case 23:19 <+bridge> [ddnet] isnt that what i do now? 23:21 <+bridge> [ddnet] i think i am doing exactly thats 23:22 <+bridge> [ddnet] a break would only break the while loop which would still index at the bottom 23:22 <+bridge> [ddnet] so return is okay since nothing more is happening after the loop anyways 23:22 <+bridge> [ddnet] no? 23:23 <+bridge> [freenode] Yes, you're right. Though there's still a possible path to a out of bounds index - maybe? 23:23 <+bridge> [freenode] Wow the code prior was completely borked 23:24 <+bridge> [ddnet] xD 23:24 <+bridge> [freenode] So this worked? 23:25 <+bridge> [ddnet] i dont know 23:25 <+bridge> [ddnet] it does not happen alwayys 23:25 <+bridge> [ddnet] time will tell me whether this works^^ 23:25 <+bridge> [freenode] If it still happens just add a if directly before the indexing 23:25 <+bridge> [ddnet] kk, thanks 23:26 <+bridge> [freenode] Or rewrite this mess ^^ 23:26 <+bridge> [ddnet] xD