Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/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 2024-01-11 00:00:00Z and 2024-01-12 00:00:00Z
Avatar
Avatar
fokkonaut
As you can see in the link, the client with new HUD Version will not receive the stars. Simply render them clientside. The Info you need is sent via DDNetCharacter snap object.
huh, i cant see any info i neer
00:14
or i just blind
Avatar
BlaiZephyr | meloƞ 2024-01-11 01:27:05Z
GameServer()->ClientsMaskExcludeClientVersionAndHigher(VERSION_DDNET_NEW_HUD) excludes clients that have the new hud (16010 or higher)
Avatar
Avatar
ChillerDragon
in case u are curious here is a 1 hour video on how to do txt accounts using tw style file code so no c++ streams https://www.youtube.com/watch?v=Bwt1PoFWOOA
რილია 2024-01-11 04:38:40Z
i though you're going to use sql or something
04:40
I want to use sql for managing my server accounts, can someone give me a direction (edited)
04:41
managing accounts with c++ is pain and hard to scale
Avatar
SQL is very simple in nature and the glue to use it in cpp is really trivial
05:30
also already implemented
05:30
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Avatar
რილია 2024-01-11 05:41:31Z
i fast read it yesterday, how can i combine my existing c++ code with sql ?
Avatar
Avatar
-StormAx
huh, i cant see any info i neer
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
poggers2 1
05:45
based on that you should be able to recreate the exact logic the server uses
05:46
@-StormAx oh, and you also have m_FreezeStart which might be helpful, idk right now
Avatar
Hey everyone, I'm hoping I might be able to get some help here, I couldn't find answers on the internet, however I came across a blog post by @deen and it led me here. The issue is about small to medium size DDOS attacks on my game server (Valve Source 1 engine game), I'm looking for help to mitigate such attacks. My server is often hit by 50k PPS attacks probably from some "script kiddie", I suppose an entry-level server should in theory be able to deal with such an attack? But I'm not sure how to go about it, as the few iptables rules I tried didn't really help, the game was still unplayable during the attack. Any suggestions or any tried and tested firewall rules would be greatly appreciated. Thanks.
👍 1
Avatar
I hate this world
👆 1
06:08
😆
Avatar
Avatar
bauxite
Hey everyone, I'm hoping I might be able to get some help here, I couldn't find answers on the internet, however I came across a blog post by @deen and it led me here. The issue is about small to medium size DDOS attacks on my game server (Valve Source 1 engine game), I'm looking for help to mitigate such attacks. My server is often hit by 50k PPS attacks probably from some "script kiddie", I suppose an entry-level server should in theory be able to deal with such an attack? But I'm not sure how to go about it, as the few iptables rules I tried didn't really help, the game was still unplayable during the attack. Any suggestions or any tried and tested firewall rules would be greatly appreciated. Thanks.
I would first of all check why the server is having issues. First thing to check is if the attacks have enough throughput to saturate your connection. If they do then you are in our situation and there isn't much to do, if you can find a cooperative hoster they might let you have filters upstream, that is the only thing that helps that isn't cost prohibitive. You also use Source 1, so I'm guessing Source networking, the protocol is much more supported than our custom solution, you might have better luck with cheap ddos mitigation solutions (arbor, etc...)
Avatar
Nah they're small attacks, not sure how to check why my server is having issues, I'm fairly new to Linux, but I guess them spamming 50k pps at my game port probably doesn't help
Avatar
It's either CPU overload or network overload
Avatar
Hmm I see, I'll have to look into it, I wonder if I can tell them to ddos me when im testing instead of playing 😂
06:18
Do you have any suggestions to be able to analyse the situation when the attack occurs (again I'm fairly new to linux so if you could point me in the right direction)
Avatar
Check htop for CPU usage
👌 1
Avatar
I suppose if it's cpu related I can always pay for a bigger cpu, if network maybe I can do the same?
Avatar
Also another critical thing is whether the kernel is struggling to deliver the 50k pps or whether there is a defect in the game that's struggling to drop the garbage fast enough
Avatar
I'd like to say there's many defects in the game because it's on a 2006 engine version which never got any of the security and other updates
06:21
But idk for sure
Avatar
Avatar
bauxite
I suppose if it's cpu related I can always pay for a bigger cpu, if network maybe I can do the same?
Problem is network cost scales exponentially for us. Attack cost scales weakly linearly. So you start needing insane amounts of networking just to handle the occasional attack
Avatar
Yeah i can see why it would be more difficult in your situation, fortunately I only run 1 small server for a game literally nobody plays so I'm not even sure why we're getting ddosed in the first place xd
Avatar
If the game engine is having trouble dropping the packets but not the kernel you can try dropping them in iptables and that should help. If the kernel is having trouble delivering the packets you'll need to mess around with kernel options, maybe try an xdp filter or upgrade to a better cpu
👌 1
Avatar
Avatar
bauxite
Yeah i can see why it would be more difficult in your situation, fortunately I only run 1 small server for a game literally nobody plays so I'm not even sure why we're getting ddosed in the first place xd
It seems to boil down to kids and psycopaths
😔 1
Avatar
I guess the first step is constructing a set of iptables rules that seems good, then go from there, unfortunately I have limited knowledge of iptables and documentation doesnt seem great, but i'll keep at it, see what happens. I gotta find some way to gather data during the attack that might be helpful, but idk where to start with that yet, other than checking the network and cpu usage. (edited)
Avatar
chillerdragon BOT 2024-01-11 07:00:14Z
Or there is an opportunity for reflection attacks. And @bauxite is just collateral damage. Or it’s a wider attack and the Hoster is actually the target or something like that. I also find it hard to believe small servers can be targets of ddos. Everytime I get some I am saying to my self „I can not be the main target that makes no sense“ :D (edited)
Replying to @Learath2 It seems to boil down to kids and psycopaths
Avatar
morning to the early birds
Avatar
chillerdragon BOT 2024-01-11 07:04:39Z
I personally like using nload to look at the amount of traffic but you seem to have those numbers already. Then I can recommend capturing one attack with tcpdump -w attack.pcap let that running for a short time during the attack then ctrl+c it. This is something you can then analyse after the fact. Then as fokko pointed out check your cpu usage. If your game server it self has cpu spikes and there is lags in game but your ssh is still smooth, then iptables will help. Or maybe even changing your game server code. You can try attaching a profiler and identify where the most cpu time is spent during an attack. There might be some way to change the code to make it more efficient.
Replying to @bauxite I guess the first step is constructing a set of iptables rules that seem…
07:05
It’s also interesting how you are being attacked. Is your game tcp or udp based? Are the IPs spoofed? Is it just a few IPs? Is it a lot of different IPs? Where are the IPs coming from?
07:09
Also which port or service is attacked? Is it targeting your game server? Is it doing so with packets that implement the protocol correctly? Can they tell you something about your weak spots? Is it targeting a different port? Could target a website you have running and the game server lagging is just a side effect.
Avatar
I'd always block everything using host's provided fw and only allow used ports first
07:22
Then yes you can check what the attack is exactly by analyzing it
07:24
iptables is kinda old and has been replaced by nftables, but if you still use iptables and want to gain a bit of performance you can put your rules in the table mangle, chain PREROUTI'G
07:24
PREROUTING*
Avatar
Avatar
ReiTW
iptables is kinda old and has been replaced by nftables, but if you still use iptables and want to gain a bit of performance you can put your rules in the table mangle, chain PREROUTI'G
Isn't iptables just a frontend for nftables in the kernel nowadays?
Avatar
iptables is the frontend for netfilter
07:29
nftables is netfilter too afaik, but somehow more optimized
07:29
from the wiki: nftables uses mostly the same Netfilter infrastructure as legacy iptables
07:30
Since I've learned about nftables, I heard numerous times that it would provide better performance than its designated predecessor, iptables. Yet, I have never
07:30
kinda old but still up (edited)
Avatar
Hm, I'm fairly sure nftables replaced the iptables part of the netfilter
Avatar
afaik the kernel part didn't change much (netfilter), only some changes regarding nftables. But nowadays when you use iptables command you're kinda using nftables
07:34
if you want to use the good old iptables you have to dpkg-reconfigure & switch to iptables-legacy
07:34
(debian)
Avatar
morning
07:38
@Learath2 i unmasked amd64 on llvm and all related to get llvm 17
07:38
also lld 17
07:38
but i dont have lld on path
07:38
its weird
07:38
oh
07:38
i have it today
07:38
maybe i needed a restart
07:39
❯ which lld /usr/lib/llvm/17/bin/lld
07:39
ye im sure it setups symlinks or path in some profile thing
Avatar
@Learath2 ah yea well looks like nftables uses a newer kernel infrastructure in which the idea was taken from BPF-like systems
Avatar
Bash caches executable locations
Avatar
inspired*
Avatar
You need to run hash -someargumentIdontrememberRTFM
Avatar
what i mean is, it required a login instead of closing and opening term
07:40
xd
Avatar
Avatar
ReiTW
@Learath2 ah yea well looks like nftables uses a newer kernel infrastructure in which the idea was taken from BPF-like systems
Yep, one thing I don't remember though is if the old iptables stuff still exists in the kernel
Avatar
Avatar
Learath2
Yep, one thing I don't remember though is if the old iptables stuff still exists in the kernel
they do if you switch to the legacy part
07:42
if not ig old modules are disabled by default
Avatar
@Jupstar ✪ did u see tcp getting a 40% increase on perfomance on kernel 6.9 opn epyc processors but not intel?
07:42
because epyc has separated l3 caches and intel has unified
Avatar
Kernel 69??
07:43
I have to upgrade
Avatar
Beyond the usual new wired/wireless network hardware support and the other routine churn in the big Linux networking subsystem, the Linux 6.8 kernel is bringing some key improvements to the core networking code that can yield up to a ~40% improvement for TCP performance when encountering many concurrent network connections.
07:44
6.8*
07:44
i mean
07:44
sry
07:44
Linux 6.8 Network Optimizations Can Boost TCP Performance For Many Concurrent Connections By ~40%
07:45
A hell of an improvement especially for the AMD EPYC servers. Kudos to those at Google continuing to push these very enticing low-level kernel optimizations.
07:45
07:45
As we've seen recently with efforts to drop old/obsolete network drivers, several outdated WiFi drivers were removed for Linux 6.8. Newly-dropped Wifi support include Libertas 16-bit PCMCIA support, Atmel at76c50x drivers, HostAP ISA/PCMCIA style 802.11b driver, zd1201 802.11b USB dongles, Orinoco ISA/PCMCIA 802.11b driver, Aviator/Raytheon driver, Planet WL3501 driver, and the RNDIS USB 802.11b driver. When it comes to network driver improvements in Linux 6.8, the Intel high-speed NIC driver has added support for temperature and clock information reporting, among other random improvements throughout the many network drivers. NVIDIA Mellanox Ethernet data center switches can also now enjoy firmware updates without a reboot. On the WiFi side there remains ongoing WiFi 7 work and Extremely High Throughput (EHT) improvements.
07:46
@Learath2 they did this
07:46
"Currently, variable-heavy structs in the networking stack is organized chronologically, logically and sometimes by cache line access. This patch series attempts to reorganize the core networking stack variables to minimize cacheline consumption during the phase of data transfer. Specifically, we looked at the TCP/IP stack and the fast path definition in TCP."
Avatar
Avatar
Ryozuki
@Jupstar ✪ did u see tcp getting a 40% increase on perfomance on kernel 6.9 opn epyc processors but not intel?
Yeah, epyc
07:48
we should restructure our structs too
07:48
kek
Avatar
Unlikely it would matter for us. We probably wouldn't even notice it with all the lower hanging fruit
Avatar
რილია 2024-01-11 08:22:05Z
tear
Avatar
Avatar
ReiTW
minecraft happy about that
do they use tcp?
Avatar
Avatar
Learath2
I have to upgrade
so true
09:10
good morning you fiends
09:10
Avatar
რილია 2024-01-11 09:10:34Z
how can i narrow the result of pResult->GetString(0) down to standard characters ? (abcd....) and (123456...)
Avatar
idk if ddnet has any alphanumeric filter or rly any string filter routine (edited)
Avatar
I've created a function for that: c++ int str_check_special_chars(const char *pStr) { while(*pStr) { if (!((*pStr >= 'a' && *pStr <= 'z') || (*pStr >= 'A' && *pStr <= 'Z') || (*pStr >= '0' && *pStr <= '9'))) return 0; pStr++; } return 1; }
feelsamazingman 1
Avatar
you can iterate over it and remove characters that aren't in the ranges of 0x30-0x39, 0x41-0x5A, 0x61-0x7a
09:12
damn
09:12
quick
Avatar
it's from my mod, it simply checks a string for containing only alphanumeric characters. if not, it returns 0
Avatar
Avatar
fokkonaut
I've created a function for that: c++ int str_check_special_chars(const char *pStr) { while(*pStr) { if (!((*pStr >= 'a' && *pStr <= 'z') || (*pStr >= 'A' && *pStr <= 'Z') || (*pStr >= '0' && *pStr <= '9'))) return 0; pStr++; } return 1; }
რილია 2024-01-11 09:13:16Z
do you just copy my problem to chatgpt ?
Avatar
im sure std has something very quick and brief for this btw
Avatar
Avatar
რილია
do you just copy my problem to chatgpt ?
c++ if (str_check_special_chars(aUsername) == 0) { pSelf->SendChatTarget(pResult->m_ClientID, "Your username can only consist of letters and numbers"); return; }
Avatar
Avatar
რილია
do you just copy my problem to chatgpt ?
he makes the f-ddrace mod
Avatar
(from my ConRegister)
Avatar
რილია 2024-01-11 09:15:22Z
i gonna use it for registering stuff too
Avatar
Avatar
რილია
do you just copy my problem to chatgpt ?
imagine asking chtgpt about ddnet codebase lmao
Avatar
std::string in, out; std::copy_if (in.begin(), in.end(), std::back_inserter(out), [](char c) { return std::isalnum(c); });
09:16
i'd probably do smth like that
09:16
googling failed me in finding a quicker way
Avatar
Probably works equally as fine
09:16
da brevity doe
Avatar
Avatar
fokkonaut
I've created a function for that: c++ int str_check_special_chars(const char *pStr) { while(*pStr) { if (!((*pStr >= 'a' && *pStr <= 'z') || (*pStr >= 'A' && *pStr <= 'Z') || (*pStr >= '0' && *pStr <= '9'))) return 0; pStr++; } return 1; }
hm this one just needs its std::isalnum
09:17
true
Avatar
Avatar
gerdoe
hm this one just needs its std::isalnum
I've decided to adapt to ddnet's system.cpp style
Avatar
Avatar
fokkonaut
I've decided to adapt to ddnet's system.cpp style
superior of system.c troll
Avatar
რილია 2024-01-11 09:18:34Z
but i really don't feel like making the account system in c++, can some one give me direction in using sql ?
Avatar
indeed
Avatar
Avatar
რილია
but i really don't feel like making the account system in c++, can some one give me direction in using sql ?
what do u need direction for
09:18
what specifically do u not know how to do
Avatar
Avatar
რილია
but i really don't feel like making the account system in c++, can some one give me direction in using sql ?
check out mrpg, there is some mysql based account system
Avatar
Avatar
Ewan
what specifically do u not know how to do
everything justatest
Avatar
Avatar
რილია
i fast read it yesterday, how can i combine my existing c++ code with sql ?
რილია 2024-01-11 09:19:31Z
.
09:21
i tiered of making same shit in my every program and function
Avatar
idk what u mean
09:21
that's life
Avatar
რილია 2024-01-11 09:22:14Z
a cant no more make one of these. char abuff[1001]; str_format(abuff, sizeof(abuff),
Avatar
there are strategies that make it so you rarely have to write duplicate code
09:22
oh yeah
09:22
such is life
09:23
for simple stuff like this you can add an auxiliary buffer higher in scope just for formats & copies, guaranteed that you never access it before setting it, keep a pointer or reference to it, etc
09:23
so u can just use the same buffer for all ur string formats & copy them where they're needed
09:23
not "all" but a lot
Avatar
რილია 2024-01-11 09:24:03Z
cammo
Avatar
i have never interfaced with sql in ddnet so the implementation details are outside my grasp
09:24
i don't imagine it's anything difficult
09:24
you have your string query and you get your results
Avatar
Avatar
fokkonaut
I've created a function for that: c++ int str_check_special_chars(const char *pStr) { while(*pStr) { if (!((*pStr >= 'a' && *pStr <= 'z') || (*pStr >= 'A' && *pStr <= 'Z') || (*pStr >= '0' && *pStr <= '9'))) return 0; pStr++; } return 1; }
Why not isalpha?
Avatar
sift through them
09:24
and continue the tedium of life
Avatar
checkout CScore code in ddney
Avatar
Avatar
Learath2
Why not isalpha?
idk, made it a long time ago
09:25
afair it has some sql interaction
Avatar
Avatar
gerdoe
check out mrpg, there is some mysql based account system
რილია 2024-01-11 09:25:29Z
is mrpg a mod for ddnet ?
Avatar
Avatar
რილია
is mrpg a mod for ddnet ?
yup
09:25
kurosio refactored it a little™
09:25
so better check ddnet code kek
Avatar
რილია 2024-01-11 09:26:23Z
where is that boy who said to me use sql, guide me
Avatar
rare reference
Avatar
რილია 2024-01-11 09:27:27Z
@Mʎɹ シ
09:27
help.....
Avatar
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
🙏 1
Avatar
what should i make in dd net.
09:30
i am sort of bored
Avatar
Avatar
რილია
@Mʎɹ シ
Whut?
Avatar
did u read
09:39
This was my worst words
Avatar
Avatar
Mʎɹ シ
This was my worst words
რილია 2024-01-11 09:56:11Z
hi man
09:57
I think you can just take from my mode and refactor for your, this will be easiest than my explaining of sql in ddnet code
Avatar
Avatar
Mʎɹ シ
I think you can just take from my mode and refactor for your, this will be easiest than my explaining of sql in ddnet code
რილია 2024-01-11 09:58:29Z
ok
Avatar
And my explanation will be hard to understand cuz my english is so bad xd (edited)
Avatar
რილია 2024-01-11 09:58:56Z
cool
Avatar
Avatar
Ryozuki
do they use tcp?
yup
Avatar
Avatar
fokkonaut
@Learath2 when ur promised clientside alternative to get them back
Ah, I guess I can do that now that I have a bit of time
10:07
I wonder if people still care
Avatar
Probably. At least I think I would use it
Avatar
❤️
Avatar
Avatar
Learath2
I wonder if people still care
რილია 2024-01-11 10:35:08Z
yes
Avatar
I'd like to see a timer counting it down as a more nerdy option (like with numbers) xD (edited)
Avatar
რილია 2024-01-11 11:22:04Z
i want to make folder named "Accounts" when a server created. where do i need to put this ? if(!Storage()->FolderExists("Accounts", IStorage::TYPE_SAVE)) { Storage()->CreateFolder("Accounts", IStorage::TYPE_SAVE); } (edited)
Avatar
Do you know the hierarchy?
11:23
Like, where the server is starting (c++ main function)
11:23
and how everything is initializing from it?
Avatar
Avatar
fokkonaut
Do you know the hierarchy?
რილია 2024-01-11 11:23:50Z
no, i put it in CServer::Init() but it gave me an segmentation fault at building time
Avatar
What does it say?
Avatar
რილია 2024-01-11 11:24:14Z
just segmentation fault, nothing else
Avatar
(my guess: storage is not yet initialized)
Avatar
Avatar
რილია
just segmentation fault, nothing else
do you develop in release mode?
Avatar
რილია 2024-01-11 11:25:28Z
this is the code i use everytime $ cmake --build ../build && ./../build/DDNet-Server.exe
Avatar
holy shit he’s doing it like a barbarian
Avatar
Avatar
Ewan
holy shit he’s doing it like a barbarian
რილია 2024-01-11 11:25:58Z
why 😂
Avatar
cosmos do it in CStorage ctor
11:26
or rather after
11:26
immediately after
Avatar
anyways, fast-forward: I personally create the folder in CGamecontext::OnInit(), but that's up to you where you do it
❤️ 1
11:26
juts make sure the m_pStorage pointer is actually set
11:26
then it should work
11:26
im hungry
11:26
what to eat
Avatar
same, gonna do lunch break soon
Avatar
no home food and nothing is open
11:27
ugh
Avatar
I'm at work, gonna grab something from the chicken truck
11:28
what do u do at work
Avatar
programming
11:28
websites though, using VueJS
11:29
frontend and backend
Avatar
i should give my website some attention
Avatar
same
11:29
buttoo lazy
Avatar
admittedly I am slow to pick up on new tech
11:29
especially pertaining to the web
Avatar
it's a pain in the ass anyways
Avatar
i am using the vanilla stack but I could probably benefit from a css framework
Avatar
CSS, supporting different browsers, etc
Avatar
css is fine
Avatar
at least we were allowed to drop internet explorer support
11:30
cuz THATS a pain in the ass
11:31
i am so hungry
Avatar
Ok, gtg grab some food
11:31
see you in half an hour
Avatar
how’s food
Avatar
was nice
12:02
u still hungry? haha
Avatar
i neglected to start cooking until just now
12:02
got rice
12:03
and some chicken
12:03
me rn
12:06
i don’t like this kind of chicken…
Avatar
maybe i will use some of this ground beef instead
Avatar
რილია 2024-01-11 12:24:09Z
i added 1 folder and 2 files to the src directory. now it wont compile [127/135] Linking CXX executable DDNet-Server.exe FAILED: DDNet-Server.exe cmd.exe /C "cd . && C:\msys64\ucrt64\bin\c++.exe -O3 -DNDEBUG @CMakeFiles\game-server.rsp -o DDNet- Server.exe -Wl,--out-implib,libDDNet-Server.dll.a -Wl,--major-image-version,0,--minor-image-version, 0 && cd ." C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/game-server.dir/src/game/server/ddracechat.cpp.obj:ddracechat.cpp:(.text+0x54a3): undefi ned reference to `SkyB::IsStandardString(char const*)' C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/game-server.dir/src/game/server/ddracechat.cpp.obj:ddracechat.cpp:(.text+0x55a2): undefi ned reference to `SkyB::IsStandardString(char const*)' collect2.exe: error: ld returned 1 exit status [134/135] Building CXX object CMakeFiles/game-client.dir/src/game/editor/editor.cpp.obj ninja: build stopped: subcommand failed.
Avatar
undefined reference to SkyB::IsStandardString(char const*)
12:26
did you declare it in skyb.h?
Avatar
რილია 2024-01-11 12:28:47Z
this is my values.h file #ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H //I put all of my values and functions here namespace SkyB { bool IsStandardString(const char *pStr); } (edited)
12:29
and this is the values.cpp file #include "values.h" bool SkyB::IsStandardString(const char *pStr) { while(*pStr) { if (!((*pStr >= 'a' && *pStr <= 'z') || (*pStr >= 'A' && *pStr <= 'Z') || (*pStr >= '0' && *pStr <= '9'))) return false; pStr++; } return true; } (edited)
12:30
i see on one of the chillerdragon videos, he add something to the cmakelist.txt or something
Avatar
You need to add the file to cmake ,yes
12:31
otherwise it won't be recognized
Avatar
რილია 2024-01-11 12:32:35Z
is CmakeList.txt is auto generated?
Avatar
chillerdragon BOT 2024-01-11 12:32:40Z
No
Avatar
slowdragon
Avatar
chillerdragon BOT 2024-01-11 12:32:56Z
Only if your name is vhllerrdragon
12:32
Dude
12:33
I in da plane xd
Avatar
hi vhllerrdragon
Avatar
chillerdragon BOT 2024-01-11 12:33:20Z
I have a shell script that auto generates cmakelists
12:33
Fakof xd
Avatar
where u flying tho
Avatar
chillerdragon BOT 2024-01-11 12:33:55Z
bali
Avatar
fakof
Avatar
chillerdragon BOT 2024-01-11 12:34:03Z
Ye
Avatar
have a nice time bro
Avatar
chillerdragon BOT 2024-01-11 12:34:21Z
17 Hours no #developer
12:34
Don’t spam too much
Avatar
dont worry, i'll be here to start some conversations on multiple topics so that you can read everything later and look which is actually interesting and which not
12:35
thank me later
Avatar
chillerdragon BOT 2024-01-11 12:35:45Z
Dude but the Cmake script is so nice. I wonder if anyone would also like it. Idk how to market it better
12:35
Xd
Avatar
send github link maybe
Avatar
chillerdragon BOT 2024-01-11 12:36:14Z
ChillerDragon/crools/tw_cmake
12:36
Mobile link be like
Avatar
i cant click
Avatar
chillerdragon BOT 2024-01-11 12:36:31Z
Fakof
Avatar
where link 🐒
Avatar
chillerdragon BOT 2024-01-11 12:36:48Z
It’s more of a riddle
12:37
not found
Avatar
sounds like we will never get the script
12:37
if you're going to foolishly automate the cmakelists you should just glob the source files
Avatar
idk how he wants to market it better when he 1. doesnt send a link and 2. sends a wrong part of the link
Avatar
it's a riddle...
Avatar
chillerdragon BOT 2024-01-11 12:38:01Z
Dude I phone and it riddle
Avatar
ur riddle
Avatar
chillerdragon BOT 2024-01-11 12:38:12Z
I don’t wanna do /master/-
Avatar
no need
Avatar
რილია 2024-01-11 12:38:22Z
do i need to put it there in a way so it get compiled at correct moment? or just put it there (i am not talking about alphabetically order)
Avatar
idk what you mean
Avatar
its a riddle
12:39
me rn
Avatar
you need to put it in the proper category
12:39
just search an existing file yours is related or near to and add it next to that
12:39
i think the CI will warn you if they are not sorted alphabetically
12:39
but it doesn't actually matter for anything but clarity
Avatar
last warning before self destruction
12:40
code will be deleted permanently
Avatar
Avatar
Ewan
just search an existing file yours is related or near to and add it next to that
რილია 2024-01-11 12:40:10Z
ok
Avatar
chillerdragon BOT 2024-01-11 12:41:15Z
Ok riddle wrong
Avatar
you dont say
Avatar
chillerdragon BOT 2024-01-11 12:41:46Z
Ok my internet ded nvm I market other time
Avatar
greatest salesman of all time
Avatar
im liking this shift from new ppl wanting to make bot clients to ppl making server
12:44
also myr also has balls posting in this channel considering
Avatar
wait til the serverside bot questions come and they start their own client kek
Avatar
macho client or whatever it is called
Avatar
Avatar
fokkonaut
wait til the serverside bot questions come and they start their own client kek
think_bot
12:46
ez
Avatar
chillerdragon BOT 2024-01-11 12:47:02Z
Hard riddle
Avatar
tf is that name
12:47
lib crash
12:47
i know already what it does
12:47
very, very bad marketing
Avatar
chillerdragon BOT 2024-01-11 12:47:38Z
Xd
Avatar
you need some crash course
12:47
on marketing
Avatar
hit me up if you're interested, 5€/h
12:48
(that's marketing my friend)
Avatar
chillerdragon BOT 2024-01-11 12:48:21Z
meta
Avatar
i was hoping to reap the benefits of the msys build environment in another env but apparently it uses newlib libc + some cygwin glue for the posix compatibility layer (edited)
12:49
it's quite nasty
12:49
so i couldn't use the ucrt shell to make anything dependent on e.g. <sys/*.h>
12:49
or compile for 32 bit
12:49
feelsbadman
12:51
but i guess it's fine since the only thing in my setup that i actually need the posix compatibility for is distcc and it doesn't really matter which runtime that uses lol
Avatar
რილია 2024-01-11 12:52:16Z
now compile like a charm
👍 1
12:53
fokko are u windows
Avatar
რილია 2024-01-11 12:55:04Z
how can i generate one of these SKYBLOCK_VALUES_H for my header ?
12:55
the header guard?
12:55
#pragma once at the top of ur file
Avatar
რილია 2024-01-11 12:55:39Z
#ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H
Avatar
Avatar
Ewan
#pragma once at the top of ur file
or this, for the very few compilers that don't support #pragma once #ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H your code #endif // SKYBLOCK_VALUES_H
Avatar
რილია 2024-01-11 12:56:38Z
let me try it
Avatar
do u know what this does
Avatar
რილია 2024-01-11 12:58:57Z
i think it wont allow including a header no more than one time
Avatar
რილია 2024-01-11 12:59:38Z
is it gonna broke the program if you don't put these on your header ?
Avatar
It could lead to endless inclusions
13:00
like 2 file including eachother endlessly (edited)
Avatar
Avatar
რილია
is it gonna broke the program if you don't put these on your header ?
depends
Avatar
Avatar
Devinci
It could lead to endless inclusions
No
Avatar
it could
Avatar
it will lead to multiple definition error
13:01
and it will fail to compile
Avatar
that's another issue
Avatar
that’s the only issue
Avatar
🤷‍♂️
13:01
Have you already tried it? ^^'
13:02
yes I’ve used a header guard?
Avatar
including 2 .h withouth header guards
13:02
one including the other (edited)
Avatar
endless inclusions is not relevant
13:02
there’s no way for it to happen
Avatar
once it attempts to define symbol when there is already one of the same name, it will unconditionally fail on compilation *
13:03
and if there are no symbols to be defined, the header does nothing
Avatar
Avatar
Ewan
once it attempts to define symbol when there is already one of the same name, it will unconditionally fail on compilation *
რილია 2024-01-11 13:08:14Z
how old are you ?
Avatar
რილია 2024-01-11 13:10:10Z
I am 23 and don't know shit
Avatar
Avatar
Devinci
like 2 file including eachother endlessly (edited)
That's not possible anyways
13:10
and wouldn't make any sense
Avatar
Avatar
fokkonaut
That's not possible anyways
wdym
Avatar
two files can't include each other
Avatar
it wouldn't make sense no
Avatar
header guard is exactly what ewan said it is for
Avatar
რილია 2024-01-11 13:11:54Z
header guard is a pretty cool name
Avatar
he protects ur header
13:12
tho i'd recommend using #pragma once
13:12
brevity
13:12
does the same exact thing
Avatar
Avatar
chillerdragon
Did you ever configure your email client to do such things? Is it easy? I couldn’t even think of a regex without false positives. And i somehow doubt gmail supports regex at all
yes, I did, chillerdragon. it's very easy ^^
13:13
chillerdrgon
13:13
I'm using thunderbird
Avatar
Avatar
heinrich5991
chillerdrgon
drunk?
13:13
vhillerrdragon
Avatar
Avatar
fokkonaut
two files can't include each other
13:15
Avatar
thunderbird rocks
13:15
Avatar
improper syntax
Avatar
if that isn't recursive calling idk how to call it
Avatar
#define B 1
🤓 1
Avatar
That wasn't the point
13:15
look at the logs
Avatar
and then once you get an actual valid definition
13:15
then it will fail to compile the second time
Avatar
again, it's not the point
Avatar
it literally is
13:16
My point was recursive calling being an issue
13:16
and you told me that wasn't possible
13:16
well. it is
Avatar
?????
Avatar
but yeah I forgor how c macros were 💀
Avatar
this isn't doing anything
13:17
it's just erroring
Avatar
It's not possible for two headers to include each other
13:17
that's my whole statement
Avatar
Avatar
Ewan
#define B 1
Avatar
Avatar
fokkonaut
It's not possible for two headers to include each other
it is and it's an issue xD
Avatar
Issue = not possible
13:18
it doesnt make any sense
13:18
please
13:18
read the wohle chat
Avatar
no u
Avatar
Avatar
Ewan
that’s the only issue
.
Avatar
Avatar
Learath2
I wonder if people still care
there's a PR by c0d3d3v that does this, but it also starts laying out the hud pngs differently for some reason: https://github.com/ddnet/ddnet/pull/6724
Hello everyone, I hope you are all doing well. Main goal for this PR is to add an option to restore countdowns using stars for Unfreeze time and Ninja time. Doing this I also updated the HUD and OP...
Avatar
@Devinci yes, it does "prevent" recursive includes, but the point is you don't want that behaviour anyways because you can't include two files into each other
Avatar
Anyways I already wasted enough time on this
Avatar
True, you did
13:19
Good soup
Avatar
Avatar
fokkonaut
@Devinci yes, it does "prevent" recursive includes, but the point is you don't want that behaviour anyways because you can't include two files into each other
I literally said it as an issue... and a use of header guards... idk why I m getting so much shit for it
13:20
mb I guess
Avatar
Because it's not what it's used for
Avatar
Avatar
Ewan
once it attempts to define symbol when there is already one of the same name, it will unconditionally fail on compilation *
in headers, you usually only forward-declare. duplicate typedefs and duplicate function forward declarations are fine IIRC, but not duplicate classes/structs?
Avatar
because you don't do that anyways
Avatar
Avatar
heinrich5991
in headers, you usually only forward-declare. duplicate typedefs and duplicate function forward declarations are fine IIRC, but not duplicate classes/structs?
i forgot to expand on my *
13:21
but yes
13:21
that
Avatar
@Devinci the header guard is to make sure each header is only included once
Avatar
Avatar
fokkonaut
because you don't do that anyways
You could want to do it if you have class A that needs Class B and vice-versa.
Avatar
Avatar
Devinci
Anyways I already wasted enough time on this
greenthing
😆 1
Avatar
Avatar
fokkonaut
@Devinci the header guard is to make sure each header is only included once
yy ofc
Avatar
Avatar
Devinci
You could want to do it if you have class A that needs Class B and vice-versa.
No
13:23
Please stop dreaming up the least likely situations
Avatar
that's not possible, in that case you would simply declare the one class in the other header as following: class CCharacter; That way the compiler can resolve that
13:23
But you can't include it
Avatar
Technically it is if only one header forward declares
Avatar
Avatar
heinrich5991
there's a PR by c0d3d3v that does this, but it also starts laying out the hud pngs differently for some reason: https://github.com/ddnet/ddnet/pull/6724
Mh, should I provide a version that doesn’t touch assets and only does the stars thing?
Avatar
But you will never do this
Avatar
@Ewan we successfully finished step #1 of annoying chillerdragon when he will come back in 17 hours
Avatar
Avatar
Learath2
Mh, should I provide a version that doesn’t touch assets and only does the stars thing?
that would be much appreciated. reorganizing the assets seems like a thing we don't have the energy for
Avatar
@heinrich5991 also, do you perhaps have a windows computer you can test the curl-multi patch on? I’m about to push the finished version but can’t test it due to no computer juice
Avatar
perhaps you could even extract it from the PR, not sure
Avatar
Avatar
Learath2
@heinrich5991 also, do you perhaps have a windows computer you can test the curl-multi patch on? I’m about to push the finished version but can’t test it due to no computer juice
computer juice = battery?
13:25
I could go home and test it there
Avatar
computer is getting cranky. he needs his juice
13:25
i need my juice
13:25
and some sleep
13:26
i stayed up till 6:30 feelsbadman
Avatar
The only computer capable of running windows in this house does not have a disk 😄
Avatar
@Devinci just fyi we (at least i) werent hating on you
Avatar
ah. I can test it this evening, yes
Avatar
Avatar
Learath2
The only computer capable of running windows in this house does not have a disk 😄
wdym
Avatar
Avatar
fokkonaut
@Devinci just fyi we (at least i) werent hating on you
cap
Avatar
i can test now lerato but i would need a memo
Avatar
Avatar
Ewan
wdym
No hdd
Avatar
how are the other ones incapable is more what i was after
13:28
arm or something?
Avatar
The macbook I’m using does not have any more space for a windows installation. The only other laptop in the house has a broken screen
Avatar
@Learath2 it seems it might actually just be the first two commits of said PR? ^^
Avatar
რილია 2024-01-11 13:46:45Z
if i make a char abuff[2][100]; isn't abuff is a pointer to a pointer ? (edited)
Avatar
no
13:46
arrays aren't pointers
Avatar
რილია 2024-01-11 13:47:16Z
but when you make abuff[100] abuff is a pointer
Avatar
no
13:47
that's incorrect
Avatar
რილია 2024-01-11 13:47:36Z
sryy
13:47
char
Avatar
C just allows you to use abuff the same way as (&abuff[0])
Avatar
რილია 2024-01-11 13:47:43Z
i forgot the char 😄
13:47
char abuff[100]
Avatar
this is just some C weirdness
13:48
but abuff absolutely isn't a pointer
13:48
(it's called array/pointer decay, I think)
Avatar
Avatar
რილია
if i make a char abuff[2][100]; isn't abuff is a pointer to a pointer ? (edited)
რილია 2024-01-11 13:48:53Z
i fixed it
Avatar
no, it's an array of arrays
13:50
you should get rid of the "an array is a pointer" intuition
👍 1
13:51
it's wrong
13:51
if you declare an array, you don't have a pointer any more than when you declare a normal variable
13:51
int a; int b[2];
Avatar
რილია 2024-01-11 13:52:00Z
it's the new standard thing or i was wrong at the beginning ?
Avatar
this confusion is mostly due to the thinking that char * and char[] are interchangeable but you definitely should not think about them the same way
13:52
most beginners guides will refer to the two in mostly the same way, as a “string”
Avatar
Avatar
რილია
it's the new standard thing or i was wrong at the beginning ?
that's not a new standard, this has been the case since the very first standard in 1989
Avatar
but one is a pointer and one is an array and this should not be forgotten no matter what you are doing! (edited)
Avatar
რილია 2024-01-11 13:52:47Z
justatest
Avatar
you can get in lots of trouble mixing them up
Avatar
you get the pointer to a by writing &a. you can get a pointer to the first element of b by writing b or by writing (&b[0])
13:53
that you can also write b instead of (&b[0]) mostly makes it harder for beginners
Avatar
რილია 2024-01-11 13:56:45Z
you have char[10] char == pointer to it's first element (&char[0]) right ?
Avatar
yes, when you write the array name char (bad example, it's a reserved keyword), then the C compiler turns it into &char[0] (edited)
Avatar
რილია 2024-01-11 13:57:38Z
i have been wrong my whole life
Avatar
Avatar
heinrich5991
yes, when you write the array name char (bad example, it's a reserved keyword), then the C compiler turns it into &char[0] (edited)
რილია 2024-01-11 14:00:12Z
give you the address of it's last element ?
14:00
or did you meant &char[0}
Avatar
Avatar
რილია
or did you meant &char[0}
yes, my mistake
Avatar
რილია 2024-01-11 14:04:45Z
char abuff[2][100]; so this is a pointer to a pointer abuff ? which is gonna be &abuff[0][0] ? (edited)
14:06
or && double reference 😂
14:06
i think I'm wrong
14:08
&abuff[0]
14:10
the problem started from this char **SkyB::GetUserDirPath() { IStorage *storage; char abuff[2][100]; storage->GetCompletePath(IStorage::TYPE_SAVE, abuff[0], abuff[1], 100); return abuff; }
14:10
this is wrong
Avatar
char abuff[2][100] is a 2d array of characters
14:11
an array holding 2 arrays of 100 in this case
14:11
there are no implied pointers in the definition of this 2d array alone
Avatar
Avatar
რილია
the problem started from this char **SkyB::GetUserDirPath() { IStorage *storage; char abuff[2][100]; storage->GetCompletePath(IStorage::TYPE_SAVE, abuff[0], abuff[1], 100); return abuff; }
if you only need the path, do aBuff[100] and provide it with a literal input
Avatar
რილია 2024-01-11 14:15:19Z
if i have char abuff[10][10][10][100]; they are all pointers except the last 100 chars, am i right ?
Avatar
I suppose, In the same way that abuff[10] is a pointer
Avatar
რილია 2024-01-11 14:16:04Z
100 * all the pointers that you created
14:18
and abuff is only a pointer to 10 another pointers ?
Avatar
this isn’t really how i’d think about it
Avatar
Avatar
რილია
if i have char abuff[10][10][10][100]; they are all pointers except the last 100 chars, am i right ?
you are allocating 100,000 bytes
14:20
you can take pointers to these elements but since the only named variable here is the array itself, the only pointer you can get from it via shorthand without using the reference operator is abuff itself
14:21
it is not to say that abuff in itself is a pointer, because it is an array but using abuff in any manner which requires a pointer will work because it’s shorthand for &abuff[0]
Avatar
რილია 2024-01-11 14:30:22Z
how can i return a two dimension char ?
Avatar
Avatar
რილია
if i have char abuff[10][10][10][100]; they are all pointers except the last 100 chars, am i right ?
There are literally no pointers declared here
Avatar
Avatar
Ewan
if you only need the path, do aBuff[100] and provide it with a literal input
რილია 2024-01-11 14:34:11Z
no, i need both
Avatar
Avatar
Learath2
There are literally no pointers declared here
რილია 2024-01-11 14:35:14Z
don't we have 10 * 10 * 10 pointers there ? (edited)
14:35
The label abuff, in some situations "decay"s to a poinger to the first element because it's an array
Avatar
რილია 2024-01-11 14:36:37Z
wdym
Avatar
It's a special situation when abuff is used in some expressions. In those situations the array "turns into" a pointer to it's first element
14:38
There are no pointers declared by char abuff[10][10]. You declared 10 arrays of arrays of 10 characters
Avatar
consider a function which takes a char * and you have a char[]. basically every str_ function in ddnet, right?
Avatar
Yet when you pass abuff into a function for example, it will "decay"/"turn into" a pointer to it's first element
Avatar
რილია 2024-01-11 14:41:10Z
i don't get this, how they are not pointers, you say they are all char's ?
14:41
they must be array of 10 pointer's which they each gonna point to another array of 10 pointers
Avatar
Avatar
რილია
they must be array of 10 pointer's which they each gonna point to another array of 10 pointers
რილია 2024-01-11 14:42:39Z
anything except this is not making sense
Avatar
you are basically doing abuff[100000] and all of the extra [] are just doing a bit of handy math to put you at the right index
14:44
and in some situations abuff is contextually equivalent to &abuff[0] (edited)
14:44
that’s all
Avatar
Avatar
Ewan
you are basically doing abuff[100000] and all of the extra [] are just doing a bit of handy math to put you at the right index
რილია 2024-01-11 14:46:30Z
and what type they storing ? a char ?
14:46
doesn’t really matter the type
Avatar
რილია 2024-01-11 14:47:59Z
let me go to the c++ community, i can't sleep tonight
Avatar
Avatar
რილია
how can i return a two dimension char ?
probably don’t
14:51
return char * and know what it really is on the receiving end or create a custom type
14:51
but it’s a little unusual
14:52
i also think you’re misunderstanding IStorage::GetCompletePath
f3 1
14:53
the first string, pDir is the path name to get (e.g. “skins”) and the second, pBuffer is the output buffer to plop the complete path into (e.g. C:\Users\ewan\AppData\Roaming\DDNet\skins)
14:54
trivial functions and stuff in the libc will specify input/output by name but you can usually tell by whether or not the argument is marked as const
14:54
const char * has to be input
14:54
char * is usually output unless the author forgot to make it const which happens sometimes
Avatar
რილია 2024-01-11 14:58:24Z
i can't stand this, i was wrong so many years
Avatar
it’s alright
14:59
when you are new to programming you constantly look back and see how bad your code was just a short time ago
14:59
it just means you’re learning
Avatar
Avatar
Ewan
it just means you’re learning
რილია 2024-01-11 14:59:42Z
yes
Avatar
this is good
14:59
learning W
Avatar
Avatar
Ewan
i also think you’re misunderstanding IStorage::GetCompletePath
რილია 2024-01-11 15:04:23Z
but i can't access it directly error: cannot call member function 'virtual void IStorage::GetCompletePath(int, const char*, char*, unsigned int)' witho ut object
15:04
still call it with your IStorage * instance
15:04
just use the arguments correctly
15:04
it is not static
Avatar
Avatar
Ewan
it is not static
რილია 2024-01-11 15:05:35Z
if it was static i could call it directly without object ?
Avatar
რილია 2024-01-11 15:05:45Z
wow
Avatar
but it can’t access any members or non static methods
15:06
it’s basically a normal function
Avatar
რილია 2024-01-11 15:06:26Z
thank you man
Avatar
რილია 2024-01-11 15:06:50Z
today i did not cod that much but i leaned a lot
15:07
poggers2
15:07
learning is awesome
Avatar
რილია 2024-01-11 15:19:46Z
why you can't get screenshots with windows tools on ddnet ?
Avatar
რილია 2024-01-11 15:20:17Z
i remember it wasn't the problem before
Avatar
if you’re in fullscreen then you have to tab in or do it twice
15:21
since its a fullscreen window it doesn’t interact with dwm/the shell at all except for the thumbnail
15:21
and since the screenshot apis work through dwm it can’t do it properly
15:21
i assume it asks for the thumbnail but not before already taking the screenshot
15:22
u can look it up in feedback hub there’s probably something about it there
Avatar
რილია 2024-01-11 15:22:40Z
it's strange, now i can screenshots
Avatar
you can use desktop fullscreen and it’ll be mostly the same minus a few extra steps for inputs to get to the game & frames to get to the screen
15:22
but this time is probably less than a frame anyway
15:23
but screenshots should work
15:25
i have to sleep
Avatar
Avatar
Ewan
i have to sleep
რილია 2024-01-11 15:25:20Z
gn
15:27
but screenshots with shareX is weird,
Avatar
It's been 7 hours and packages are still emerging 😬
Avatar
რილია 2024-01-11 17:23:15Z
the compiler gives me this CMakeFiles/game-server.dir/src/game/server/ddracechat.cpp.obj:ddracechat.cpp:(.bss+0x0): multiple d efinition of `SkyB::myint it's not just ddracechat.cpp, it's on everywhere i included my header (values.h) and this i my header: #ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H //I put all of my values and functions here namespace SkyB { static constexpr unsigned int MAXIMUM_USERNAME_LENGTH = 120; static constexpr unsigned int MAXIMUM_PASSWORD_LENGTH = 120; static constexpr unsigned int MINIMUM_USERNAME_LENGTH = 6; static constexpr unsigned int MINIMUM_PASSWORD_LENGTH = 6; int myint; bool IsStandardString(const char *pStr); char *GetUserDirPath(); } #endif //SKYBLOCK_VALUES_H if i remove int myint; it's working again just fine, i don't know why this happening
Avatar
ddnet
17:25
ddnet
17:25
ddnet
17:25
ddnet
17:25
ddnet
17:25
HI
Avatar
რილია 2024-01-11 17:25:35Z
what is happening ? 🙂
Avatar
i felt it
Avatar
რილია 2024-01-11 17:26:00Z
i tried #pragma once
17:26
no luck
Avatar
Avatar
რილია
the compiler gives me this CMakeFiles/game-server.dir/src/game/server/ddracechat.cpp.obj:ddracechat.cpp:(.bss+0x0): multiple d efinition of `SkyB::myint it's not just ddracechat.cpp, it's on everywhere i included my header (values.h) and this i my header: #ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H //I put all of my values and functions here namespace SkyB { static constexpr unsigned int MAXIMUM_USERNAME_LENGTH = 120; static constexpr unsigned int MAXIMUM_PASSWORD_LENGTH = 120; static constexpr unsigned int MINIMUM_USERNAME_LENGTH = 6; static constexpr unsigned int MINIMUM_PASSWORD_LENGTH = 6; int myint; bool IsStandardString(const char *pStr); char *GetUserDirPath(); } #endif //SKYBLOCK_VALUES_H if i remove int myint; it's working again just fine, i don't know why this happening
is this 100% the whole file?
Avatar
Avatar
Jupstar ✪
is this 100% the whole file?
რილია 2024-01-11 17:27:43Z
yes and there is another file: values.cpp
Avatar
why do you use namespace
17:28
but then non static variables
17:28
maybe u meant extern int?
17:28
bcs what you do there makes no sense in my brain
Avatar
Avatar
Jupstar ✪
why do you use namespace
რილია 2024-01-11 17:29:30Z
it's more organised in my opinion
Avatar
i am surprised cpp even allows this
17:29
i cannot imagine any case where this ever makes sense
17:30
well ok
17:30
cpp doesnt know about headers
17:30
so it's basically just a global variable
Avatar
Avatar
რილია
the compiler gives me this CMakeFiles/game-server.dir/src/game/server/ddracechat.cpp.obj:ddracechat.cpp:(.bss+0x0): multiple d efinition of `SkyB::myint it's not just ddracechat.cpp, it's on everywhere i included my header (values.h) and this i my header: #ifndef SKYBLOCK_VALUES_H #define SKYBLOCK_VALUES_H //I put all of my values and functions here namespace SkyB { static constexpr unsigned int MAXIMUM_USERNAME_LENGTH = 120; static constexpr unsigned int MAXIMUM_PASSWORD_LENGTH = 120; static constexpr unsigned int MINIMUM_USERNAME_LENGTH = 6; static constexpr unsigned int MINIMUM_PASSWORD_LENGTH = 6; int myint; bool IsStandardString(const char *pStr); char *GetUserDirPath(); } #endif //SKYBLOCK_VALUES_H if i remove int myint; it's working again just fine, i don't know why this happening
use extern int
17:30
then it works
17:30
define the int then in ANY cpp file
Avatar
რილია 2024-01-11 17:31:45Z
actually this is the first time i using namespace in my life
Avatar
u can do the exact same using a class
17:32
just add public
17:32
classes kind of are name spaces too xd
17:33
but inside a class u'd need a static function
17:33
then it's a class function that works without a object
Avatar
Avatar
რილია
it's more organised in my opinion
You can just create component system like in client, but in server, and create class like CAuth. Or create class CSkyB, add hooks for main game events, add m_SkyB in CGameContext and call hooks from CSkyB
🙏 1
Avatar
@რილია #1 never use global variables #2 don't listen to ppl with dark green name tags that say otherwise #3 don't use globals
Avatar
global variables are the origin of all evilness
Avatar
Avatar
Jupstar ✪
global variables are the origin of all evilness
რილია 2024-01-11 17:36:30Z
why did you mentioned ddnet 5 times ?
Avatar
do you know the famous quote from Einstein? "Don't use global variables, bro, trust me"
Avatar
Avatar
Jupstar ✪
do you know the famous quote from Einstein? "Don't use global variables, bro, trust me"
რილია 2024-01-11 17:36:58Z
oh yes
Avatar
Avatar
რილია
why did you mentioned ddnet 5 times ?
i dunno. that was my entry song for today
Avatar
რილია 2024-01-11 17:37:29Z
i see it from another Einstein tho
Avatar
I am twostone and jao is too stoned
Avatar
რილია 2024-01-11 17:42:19Z
but why it's not allowing me to do it, it's in a namespace
Avatar
Avatar
რილია
but why it's not allowing me to do it, it's in a namespace
bcs that's not how it works
17:44
for ever global variable, it will create a symbol and if u do that in a header without extern, it will create many global variables
17:44
and then it cannot say which one you meant
17:45
imagine header includes literally as text replacements
17:45
and then imagine all cpp files that include this header have this global variable
❤️ 1
17:45
when linking u have the same global var many times
17:46
i can't explain it better
17:46
ask chatgpt 😏
Avatar
Avatar
Jupstar ✪
and then imagine all cpp files that include this header have this global variable
რილია 2024-01-11 17:46:21Z
i get it now
Avatar
the image i used for my passwords database just got deleted after being on the same place in internet for focking 3 years
18:26
pepeW
Avatar
post it here
Avatar
no nsfw here 😬
Avatar
and it will get compressed by discord anyways
Avatar
Does anyone know how those player information of 0.7 Teeworlds servers are done by the ddnet master server?
21:16
it seems like spectating players are shown as is_player=true while ingame players are shown as is_player=false
21:16
on 0.7
21:16
shouldn't it be the other way around?
Avatar
Consistently use std::numeric_limits instead of INT_MIN and INT_MAX.

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 (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+...
22:33
5e510cd Include limits instead of climits - Robyt3 32e585b Merge pull request #7787 from Robyt3/Include-Climits-Cleanup - Chairn
Avatar
Avatar
MilkeeyCat
no nsfw here 😬
justatest
Exported 661 message(s)