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-07-19 00:00:00Z and 2022-07-20 00:00:00Z
Avatar
Since we're doing a push to assist newer players, I think it would be a good idea to differentiate the different types of lasers, so that non-moving laser entities aren't confused with doors (I'm aware the blinking is a sign, but it's very subtle). This also includes a new color for Shotgun's laser, which would be a nice touch for both customization and clarity. !image ![image](https:...
Avatar
lol, nice github username
Avatar
i feel bad whenever i do an if else statement in code, because of how infamous it has become with bad programmers
Avatar
i dont know, i guess its just a self conscious thought that if i put an if else statement in a piece of code im going to be called yanderedev
01:43
(it works, i tested it)
Avatar
i don't know what's a yanderedev, but why would oyu be called names for using correct logic?
Avatar
Avatar
Voxel
i dont know, i guess its just a self conscious thought that if i put an if else statement in a piece of code im going to be called yanderedev
lol thats only if its if condition: do this else if condition2: do this else if condition3: . . . else if condition36: do this (edited)
Avatar
i guess im just nervous to finally be programming around people who've been doing it for a decade plus
Avatar
its ok most the devs are new too plus things get reviewed
01:51
@Voxel btw what is that conditional for?
01:51
shouldnt it be && or am i misunderstanding
Avatar
ah yup, that condition is always true ^^
Avatar
given the code shown here, i think a switch would be better
01:54
or not, some code path are completely exclusive
Avatar
thing is, if it was a switch there would be a lot more copied code
Avatar
but i think compiler would merge code path on itself
Avatar
im not sure about conventions but i think readability is prioritized
Avatar
i'll change it to switch
02:08
wait i dont think i did it right
02:08
How do I call over the enums properly?
Avatar
you need to use pointer to variable of type CLaserData, not the class directly
02:09
and for the enums, you probably need to include protocol.h
Avatar
what the
02:35
did the lasertype enum just delete itself?!
Avatar
probably not
Avatar
or maybe im just looking in the wrong place
02:36
@_@
Avatar
are you sure you included the correct files?
02:37
like you're trying to access a pointer to CNetObj_EntityEx without having the class definition
Avatar
there's an enum in network.py
Avatar
just the forward declaration
Avatar
The thing is it was just fine an hour ago, and now it doesn't even build corrently (edited)
02:49
i dont even know what happened-- what got deleted and undefined the whole load of lasertypes?
02:49
02:50
or maybe it was always like this,
Avatar
i dont get it.. it didnt have an issue last time i tested this
02:58
Avatar
sometimes visual studio will freak out and tell you that you have errors which don't exist and you need to restart it. but usually it will still build when that's the case
Avatar
did you include protocol.h?
03:10
you can also try to copy the include from items.cpp which seems to be working and then remove them one by one to find the one you need
Avatar
otherwise, you can save your work with git stash to go back to safe state
Avatar
Avatar
Chairn
did you include protocol.h?
yes
03:40
the enum's in the x64 release protocol.h
Avatar
i think im going to take a break from this for today
Avatar
Avatar
Voxel
Click to see attachment 🖼️
if you click yes it does run and everything acts natural, though it's confusing why none of the programs recognize the enum in program
Avatar
Avatar
Voxel
i dont get it.. it didnt have an issue last time i tested this
I have 2-3 incomplete gamemode with error like this, it can be bad generating, project include
Avatar
@Voxel 1st rule: dont look at all the errors visual studio give u xddd
Avatar
Avatar
Voxel
there's an enum in network.py
its a python file, it is to generate protocol.h for example.
Avatar
You can still not build? (edited)
Avatar
it says "build failed" but if i click yes, it works as intended
Avatar
I think it takes an old build, not the current one
Avatar
Can you show the errors?
Avatar
Avatar
Voxel
what the
the errors are all related to the enum (edited)
Avatar
Thats probably visual studio not recognizing it, because its in a generated file, that can happen sometimes. Look for other errors
06:26
Errors that are in files you modified and that include things you made
06:27
Solving 1-2 mostly solves the others, as they are just VS bugging out
Avatar
Avatar
Voxel
i dont get it.. it didnt have an issue last time i tested this
You see that here: It says they are not recognized, but they actually are, or once the build would be successful, they suddenly spawn in again
06:31
all 80 errors are in items.cpp
Avatar
Avatar
Voxel
all 80 errors are in items.cpp
Ok, stay in that file and try to build again
06:34
Then look at the errors again/look at the code you wrote
Avatar
okay, the build failed. i have 62 errors but i cant scroll through them because windows wont let me until i do something with the popup
Avatar
You cant click it?
06:36
Or click the top bar of it?
Avatar
Avatar
Voxel
Click to see attachment 🖼️
i cant click anything in the main vs page until i click one of these popup buttons LOL
Avatar
Yea thats to be expected
06:37
click no i think
Avatar
a lot of them are related to m_pClient or pCurrent
Avatar
Can you show some
Avatar
Okay thats the same thing, they are also generated to visual studio doesnt recognize them
06:45
Dont worry about those for now
Avatar
you might got a real bug beside all the "pointer to incomplete class" messages and thats why you cant build
Avatar
Yea, he does
06:46
Be he has to find it
06:46
Between all this garbage
06:46
:D
Avatar
ye, just take a look at your last changes xD
Avatar
It says that cuz it doesnt recognize the enum entry
06:48
Dont worry
Avatar
@fokkonaut do we still have to guaran'tee' seven support in new PR's?
Avatar
No, of course not
Avatar
thank good
Avatar
i'm still looking :(
Avatar
clientside changes are only for ddnet clients
06:48
or what do you mean?
06:48
Oh
06:49
Well, yes you have to guarantee it works and doesnt break
Avatar
i mean the whole ToSixup stuff
Avatar
Yea ofc
Avatar
people should know about ddnet by now and just download it
Avatar
all of the errors are just "this is imcomplete" or stuff like that
Avatar
Avatar
Voxel
all of the errors are just "this is imcomplete" or stuff like that
Can you try to click on "Project" -> Generate Cache
Avatar
praise teeworlds and everything but ddrace is the future (edited)
Avatar
Avatar
bluesky
praise teeworlds and everything but ddrace is the future (edited)
There is an issue on whether support for vanilla should be cancelled.
Avatar
Delete Cache and Reconfigure
06:51
Or just rebuild everything
Avatar
fucking kill me
lol 1
06:58
yep it works now
Avatar
Avatar
fokkonaut
There is an issue on whether support for vanilla should be cancelled.
can you link it please
Avatar
I dont have it
06:59
but u should be able to find it
07:00
@Voxel classic :D
Avatar
it was located in the switch case i just added too
Avatar
xddd
Avatar
[quakenet] ChillerDragon BOT 2022-07-19 08:07:25Z
@heinrich5991 any idea what this could be about? https://github.com/DDNetPP/DDNetPP/issues/346 it is probably a ddnet++ issue but i did not edit the http or job pool as far as i know
[2022-07-18 18:51:17][register/7/ipv4]: ERROR: the master server reports that clients can not connect to this server. [2022-07-18 18:51:17][register/7/ipv4]: ERROR: configure your firewall/nat to l...
Avatar
whats ddnet++ now
Avatar
it's a mod by chillerdragon
Avatar
what can it do
Avatar
[quakenet] ChillerDragon BOT 2022-07-19 08:18:51Z
crash
Avatar
A crash in a development version of flowtrackd (the daemon that powers our Advanced TCP Protection) highlighted the fact that libxdp (and specifically the AF_XDP part) was not Linux network namespace aware. This blogpost describes the debugging journey to find the bug, as well as a fix.
09:45
Rust ! And they talk about AF_XDP which is damn interesting type of socket
09:46
ow there's C too
Avatar
cloudflare's blogs are always hq
Avatar
how to make bind for dummy deep fly that can switch normal mode and dummy deep fly with only one button?
13:55
^ drag into %appdata%\teeworlds f1 -> exec deepfly_switch.txt (edited)
Avatar
[quakenet] ChillerDragon BOT 2022-07-19 13:56:39Z
asking for a friend
Avatar
@Ryozuki hello rustacean, can you briefly explain why this code wont work? 🥺👉👈 The error is log error[E0499]: cannot borrow s as mutable more than once at a time --> src/main.rs:7:18 | 4 | let s1 = &mut s; | ------ first mutable borrow occurs here ... 7 | let s2 = &mut s; | ^^^^^^ second mutable borrow occurs here ... 11 | println!("{} {}", s1, s1); | -- first borrow later used here For more information about this error, try rustc --explain E0499. But s2 goes out of the scope before i use s1, whats wrong?
Avatar
declare it afterwards
13:59
only one mutable reference may be live at the same time
Avatar
meh okay
Avatar
this e.g. ensures that in the presence of multiple threads, only one thread can have a mutable reference to data
Avatar
Also none of those references need to be mut to begin with, you aren't mutating through them :P
Avatar
Avatar
Learath2
Also none of those references need to be mut to begin with, you aren't mutating through them :P
That was just a test 😁
Avatar
if you give something more real-world-y, we might be able to suggest a replacement
Avatar
Sure, as soon as i would be doing something not ... test 🧐
14:06
But thanks
Avatar
@heinrich5991 did I ever ask you to take a look at @YADDB? I really want to get back to it but I'm still very undecided on the modules, feels way too static
14:08
I really wanted something like a central registery of commands instead of passing all messages to all modules, but asynchronous callbacks are so hard to work with
Avatar
you have not (that I remember)
14:08
link?
14:09
(also, I'm unexperienced with rust async stuff)
Avatar
Contribute to Learath2/discordbot development by creating an account on GitHub.
14:10
The configuration through environment variables isn't very pleasent either, I'll probably move to something like ini or json or toml
Avatar
Restart client, open any map and do a random shift-select. This will crash the 16.2.2 client everytime. If you select a tile with a different id beforehand it won't crash. Doesn't crash with 16.1.
Avatar
true i would only use env vars for secrets
14:21
i recommend this crate
14:21
i used it before
14:22
and imho toml is the most readable
14:22
and simple
14:22
ill look into ur bot
Avatar
@Learath2 would taking a closure returning a Box<Future> work for the command registry?
Avatar
Yeah, you need something along those lines like, been a while since I looked at it but this is about what I had for<'f> fn(&'f ctx, &'f msg, &'f args) -> Pin<Box<dyn Future<Output=CommandResult> + Send + 'f>>
Avatar
that sounds horribly long but about right 😮
Avatar
The problem was lifetimes, the context of the command needs to just outlast the callback, but I couldn’t for the life of me get it to take anything that’s not static lifetime
Avatar
and i thought people wanted more expressive/human language
14:26
that looks even worse than c++ template 😄
Avatar
(we don't do async stuff in c++ to be fair, no idea how that looks like)
Avatar
Avatar
Chairn
that looks even worse than c++ template 😄
This is an edge case where the rust syntax fails imo, in regular usage it’s much more pleasant than C++
Avatar
Avatar
heinrich5991
(we don't do async stuff in c++ to be fair, no idea how that looks like)
It looks much better since you don’t have to spend characters convincing the compiler. However the burden of making sure things live long enough is then upon the coder
Avatar
for<'a> can be read as "for all choices of 'a", and basically produces an infinite list of trait bounds that F must satisfy. Intense. There aren't many places outside of the Fn traits where we encounter HRTBs, and even for those we have a nice magic sugar for the common cases.
14:28
Avatar
Avatar
Learath2
I really wanted something like a central registery of commands instead of passing all messages to all modules, but asynchronous callbacks are so hard to work with
why not make a general command trait with an async function and each command is a struct that implements that trait and then u save it on a vector of those traits?
Avatar
I can give it a try, with async_trait I think I could make it work
Avatar
also if you wanna be database agnostic
14:34
🐚 An async & dynamic ORM for Rust. Contribute to SeaQL/sea-orm development by creating an account on GitHub.
14:34
its a orm tho
14:34
but yeah
14:34
its built on top of sqlx
14:35
🔱 A dynamic SQL query builder for MySQL, Postgres and SQLite - GitHub - SeaQL/sea-query: 🔱 A dynamic SQL query builder for MySQL, Postgres and SQLite
Avatar
Avatar
Ryozuki
why not make a general command trait with an async function and each command is a struct that implements that trait and then u save it on a vector of those traits?
i kind of did this pattern when making the paypal api, i made a endpoint trait https://github.com/edg-l/paypal-rs/blob/master/src/endpoint.rs and then the api endpoints are structs that implement it, this way it also gives the end user the ability to make endpoints that may not yet be implemented, and the api client can execute any struct that impls Endpoint https://github.com/edg-l/paypal-rs/blob/master/src/api/orders.rs
14:40
kinda proud of this xd
Avatar
Would especially be a great addition to trashmap, which is also used by KoG-mappers.
Avatar
Fixes #5641 server side only

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 (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+UBSan or valgrind's memcheck](https://github...
Avatar
Added translation for some untranslated strings. Fixed a translation mistake -> "Reconnecte dans %s is Reconnexion dans %s"

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 a...
Exported 186 message(s)