bool
return value with assertion to ensure the address has a valid type instead of outputting unknown type
as the address.
Also test the assertion failure by changing the existing test case to death tests. See https://google.github.io/googletest/advanced.html#death-tests for details. The death test names must end with DeathTest
so GoogleTest runs these test cases before all other tests.
Fix assertion failure in client due to previous server address being inva... pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "ddnet", aBuf);
https://github.com/ddnet/ddnet/blob/b917b410ddc548d4d2817e136cb0a68a7847e30b/src/engine/console.h#L24-L262025-01-18 19:02:58 I register/6/ipv4: registering...
2025-01-18 19:02:58 E register/6/ipv4: ERROR: the master server reports that clients can not connect to this server.
2025-01-18 19:02:58 E register/6/ipv4: ERROR: configure your firewall/nat to let through udp on port 8303.
root@ddnet-sv:~/ddnet-rs# cargo run --release -p editor-server -- ~/.config/ddnet-editor-server/testouly.twmap mapouly 8303
warning: /root/ddnet-rs/Cargo.toml: file `/root/ddnet-rs/src/lib.rs` found to be present in multiple build targets:
* `lib` target `ddnet_rs`
* `bin` target `ddnet-rs`
Finished `release` profile [optimized] target(s) in 0.93s
Running `target/release/editor-server /root/.config/ddnet-editor-server/testouly.twmap mapouly 8303`
[2025-01-18T18:39:30Z INFO fs] Found config dir in "/root/.config/ddnet-editor-server"
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
[2025-01-18T18:39:30Z INFO editor_server] Cert hash: e5693ee06f02d365cdd38bac70b003a8166f7f5e89f61a0489ccf187fdde0bb4
root@ddnet-sv:~/ddnet-rs# cargo run --release -p editor-server -- ~/.config/ddnet-editor-server/testouly.twmap mapouly 8303
warning: /root/ddnet-rs/Cargo.toml: file `/root/ddnet-rs/src/lib.rs` found to be present in multiple build targets:
* `lib` target `ddnet_rs`
* `bin` target `ddnet-rs`
Finished `release` profile [optimized] target(s) in 0.93s
Running `target/release/editor-server /root/.config/ddnet-editor-server/testouly.twmap mapouly 8303`
[2025-01-18T18:39:30Z INFO fs] Found config dir in "/root/.config/ddnet-editor-server"
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
[2025-01-18T18:39:30Z INFO editor_server] Cert hash: e5693ee06f02d365cdd38bac70b003a8166f7f5e89f61a0489ccf187fdde0bb4
root@ddnet-sv:~/ddnet-rs# cargo run --release -p editor-server -- ~/.config/ddnet-editor-server/testouly.twmap mapouly 8303
warning: /root/ddnet-rs/Cargo.toml: file `/root/ddnet-rs/src/lib.rs` found to be present in multiple build targets:
* `lib` target `ddnet_rs`
* `bin` target `ddnet-rs`
Finished `release` profile [optimized] target(s) in 0.93s
Running `target/release/editor-server /root/.config/ddnet-editor-server/testouly.twmap mapouly 8303`
[2025-01-18T18:39:30Z INFO fs] Found config dir in "/root/.config/ddnet-editor-server"
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
[2025-01-18T18:39:30Z INFO editor_server] Cert hash: e5693ee06f02d365cdd38bac70b003a8166f7f5e89f61a0489ccf187fdde0bb4
tw
, somehow some DDNet servers have 0.7 addresses now?master1.teeworlds.com 51.161.153.103:8283
master2.teeworlds.com 51.89.37.201:8283
master3.teeworlds.com 161.35.22.91:8283
master4.teeworlds.com 49.12.97.180:8283
if(NOT(GTEST_FOUND) AND DOWNLOAD_GTEST)
in both CMakeLists.txt
files".*?screenshots.*?"
to find strings containing the name".*?screenshots.*?"
to find strings containing the name grep
or Sublime Textsrc
folder ideally""
are part of the regexclient.cpp
if anyone needs in the futureoff == 0
instead of src + off == 0
1:8303,2:8304,3....
+ 2
probably breaks if the switch number is greater than 9str_length(aBuf)
insteadstr_find
already returns a pointer to the match position anywayint Port = pPort ? atoi(pPort + 2) : 0;
I'd keep the existing + 2
since I don't know how it works and remove the redundant condition (edited)pPort
can still be nullptr
if the string doesn't begin with the prefixint Port = pPort && *(pPort + 2) != '\0' ? atoi(pPort + 2) : 0;
atoi("")
is UB or notint Port = pPort && *(pPort + 2) != '\0' ? atoi(pPort + 2) : 0;
1:8303,2:8304,3....
str_token_get
for this
const char *tok;
int port = 0, len = 0;
while((tok = str_token_get(tok, ",", &len)))
{
if(str_startswith(tok, aBuf)) {
port = atoi(tok + str_length(aBuf));
break;
}
}
str_token_get
for this
const char *tok;
int port = 0, len = 0;
while((tok = str_token_get(tok, ",", &len)))
{
if(str_startswith(tok, aBuf)) {
port = atoi(tok + str_length(aBuf));
break;
}
}
str_token_get
what a nasty way of tokenizing a stringstr_next_token
which copies it into a buffer like any sane tokenizercpp(1174): unknown NETADDR type 0
appears when joining dummy and then it crash, seems it happens due to #95482025-01-18 23:28:59 I vulkan_debug: validation error: Validation Error: [ VUID-vkDestroyDevice-device-00378 ] Object 0: handle = 0x555556efb2d0, type = VK_OBJECT_TYPE_DEVICE; Object 1: handle = 0x3e150000003e15, type = VK_OBJECT_TYPE_SWAPCHAIN_KHR; | MessageID = 0x71500fba | OBJ ERROR : For VkDevice 0x555556efb2d0[], VkSwapchainKHR 0x3e150000003e15[] has not been destroyed. The Vulkan spec states: All child objects created on device must have been destroyed prior to destroying device (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyDevice-device-00378)
2025-01-18 23:28:58 I vulkan_debug: Validation Warning: [ UNASSIGNED-BestPractices-Error-Result ] Object 0: handle = 0x555556796d10, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x5f379b89 | vkQueueSubmit(): Returned error VK_ERROR_DEVICE_LOST.
2025-01-18 23:28:58 I vulkan: device lost
2025-01-18 23:28:58 I vulkan: vulkan error: Submitting to graphics queue failed.: device lost
2025-01-18 23:28:58 I assert: /nobackup/srcs/ddnet/src/engine/client/backend_sdl.cpp(167): Graphics Assertion:
Submitting to graphics queue failed.
device lost
Submitting the render commands failed. Try to update your GPU drivers.