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 2022-05-23 00:00:00Z and 2022-05-24 00:00:00Z
Avatar
hey is there an API for ddnet.tw?
02:09
i think someone said there was one at one point but it was either never fully working/shut down
Avatar
chillerdragon BOT 2022-05-23 05:34:53Z
API for what
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 06:08:48Z
Wasn't there some CPU optimization for idle ddnet servers? Like skip some thing when the server is empty. What was it? And where in da code
Avatar
76efcc6 Fix 0 byte malloc in register.cpp (fixes #5187) - def- 847454f Merge #5189 - bors[bot]
Avatar
e54f0ee Break early out of loop - ChillerDragon 064dc2c Merge #5196 - bors[bot]
Avatar
The rule for net objects if you set validate_size=False: "Can't use members that need validation in a struct whose size isn't validated" seems a bit unnecessary, because NetIntRange is the only member type that emits a validation function, and that is only "ClampInt". :/ @fokkonaut you wished that I move the display data in DDNetCharacter, ... so should I change NetIntRange of m_Jumps and m_StrongWeakID to NetIntAny?
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 09:52:53Z
@Jupstar ✪ im procrastinating merge since days now due to ur fakin c++ overlord MÜKROSECONDOS code
09:53
constexpr auto = &std::time::using::chrono::seconds::in_micro::Microseconds(std::chrono::OneSecond() * std::numbers::Number(1));
🤣 1
09:54
watafaka
09:55
whats even the benefit of that? thread_sleep(int seconds) was so simple and readable
Avatar
I am pretty sure the compiler optimizes this, but there is a break missing :p
Avatar
Improves the freezebar a little bit, because this way it is not unnecessarily displayed empty. https://youtu.be/IybuY5QYUDg

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [x] Considered possible null pointers and out of bounds array indexing
  • [x] Changed no physics that affect existing maps
...
Avatar
Avatar
[quakenet] ChillerDragon
constexpr auto = &std::time::using::chrono::seconds::in_micro::Microseconds(std::chrono::OneSecond() * std::numbers::Number(1));
way to verbose
Avatar
Avatar
lynn
hey is there an API for ddnet.tw?
what api do you need?
Avatar
im asking for a friend, but they need access to profile + map data
Avatar
Avatar
c0d3d3v
what api do you need?
oops forgot ping
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 10:31:32Z
just dl the database and write sql queries then
Avatar
Avatar
lynn
oops forgot ping
maybe this https://ddnet.tw/stats/sql.js/ or download it from here https://ddnet.tw/stats/
Avatar
Avatar
lynn
im asking for a friend, but they need access to profile + map data
lynnyaLove 1
Avatar
perfect, thank you
10:36
im assuming there are no limits enforced here? other than whatever can be provided by the website load time
10:37
this would be used by a Discord bot fyi
Avatar
if you want to scrape all, be nice and wait a bit inbetween
10:37
otherwise fine
Avatar
gotcha, thought so
10:37
thanks for your help both
Avatar
Avatar
c0d3d3v
The rule for net objects if you set validate_size=False: "Can't use members that need validation in a struct whose size isn't validated" seems a bit unnecessary, because NetIntRange is the only member type that emits a validation function, and that is only "ClampInt". :/ @fokkonaut you wished that I move the display data in DDNetCharacter, ... so should I change NetIntRange of m_Jumps and m_StrongWeakID to NetIntAny?
Well, I really thought u can just add a variable? That definitely happened earlier
10:48
@heinrich5991 ?
Avatar
Avatar
fokkonaut
Well, I really thought u can just add a variable? That definitely happened earlier
we probably can... but not with NetIntRange currently
Avatar
So what would be your approach?
10:52
changing them to Any?
Avatar
that would be an option, and just do not use clamp at all for these 3 variables, or we remove the rule (edited)
Avatar
[2022-05-22 23:31:02][mysql]: can't deinitialize, connections remaining: 2 @Zwelf Can we get more info about why it's hanging? There were no further errors printed relating to sql
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:06:02Z
i implemented python in bash just for trols :D
😄 1
11:06
11:07
not real python syntax, but nice
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:08:56Z
ah fak
11:08
wat i miss?
11:09
my python is rusty
11:09
ah damn parenthesis. iv been writing to much ruby latley
11:12
11:12
better?
11:12
oops now i leaked my internals xd
11:12
im def not using eval
Avatar
we don't talk about the forbidden function
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:14:01Z
hrhrhr
11:14
evil is top10 underrated programming features
11:14
eval*
11:14
xd
11:15
ok so nextup is inline c
11:18
ok that was too easy xd
11:18
i might actually use that :D
Avatar
The xonsh shell is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.
11:26
This is actually a thing
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:35:55Z
ou i would use that if i were a python fan
11:35
but im bash fan so...
11:36
why would one do a while(0) loop? xd
11:36
Unofficial mirror of bash repository. Updated daily. - bash/variables.c at 9439ce094c9aa7557a9d53ac7b412a23aa66e36b · bminor/bash
11:37
does c not have unnamed scopes?
11:37
yea no i dont get it xd
11:38
@Jupstar ✪ btw i sold amd again thanks for a 15% gain
Avatar
Avatar
[quakenet] ChillerDragon
does c not have unnamed scopes?
to write your macro like a function MY_MACRO(x, y); with a semi at the end
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:39:46Z
ou
11:39
smort bash devs
Avatar
c macros suck it forces you to do magic tricks like that
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 11:41:22Z
@Jupstar ✪ when are we creating our own language? Lets call it ++c and write some cool standard for it. Then we let @Ryozuki write a compiler for it
Avatar
@unexploredtest:kde.org BOT 2022-05-23 11:53:49Z
Then write PPDDNet?
Avatar
bf2d3d5 do not render freezebar if you are not freezed - C0D3D3V 59c79fa Merge #5197 - bors[bot]
Avatar
chillerdragon BOT 2022-05-23 13:51:18Z
Lmao yea
Avatar
Avatar
c0d3d3v
The rule for net objects if you set validate_size=False: "Can't use members that need validation in a struct whose size isn't validated" seems a bit unnecessary, because NetIntRange is the only member type that emits a validation function, and that is only "ClampInt". :/ @fokkonaut you wished that I move the display data in DDNetCharacter, ... so should I change NetIntRange of m_Jumps and m_StrongWeakID to NetIntAny?
if you want to go around that rule, you have to consider how to handle backward compatibility and so on yourself
14:52
the only reason why I added it was probably because my code didn't account for these checks
Avatar
perhaps you could figure out a general way to extend net objects @c0d3d3v, probably by adding default values for fields not included in the object
Avatar
Probably by adding default values for fields not included in the snapshot. CC #2484
Avatar
chillerdragon: std::this_thread::sleep_for(100ms) not that hard
15:08
and if too hard, u have full cppreference explaining it in detail for u
15:08
but i'd say cant be more intuitive
15:08
this thread, sleep for
15:08
this is litteraly english
Avatar

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--u...
Avatar
Avatar
Jupstar ✪
chillerdragon: std::this_thread::sleep_for(100ms) not that hard
you have to using namespace something for that to work IIRC
Avatar
Reported by JimmyJazzThe1st DDNet_crash_log.zip Not sure if I'm using drmingw parser correctly: ``` $ scripts/parse_drmingw.sh ~/DDNet.exe ~/DDNet_crash_log_11960_2022-05-23_13-42-02.RTP Parsing address: 5C9EFB (img base: 400000) /home/deen/isos/ddnet/ddnet-source/src/engine/client/text.cpp:186 Parsing address: 46E0D4 (img base: 400000) /home/deen/isos/ddnet/ddnet-source/src/game/client/components/maplayers.cpp:1103 ...
Avatar
Avatar
heinrich5991
perhaps you could figure out a general way to extend net objects @c0d3d3v, probably by adding default values for fields not included in the object
:/ would probably be the best ... so much work
Avatar
Otherwise curl_global_init would be called from the first curl_easy_init, but curl_global_init isn't threadsafe. Fixes #5195.

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect ex...
Avatar
chillerdragon: and then write ++DDNet in ++C? 😄
Avatar
1158bbf Don't assume script name/path - def- f03a659 Merge #5200 - bors[bot]
Avatar
[quakenet] ChillerDragon BOT 2022-05-23 15:43:15Z
yes!
15:43
aka PPDDNet thats what unexploredtest alr said
15:44
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/client.cpp at f03a6599081d3fd3ba567309670c6728a85fc399 · ddnet/ddnet
15:45
its bit more weird with decltype and shit
15:48
7778afd Update Dutch translations by Ronan - def- 76ed324 Call HttpInit in server - heinrich5991 c93658f Make sure we don't accidentally initialize libcurl in a thread - heinrich5991 50de8d2 Merge #5175 #5202 - bors[bot]
Avatar
ah, we don't distinguish between timestamps and durations? that's a bit sad
Avatar
Avatar
[quakenet] ChillerDragon
its bit more weird with decltype and shit
its amazing bcs in 1000000000 years when we switch to picoseconds we dont have to change that line
16:00
isnt that truly amazing
16:00
i saved some future alien 1 second of his life
Avatar
the variable could probably be renamed to not include 'nanoseconds' for clarity
Avatar
true, then i'd have saved him 2 seconds of his life
16:01
damn me
Avatar
I've made new racist shields because I'm not a fan of the current ones and also the new ones are in vector so they can be part of the same svg file as hud
Avatar
I’m still a little skeptical of the new shields usefulness in mapping 😛
Avatar
yeah me too but if they're gonna exist, they can at least look good
16:14
imo they don't encourage the cleanest level design
Avatar
We have no maps with them yet, so we can also remove them again I guess
Avatar
i find the weapon shields are a little too specific as a map mechanic but maybe its good idk
Avatar
yes please put them outside of game.png, its probably nicer with the amount of custom pngs out already dont want to judge about usefulness tho^^
Avatar
Avatar
Jupstar ✪
yes please put them outside of game.png, its probably nicer with the amount of custom pngs out already dont want to judge about usefulness tho^^
I thought about a ddnet_game.png for ddnet entities
Avatar
idk about placing it outside game.png
16:24
maybe it could be replaced by a known-good image if the game.png doesn't contain something for it
Avatar
game.png is bloated anyway what is game.png even it contains effects, shields, flags, hud cursors
16:24
completly random
Avatar
okay, that's a different argument
Avatar
You can do the same by removing all the weapons and giving some back in a column so you can't see it. Another way would be to use à transitional teleport with speedups so it's too fast for players to see.
Avatar
Avatar
Pipou
You can do the same by removing all the weapons and giving some back in a column so you can't see it. Another way would be to use à transitional teleport with speedups so it's too fast for players to see.
that argument was also brought forward in the PR
16:25
perhaps we should discuss the usefulness there, not here
16:26
@Jupstar ✪ but placing it outside of game.png for backward compatibility concerns doesn't sound very useful to me, it creates the same backward compatibility problem for the new image. am I missing something?
Avatar
but we dont really use the new image yet
Avatar
Sorry Heinrich, I had no idea. I never use or look at github
Avatar
the only use case I can think of is if you have some map where you pass the same area multiple times with different weapon setups and you only wanna take away 1 specific weapon every time
16:28
so an oddly specific use case
Avatar
Avatar
Ravie
the only use case I can think of is if you have some map where you pass the same area multiple times with different weapon setups and you only wanna take away 1 specific weapon every time
that's basically what was said in the PR
Avatar
ah I didn't read the whole pr either
Avatar
of course it's about a Konsti map twinbop
Avatar
ᶰ°Konͧsti 2022-05-23 16:47:17Z
justatest
16:47
I dont understand why people argue about a tile that wont harm them tho
Avatar
adding a tile isn't free, there's more stuff a player has to learn
Avatar
why does POS1 key on keyboard not scroll up the whole F1 console anymore? was there a change lately in f1 console?
Avatar
perhaps it's being eaten by the line input?
17:00
perhaps it could be mapped to shift-pos1 if that's the case
Avatar
doesn't help, shift+pos1 is for selecting text
17:01
at least if completely implemented
Avatar
hm. ctrl-pos1?
Avatar
would work I guess, ctrl+left/right is for word skipping
17:01
but ctrl+pos1 is unused
Avatar
end key scrolls to the latest line, so that one works 😛
Avatar
Avatar
Jupstar ✪
why does POS1 key on keyboard not scroll up the whole F1 console anymore? was there a change lately in f1 console?
what do you mean with whole? there was a fix by Robyt so the last page is not renderd again...
Avatar
pos1 = first page end = last
17:03
or other way around
Avatar
ah I was lost
Avatar
Do any of you use something like docker locally?
Avatar
podman might be more to your liking if you like chasing weird bugs
17:04
I tried that for a bit
Avatar
I've been thinking about whether I want to have a local LEMP stack running or if I should catch up with the times and have it running in a container
Avatar
I liked the opinion that containers hide complexity, instead of removing the complexity in the software itself
Avatar
docker kinda annoying when you host a tw server
Avatar
Avatar
c0d3d3v
what do you mean with whole? there was a fix by Robyt so the last page is not renderd again...
it was probably that which broke it, cause I didn't realise this was a thing (edited)
Avatar
docker is annoying 100% of the time, from their weird enterprise bootlicking to their odd approach to having a demon running all the time
17:06
daemon*
Avatar
podman is running containers without a daemon
Avatar
have to flush conntrack entries on tw ports when the server restarts (bridge mode) (edited)
Avatar
pos1/end are only supposed to work in the console when the input is empty
Avatar
overwise people who were online can't join anymore
17:07
only way to fix that is to set the ct in host mode
Avatar
Avatar
Robyt3
pos1/end are only supposed to work in the console when the input is empty
make sense, but pos1/home only scolls up one page, instead of jumping to the beginning. Do you want to fix it?
Avatar
Avatar
c0d3d3v
make sense, but pos1/home only scolls up one page, instead of jumping to the beginning. Do you want to fix it?
yeah, I'll fix it
👍 1
Avatar
Avatar
Learath2
docker is annoying 100% of the time, from their weird enterprise bootlicking to their odd approach to having a demon running all the time
well yeah, after you can still restart the daemon without stopping the containers
17:10
(upgrade ig works also)
17:10
ah Live restore allows you to keep containers running across Docker daemon updates, but is only supported when installing patch releases (YY.MM.x), not for major (YY.MM) daemon upgrades.
Avatar
@trml in what units is SnapItemSize messured? I think the original NETOBJTYPE_SWITCHSTATE has 72 bytes
Avatar
Avatar
c0d3d3v
@trml in what units is SnapItemSize messured? I think the original NETOBJTYPE_SWITCHSTATE has 72 bytes
also you can use Item.m_DataSize instead of const int SnapItemSize = Client()->SnapItemSize(IClient::SNAP_CURRENT, i);
Avatar
I think it's in bytes
Avatar
@c0d3d3v I mostly just copied the approach used for GameInfoEx there. I will probably try to look a little more into the snapshot code though
17:21
the number I used is just from a "dbg_msg" print (I didnt check how it is calculated yet)
Avatar
@heinrich5991 if I would implement, the default value mechanic, for some usecases it would be enough, but using a version value like trml just used, would probably be enough and better than default values
Avatar
I don't think using a version is better tbh
17:22
what use is the version?
Avatar
since you would only need the default values when the snapshot is shorter than expected (most typically newer client and older server), perhaps it's ok to just do it in the parsing?
17:23
or, hmm, maybe someting along the lines of seting all values to a default while parsing, then to a memcpy from the snapshot
Avatar
Avatar
Learath2
Do any of you use something like docker locally?
yes I do, whats the matter?
17:24
I highly recommend using a custom image if you host Teeworlds in docker
Avatar
I'm only looking to use it as a local web dev environment, was wondering if anyone else was using it and if it was a smooth experience
Avatar
Avatar
Learath2
docker is annoying 100% of the time, from their weird enterprise bootlicking to their odd approach to having a demon running all the time
you don't need to run it all the time? Ofc if you want to host a container tho
Avatar
I'm happy to run a LEMP stack directly on my machine so if there are any annoyances with it I'd rather not spend time messing around with docker. I'm wondering about things like mounting the local files, connecting to stuff in the container e.g.
Avatar
if you have put some work in your docker compose files, you can incredibly easy host your infrastructure, even frontend and backend with hot-coding
Avatar
Avatar
heinrich5991
what use is the version?
like for example if you would use default values for freeze start tick, set it to 0, how would I know if it is set by the server to 0 or by parser
Avatar
set it to a sentinel value, probably -1?
Avatar
I could also just use the size of the snap to determine the version. But does not work if we only add new flags to a flag field
Avatar
Avatar
heinrich5991
set it to a sentinel value, probably -1?
and then checking everywhere where its used for -1 or would I set m_HasExtendedDisplayData to false xD
Avatar
Holding down the pos1 key will still make the console text flash though. Fixing that would require to first calculate the total number of pages in a separate pass before rendering the current page.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out ...
Avatar
how about using two flag bit in DDNetCharacter for versioning xD so it could be changed 2 more times
17:33
🙈
Avatar
ah yea, for adding flags we need a version
Avatar
alternativ would be a version field in a snap that is not send as often as character, but that gives info about the versions of other snaps
17:36
like GameInfoEx (I think its not send often)
17:37
mh I'm wrong, It is sended all the time
17:37
or use the GameInfoEx version also for other snaps
Avatar
snapshot objects are only sent every time they change though (so gameinfoex is most likely only sent once)
17:40
otoh, parsing a netobject will be slightly easier if it doesnt depend on other netobjects
Avatar
mh true, but we could define GAMEINFO_CURVERSION, also as protocol version, save it in the client, and use it to parse other snaps. :/ -.- Do not know, Honestly I would just add a version to ddnetcharacter, but the optimization heart says that goes better xD (edited)
17:48
@heinrich5991 what do you think about using GAMEINFO_CURVERSION as protocol version? Or should every snap use its own version? its a bit strange to use 32 bit for version, But I do not know how good that it is compressed, So it might not be to bad. (edited)
Avatar
Does a user with the privilege GRANT OPTION also have the ability to GRANT GRANT OPTION to other users? 😄
17:51
Hard to find documentation for something so specific
Avatar
@c0d3d3v hmmm. that would still need default fields though, no?
17:56
because some objects might be shorter in older versions
Avatar
Avatar
heinrich5991
because some objects might be shorter in older versions
yes just do the handeling of that in parsing like in gameclient, based on the protocol or snap version
Avatar
but that would lose the automated handling of the correct snapshot length and verification of snapshot data
18:07
likely leading to bugs :/
Avatar
Support is incomplete for leak_ip_address_to_all_servers (will only ping the first address of each server) and for the leak_ip setting (which will also only ping the first address of each server).

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test if it works standalone, system.c especially
  • [ ] Considered possible null pointers and ou...
Avatar
0c518ba Fix pos1 only scrolling up one page in console - Robyt3 c929ef4 Merge #5204 - bors[bot]
Avatar
Avatar
heinrich5991
but that would lose the automated handling of the correct snapshot length and verification of snapshot data
I dont get the point, It I set it to default -1 I also have to catch that in the parsing, or way later if I want to access the data. In my opinion is the check for a version (or the size) in parsing best, because it allows to set a value like "hasExtendedDisplayData" to true, and if its false, the display data will be random "or default so useless anyway.
Avatar
well, to take a step back: why do we have the generated protocol?
18:32
so that we don't parse it in our own code, so that we are less likely to introduce out of bounds accesses, etc.
18:33
if we completely turn this off, we lose these benefits
Avatar
Avatar
deen
if you want to scrape all, be nice and wait a bit inbetween
how long should people wait inbetween scrapes? just testing (first time messing with json/json api) and dont want to spam too much if people generally wait a good bit
19:12
just a few seconds?
Avatar
Avatar
heinrich5991
well, to take a step back: why do we have the generated protocol?
How about this: I just move the new display data into DDnetCharacter for now, and do the check if the data is there just based on the size of the snap ( @trml can do that too). So that this finally gets done quickly (And I do not have to worry about it). And later I or someone who has time, can deliver the mechanism for default values and then replace the check for the size with checks for default values.
Avatar
Avatar
Broso56
just a few seconds?
ok
Avatar
@c0d3d3v sounds okay
👍 1
Avatar
Alternative to #5193 for me, this generates about the same fps as not using ELLIPSIS. my idea was to simply render the text without further conditions if it fits in anyway. Since most names fit anyway, rendering ELLIPSIS is usually the exception. maybe @Jupeyy can test this with his awesome gpu

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a ...
Avatar
@heinrich5991 not clear if this is still relevant, because I was on a slightly older nightly, but I get random crashes because of Stun while beeing like 20min ingame Also did not have debug symbols on... I will report again if this also happens on latest nightly xD (edited)
Avatar
@c0d3d3v sounds bad. I don't see a way for an assert to happen in that function :/
Avatar
secure_random_data not initialized?
Avatar
client initializes it early
22:10
also unlikely 20min in
Exported 232 message(s)