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 2021-09-09 00:00:00Z and 2021-09-10 00:00:00Z
Avatar
chillerdragon BOT 2021-09-09 07:12:08Z
DDraceNetwork, a cooperative racing mod of Teeworlds - ddnet/client.cpp at b216b6744ab2ad4aa2efa03f7b4385424f97f6d2 · ddnet/ddnet
07:12
that boi throws the remove error
07:12
So replays need to be on
Avatar
Avatar
chillerdragon
best games are ncurses
true
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
omaigat
07:31
can a docker container with a more modern kernel run on a older host kernel?
07:31
never rly went into this docker stuff
Avatar
docker containers doesn't have a kernel
07:47
the point of a container is to share the kernel with the host
07:52
ah understood the question now, should work fine
07:55
there might be some containers that wouldn't work properly on way older kernel versions such as cilium but in general should be fine, everything just depend on what u're doing on it (edited)
Avatar
7fd545a Update Dockerfile to debian11 - ChillerDragon f92fa2b Merge #4146 - bors[bot]
Avatar
ah ty chillerdragon. Looks harmless but would be nice if still be fixed
Avatar
chillerdragon: can you fix my heart.
Avatar
chillerdragon BOT 2021-09-09 10:39:48Z
huh?
Avatar
emm, nvm
Avatar
chillerdragon BOT 2021-09-09 10:40:11Z
wat u mean @TsFreddie
10:40
watfaka
10:40
@Deleted User: how to make nulled gfx backends with interfaces for headless client?
Avatar
overload igraphics_backend and the processors
Avatar
Avatar
chillerdragon
watfaka
Watafaka mazafaka
Avatar
chillerdragon BOT 2021-09-09 10:41:31Z
yea thats what i thought
10:41
im a bit stuck on the details
10:41
do we have a overload somewhere else in thew code that i can look at?
Avatar
quite alot yeah
10:42
pretty much every I class
Avatar
chillerdragon BOT 2021-09-09 10:42:26Z
xd
10:42
so graphics too?
Avatar
yes
Avatar
chillerdragon BOT 2021-09-09 10:43:40Z
class CGraphics_Threaded : public IEngineGraphics
10:43
like this?
10:43
wait thats basic inheritance
10:43
isnt it
Avatar
yes
Avatar
chillerdragon BOT 2021-09-09 10:45:40Z
class CGraphics_ThreadedNull : public IEngineGraphics { } class CGraphics_Threaded : public IEngineGraphics { enu
10:45
then add all methods with empty bodies?
Avatar
i'd also write a null processor
Avatar
chillerdragon BOT 2021-09-09 10:46:22Z
watafaka is dat
Avatar
e.g. textures are sent as pointers and deleted on the backend side
10:46
look into backend_opengl.h or backend_sdl.h
10:46
they should have all classes
Avatar
chillerdragon BOT 2021-09-09 10:47:25Z
i wanna start with one thing to understand the nulling concept
Avatar
yeah you just make empty bodies basically
Avatar
chillerdragon BOT 2021-09-09 10:48:41Z
#ifdef CONF_HEADLESS extern IEngineGraphics *CreateEngineGraphicsThreaded() { return new CGraphics_ThreadedNull(); } #else extern IEngineGraphics *CreateEngineGraphicsThreaded() { return new CGraphics_Threaded(); } #endif
10:48
and then this?
Avatar
yeah or conditionally compile with one .cpp file or the other
Avatar
chillerdragon BOT 2021-09-09 10:49:29Z
so you recommend a graphics_null.cpp
Avatar
i guess u dont want to add all this stuff into the existing files do you?
10:49
yes
Avatar
chillerdragon BOT 2021-09-09 10:49:42Z
oke
10:49
so we dupe most of the gfx files?
10:49
headers plus c++
10:50
ah wait
10:50
empty bodies are okay in headers i guess
Avatar
chillerdragon BOT 2021-09-09 11:12:14Z
no way lul that worked faster and better than expected
11:12
i only nulled CGraphics_Threaded and it compiles and launches in non graphical environment
11:25
This allows compiling the client without graphics backend and thus it can run also in a non graphical enviornment

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 existing maps
  • [ ...
Avatar
yes but remember the memory leaks
11:31
ah i see, you nulled that graphics 😄
11:31
not the backend
Avatar
chillerdragon BOT 2021-09-09 11:32:37Z
troll @TsFreddie
11:32
@Deleted User: ok i published a working example i did not understand what you mean by nullprocessor tho and why i need to null other classes too. Could you have a look at https://github.com/ddnet/ddnet/pull/4147 and check for flaws pls?
This allows compiling the client without graphics backend and thus it can run also in a non graphical enviornment Checklist Tested the change ingame Provided screenshots if it is a visual chang...
11:33
ye memory leaks
11:33
thats what i ask you to look at you know much more about the gfx code
Avatar
i assume it can just work like that
Avatar
chillerdragon BOT 2021-09-09 11:36:20Z
as far as i can see the graphics_threaded.cpp deletes memory that it also allocated there
11:36
so i hope no other class allocates memory and expects CGraphics_Threaded to delete it
11:36
yea it works suprsingly well
11:37
its so odd to have a terminal application with sounds :D
Avatar
yeah i assume it shouldn't do that, backend mostly deletes textues and some buffers
Avatar
chillerdragon BOT 2021-09-09 11:38:05Z
oh i get a few valgrind errors
11:38
lemme compare with headless off
Avatar
but since the class reports all Is*BufferingEnabled as false, it shouldnt even create those buffers, and textures seem to be alloced by that class
Avatar
chillerdragon BOT 2021-09-09 11:38:53Z
yea one has to fiddle around a bit wat returns false and what true
Avatar
btw you can remove all non override functions
Avatar
chillerdragon BOT 2021-09-09 11:39:28Z
i just fixed a bug in my strip_gfx.py script this morning that would false and 0 everything but then the components OnRender() wouldnt get called anymore
11:39
ah ye sounds good
11:40
oh okay so the valrgind warnings i see come from the headless :/
Avatar
show backtrace xxd
Avatar
chillerdragon BOT 2021-09-09 11:40:41Z
yea
11:41
==84133== at 0x1DDF7E: float maximum<float>(float, float) (math.h:103) ==84133== by 0x1E3CE5: CTextRender::TextEx(CTextCursor*, char const*, int) (text.cpp:1064) ==84133== by 0x1E28F7: CTextRender::Text(void*, float, float, float, char const*, float) (text.cpp:797) ==84133== by 0x303F3E: CUI::DoLabel(CUIRect const*, char const*, float, int, float, int) (ui.cpp:462) ==84133== by 0x2595C7: CMenus::RenderLoading() (menus.cpp:1141) ==84133== by 0x2C2DF1: CSoundLoading::Run() (sounds.cpp:32) ==84133== by 0x2C321A: CSounds::OnInit() (sounds.cpp:85) ==84133== by 0x2CEC57: CGameClient::OnInit() (gameclient.cpp:248) ==84133== by 0x17B04A: CClient::Run() (client.cpp:3115) ==84133== by 0x182310: main (client.cpp:4453)
11:42
pCursor->m_MaxCharacterHeight = maximum(pCursor->m_MaxCharacterHeight, CharHeight + BearingY);
Avatar
in maximum?
11:42
what even is the error?
11:42
maximum shouldnt allocate memory xD
Avatar
chillerdragon BOT 2021-09-09 11:42:53Z
thats odd huh
11:43
i assume its the line that calls maximum
11:43
maybe pCursor
11:44
CTextCursor Cursor; SetCursor(&Cursor, x, y, Size, TEXTFLAG_RENDER); Cursor.m_LineWidth = LineWidth; int OldRenderFlags = m_RenderFlags; if(LineWidth <= 0) SetRenderFlags(OldRenderFlags | ETextRenderFlags::TEXT_RENDER_FLAG_NO_FIRST_CHARACTER_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_LAST_CHARACTER_ADVANCE); TextEx(&Cursor, pText, -1);
11:44
ah btw valgrind says "Conditional jump or move depends on uninitialised value(s)"
Avatar
ah
Avatar
chillerdragon BOT 2021-09-09 11:44:38Z
yea i kinda swallowed that sry
11:44
but that looks initialized to me
Avatar
i'd make sure u have a fake screen GetScreen
11:45
MapScreen
11:45
ScreenWidth
Avatar
chillerdragon BOT 2021-09-09 11:46:14Z
ah ye
11:46
i wasnt sure about that
11:46
because then other code might do gfx stuff and allocate shit if it finds a screen
Avatar
i'd say if its null, we devide by null somewhere 😄
Avatar
chillerdragon BOT 2021-09-09 11:47:40Z
yas
Avatar
i doubt our impl is that safe, it just assumes a working screen
Avatar
chillerdragon BOT 2021-09-09 11:47:47Z
i had that issue in vanilla
11:50
wait uhm what exactly would u do?
Avatar
initialize m_screenwidth and desktop widht with like 800 and height with 600
11:50
and return something at getscreen
Avatar
chillerdragon BOT 2021-09-09 11:51:09Z
getscreen is a void
Avatar
it takes them as parameter
Avatar
chillerdragon BOT 2021-09-09 11:51:29Z
u mean fill the pointers given?
11:51
ya
Avatar
*pTopLeftX = 0; *pTopLeftY =0; *pBottomRightX = 800; *pBottomRightY = 600;
11:52
smth like this
Avatar
chillerdragon BOT 2021-09-09 11:52:08Z
i take that
11:52
4:3 ? :D
11:52
1920 1080 masterrace
Avatar
you can also just save what comes in mapscreen
11:52
bcs that's what the client calls anyway
Avatar
chillerdragon BOT 2021-09-09 11:53:36Z
valgrind warnings still there
11:53
i only added GetScreen tho
Avatar
and GetScreenWidht()?
Avatar
chillerdragon BOT 2021-09-09 11:54:25Z
thats a different class isnt it`?
Avatar
initialize everything from IGraphics
11:54
with valid stuff
11:54
thats the base class
11:54
int m_ScreenWidth; int m_ScreenHeight; int m_ScreenRefreshRate; float m_ScreenHiDPIScale;
Avatar
chillerdragon BOT 2021-09-09 12:01:27Z
wats high dpi scale
12:01
wats a sane headless value for that
12:02
yay the unconditional jump is gone
12:02
i can connect to servers without a single additional valgrind warning
12:02
poggers
12:02
definitely lost: 0 bytes in 0 blocks
12:02
indirectly lost: 0 bytes in 0 blocks
Avatar
1
12:04
except you want a headless hdpi client xd
Avatar
chillerdragon BOT 2021-09-09 12:04:23Z
yas!
12:04
i have big screen
12:04
big dpi
12:04
yaaaaa
12:04
xxxD
12:08
next step is a fully functional ncurses client :)
Avatar
@heinrich5991 I wanted to write a program using libtw2, noticed it’s teehistorian support doesn’t know about the server_version field of the header
15:51
I ended up having to just skip the magic and use serde_json to read the json. (Kinda annoying since serde_json will by default error on trailing bytes)
15:53
Still better than my earlier ugly solution of looking for }\x00 😛
Avatar
have any of you used NoSQL databases? I'm trying to think of good uses for it
16:47
i prefer structured data
16:47
i tried mongodb
16:47
imho postgres is rly good
16:47
it supports lot of stuff
Avatar
@Learath2 for teehistorian there is also the alternative parser from Zwelf, not sure how they compare https://gitlab.com/zwelf/teehistorian
Avatar
included json
Avatar
I prefer structured data aswell, which is why I never looked much into nosql stuff. It seems to be fairly popular amongst the web 69.420 crowd so I wanted to know if there were some good example uses for it
Avatar
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
16:50
it doesnt convince me
16:50
any of those arguments tho
16:51
kek
16:53
lmao
16:53
the internet is beautiful
16:54
xdd "mongo db is web scale"
16:54
this video is gold
16:54
actually educational too
Avatar
MongoDB seems like a very easy way to make a working-ish product extremely quick. The only benefit I see from it is the extreme scalability (which is due to having on ACID guarantees at all, how desirable that is is at best questionable)
Avatar
due to not*
16:55
u mean right?
Avatar
I meant s/on/no/
Avatar
listen to the video xd
Avatar
"Relational dbs don't scale"
16:59
This video is 10/10
17:00
its a series btw
17:00
xd
17:00
it gets even better at the end
Avatar
When is having a non-reliable database even desirable?
Avatar
when you hadn't structured your data xd
17:30
there are two way to use any nosql solution: you have no brain your deadline is really near or your project manager has no brain
Avatar
Actually now that I think about it when do you ever have data that's not at all relational in an application?
17:35
If the data has no relation to anything in your application, why are you storing it?
17:39
Ah, you know where it could be useful? Search engines, it could be more efficient to store text as a blob of non-structured data if you want to search through it and don't care at what point a match occurs
Avatar
when your service becomes really big, you have no other choice probably
18:06
even Discord uses Cassandra
Avatar
if u are that big maybe
18:09
but u probs wont ever need it
Avatar
luckily 😄
18:12
it's written in Java
justatest 2
Avatar
I don't see why you can't use a rdbms to store things like discord messages that are pretty structured, you can even tack on an elasticsearch index to get good searching on it
18:23
ah got it
18:23
maybe they don't want to migrate whole database or something
18:23
or just lazy
18:23
discord team is really lazy it seems
Avatar
Oh surely if you are going from mongodb to some other solution it makes sense to go for a document based one, much easier. I just don't see how it's beneficial to give up reliability in order to get scalability, when e.g. postgres can shard just fine and not give it up
18:25
so why would you ever go "oh mongodb is perfect for my application"?
Avatar
i don't think they decided to use mongo with such phrase
18:25
it was like "lol cool technology lets use it"
18:25
"anyway its small app that will die in near future"
18:26
who knows
Avatar
Avatar
Learath2
so why would you ever go "oh mongodb is perfect for my application"?
because mongodb made a rly strong marketing campaign
Avatar
actually we can ask same shit for electron
18:29
why discord team decided to use it - fast scalable cross-platform
18:30
why discord team decided to use mongodb - scalable as mongo said xd
Avatar
https://en.wikipedia.org/wiki/CAP_theorem hm, apparently if you don't give up consistency you can't have availability
In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency: Every read receives the most recent write or an error Availability: Every request...
18:31
Now is availability actually desirable? When is stale information acceptable?
Avatar
now that we talking about scalign and stuff
18:33
Handling millions of daily users efficiently and securely does not happen by chance, here's some what goes into it.
18:33
this is a rly good blog post
18:33
(tldr how to handle shitload of users with a low budget)
18:33
its interesting
Exported 214 message(s)