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 2019-08-25 00:00:00Z and 2019-08-26 00:00:00Z
Avatar
@heinrich5991 how does your race records file merger work?
12:22
I cant drop the files in, and if I open the script it closes again?
Avatar
@fokkonaut try -h, heinrich usually writes the help even for the smallest tools 😛
13:51
If that doesn't work i'd try passing the first file as argv1 and second as argv2
14:03
ah wait
14:04
cat_records.py -blm -BlmapChill_record
14:04
like this?
Avatar
wot
Avatar
no
Avatar
why dash
14:05
cat_records.py blm BlmapChill_record
Avatar
doesnt owrk
14:05
File "C:\Users\Finn\Desktop\cat_records.py", line 68 print(entry.unparse(), end="") ^
Avatar
broked tool
Avatar
@heinrich5991
14:06
need help
Avatar
ChillerDragon 2019-08-25 18:34:47Z
Uhm how do javascript ppl write nice functions with return values and this arrow crap everywhere @archimede67
18:34
it gets nested and long so quick
18:35
and if i return i return in the wrong function -.-
Avatar
Wt
18:51
Wat
Avatar
ChillerDragon 2019-08-25 18:52:59Z
my code looks ugly
Avatar
Show
Avatar
ChillerDragon 2019-08-25 18:53:26Z
how do you properly work with arrow functions that are nested inside other functions
18:53
18:54
i mean let error = true; wtf?!
18:54
its the worst and it doenst even work xd
Avatar
just do a promise xd
Avatar
ChillerDragon 2019-08-25 18:55:50Z
the arrow function inside gets called first and if (error) is always executed even if error = false is executed xd
Avatar
ye logic
18:56
ur query is probably async
Avatar
ChillerDragon 2019-08-25 18:56:27Z
ya seems like
18:56
i tried some .then and stuff but idk how js works xd
Avatar
just do a promise that resovles on success and reject on error
18:57
function yourfunction(...) { return new Promise((resolve, reject) => { // some code success resolve(result); // some code fails reject("some error"); }); }
18:58
the u use like this
18:58
// in ur code yourfunction(...).then(result => console.log(result)).catch(err => console.error(err)); (edited)
Avatar
ChillerDragon 2019-08-25 18:59:01Z
srsyly wtf is this js
18:59
i thought its nice clean and easy
Avatar
its fukin easy xd
Avatar
ChillerDragon 2019-08-25 18:59:15Z
this is the most fucked up shit ever xd
Avatar
ChillerDragon 2019-08-25 18:59:28Z
i write my acc system in assembler
18:59
fuck js
Avatar
its 2 lines
18:59
also who uses SQL with js
Avatar
ChillerDragon 2019-08-25 19:00:38Z
lamp stack switcher onbos
19:00
i didnt get the value mongoDB serves
Avatar
ChillerDragon 2019-08-25 19:07:59Z
this is not getting better xxxxxxxxxxxxxxxxxxxxxxxxxxxxD
19:08
the promise is also a error function
19:08
arrow
19:08
ya should call them error functions instead hehe
19:10
how do i return values out of my functions if i am always in some arrow function?
19:12
u can use await async
19:12
which is cleaner
Avatar
Ye
19:18
u can await a promise
19:18
@ChillerDragon why do u return values in promise
Avatar
ChillerDragon 2019-08-25 19:19:59Z
no the question is why am i in a promise
19:20
i just want to write some code and return values :c
19:20
i mean functions should return something right?
19:20
i thought javascript is such wow functional language
Avatar
dude
19:21
the return value is in the .then
19:21
just
19:21
tell me if DB.query is async
Avatar
ChillerDragon 2019-08-25 19:21:31Z
i assume its async
Avatar
don't u have source
Avatar
ChillerDragon 2019-08-25 19:21:41Z
i do
Avatar
so look
19:22
into it
Avatar
ChillerDragon 2019-08-25 19:23:20Z
tbh idk what tolook at there are a few places in the codebase where the string query occurs
Avatar
just look the function query(...)
19:23
is it async
19:24
or does it return some kind of Promise
Avatar
ChillerDragon 2019-08-25 19:24:56Z
$ grep -nri "query(.*)" | wc -l 71
Avatar
dude
19:25
just look in the fucking file 😂
19:25
search for the function definition
19:25
not the usages
19:25
idc about usages
Avatar
ChillerDragon 2019-08-25 19:28:09Z
ya idk how js defineds functions i struggle to find it
19:28
dude does vsode ignore node_modules? :c
19:29
19:29
no clue if i am looking at the right place but this is not async i guess
Avatar
u have a cb function
Avatar
ChillerDragon 2019-08-25 19:29:56Z
lool the whole lib has no async
19:30
ya
Avatar
so why do u even put query = Database.DB.query xd
Avatar
ChillerDragon 2019-08-25 19:30:29Z
idk
Avatar
ur only solution is to use Promise
Avatar
ChillerDragon 2019-08-25 19:30:39Z
found it online thought it had some meaning
19:30
but i was confused as well
Avatar
maybe if u wanna use the query later in ur code but not in urr case
19:31
just search the lib docs
Avatar
ChillerDragon 2019-08-25 19:32:28Z
ya didnt find those xd
19:32
this one is good
Avatar
no
Avatar
mongodb better
Avatar
i used it
19:33
nah
19:33
nosql sucks
Avatar
nah
19:33
sql sucks a lot
Avatar
ye
Avatar
ChillerDragon 2019-08-25 19:33:54Z
19:33
triggered xd
19:34
learn fcking promises
19:34
or dont use js
Avatar
xd
Avatar
ChillerDragon 2019-08-25 19:34:25Z
i have no clue how to structure my code
Avatar
ur triggering me
Avatar
ChillerDragon 2019-08-25 19:34:44Z
my functions get suupper big with all these promises and nested
19:35
idk how to improve my style
Avatar
u just do things wrongly i guess
Avatar
ChillerDragon 2019-08-25 19:35:57Z
no shit xd
19:36
but how to lean the good way :c
19:36
learn*
Avatar
googl
Avatar
ChillerDragon 2019-08-25 19:36:54Z
wat
Avatar
google
Avatar
ChillerDragon 2019-08-25 19:37:08Z
wat
19:37
Avatar
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
Avatar
ChillerDragon 2019-08-25 19:38:29Z
results dont look promising tbh
19:38
i even bought a book on js xd
Avatar
lol
19:38
"book"
Avatar
ChillerDragon 2019-08-25 19:39:07Z
ikr
19:39
books nice
Avatar
The best way to write better js turns out to be not using js at all but using ts
Avatar
I get really annoyed by the file score of ddnet right now... I havent figured out why but under special conditions it just wont save the score.
20:25
Can anyone look into that?
20:25
It prints the message that you finished and sets your score, but after reconnect or in /rank you see that it didnt get save
20:27
I could not find big differences compared to 9.0.2 (the version ddnetpp is based on) and on @ChillerDragons server file score seems to be working just fine
20:33
This is the only thing that could be causing this issue; it was made after 9.0.2, so chillerdragons mod doesnt have this and it is inside of the save function. @Learath2 Do you have any ideas?
20:33
wait, actually this is in Init()
20:34
still, all other changes applied to file_score.cpp shouldnt affect this
20:38
Or can it be caused by changes to teams.cpp?
Avatar
ChillerDragon 2019-08-25 20:42:35Z
so you are sure the script worked fine? The rank is included in the merged database? But when the server starts it deletes the rank? Or does it stay in the database and is not loaded?
Avatar
why are you weird
20:44
I havent used any script
20:44
Read my text and then you know the problem
20:44
The score is not being saved On finish
20:44
but only Sometimes
20:45
has nothing to do with heinrichs scripts, I havent used it yet since I need python 3 first
Avatar
ChillerDragon 2019-08-25 20:47:13Z
Oh thought its still about the db merge
20:48
What do you mean by special conditions? Something you can reproduce?
Avatar
I dont know when it happens
Avatar
ChillerDragon 2019-08-25 20:48:40Z
hmm
20:48
how often?
Avatar
sometimes when I start the server and finish it works, and if i come back after some minutes it doesnt work anymore
20:49
Too often,l
20:50
just try plain ddnet wit file score on a linux server
20:50
after finish check /rank
20:51
And if it shows your rank, reconnect with anothsr name and try again, if it also works wait some minutes or an hour and try it again
20:51
with a new name ofc
Avatar
about 20 mins ago there was a ddos on ger and as a aftereffect of the ddos i started having those 'phantom lags' i talked about earlier (https://discordapp.com/channels/252358080522747904/293493549758939136/611160075201151004)
Avatar
I think i have the same problem Patiga
21:50
few minutes i'm fine, then i completly lag and i can't do shit for about 3/4 seconds (edited)
21:50
just in ddnet ger servers
21:50
but i don't play in ddnet rus so i don't know if it's just ger or all ddnet servers
Exported 174 message(s)