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-06-16 00:00:00Z and 2021-06-17 00:00:00Z
Avatar
@Discord Mod
04:06
Scam
Avatar
No discord mods online unfortunately. I would do something about it but can't
Avatar
I pinged @mods and got a mean message by ddnet bot :(
Avatar
i have like 4 of these banned on my discord already
Avatar
mimimi if u ping mods again u will get muted
Avatar
some fishing site is getting popular lately maybe
04:09
Idk why those old tricks are getting popular again
04:09
people are more curious than ever before
04:09
xd
04:10
and there are no old people in here that would fall for this, he should email our parents lol
Avatar
So a friend of mine played with F-Client and got a bug where he only sees scoreboard but not his tee... Luckily, after 30 minutes of racing I could make him use DDNet client and continue via timeout protection. My guess is its due to a tunezone, but I am definitely not sure. Will ask which map it was later
Avatar
chillerdragon BOT 2021-06-16 06:55:09Z
How is the official Mac release built?
Avatar
with magic
Avatar
Could someone with access to the server on which the discord bot runs dump the layout of the postgresql database? If I understood correctly, I need the output of pg_dump --schema-only --create <database-name> -f <output-file> (doc of pg_dump: https://www.postgresql.org/docs/12/app-pgdump.html). Not completely sure if --create helps during the restoring process, but it sounds like it does
Avatar
If u are in editor and u alt-tab, when u come back, u will have no more mouse. U can leave the editor, enter server anything, u will never have your mouse back until u alt+f4. I think u can save with ctrl+s so u don't loose the map but if u are afk-mapping in a server bcs you wait your mate, u cant map anymore without leaving the server :/ Pls fix =-=
Avatar
actually i think i had this issue today
08:58
but it was the result of opening a new client
Avatar
the issue is "random"
09:00
as it relies on uninitialized values
Avatar
makes sense
Avatar
@heinrich5991 did u see the 1.53 rust prerelease? they add unicode identifiers, i think this means u can do this let 🤔 = func(); 🤔?
15:11
monkalaugh
15:12
i guess this is more useful for chinese japanese koreans coding in rust or smth tho
15:12
but it can be funny
15:13
This allows multilingual identifiers but still doesn't allow glyphs that are not considered characters such as ◆ or 🦀
15:13
oh rip
15:13
no fun rust
Avatar
why not
15:14
u can do it in js?
Avatar
probably
15:14
nope
15:15
u can't
Avatar
can u write chinese tho?
15:17
15:17
15:17
it doesn't make any sense
15:20
hmm. didn't know you can italic an emoji
Avatar
Avatar
Patiga
Could someone with access to the server on which the discord bot runs dump the layout of the postgresql database? If I understood correctly, I need the output of pg_dump --schema-only --create <database-name> -f <output-file> (doc of pg_dump: https://www.postgresql.org/docs/12/app-pgdump.html). Not completely sure if --create helps during the restoring process, but it sounds like it does
@jao could you help me out?
Avatar
Avatar
Patiga
Could someone with access to the server on which the discord bot runs dump the layout of the postgresql database? If I understood correctly, I need the output of pg_dump --schema-only --create <database-name> -f <output-file> (doc of pg_dump: https://www.postgresql.org/docs/12/app-pgdump.html). Not completely sure if --create helps during the restoring process, but it sounds like it does
@Patiga the codebase includes the schema
15:52
Contribute to ddnet/ddnet-discordbot development by creating an account on GitHub.
15:54
I have created the biggest abomination ever but I think it's good enough for now
Avatar
chillerdragon BOT 2021-06-16 15:56:48Z
1 : something regarded with disgust or hatred : something abominable
15:56
what did u do?
Avatar
I made the worlds ugliest discord bot
Avatar
chillerdragon BOT 2021-06-16 16:01:22Z
yea discord sounds pretty abominable :)
16:01
poor u
Avatar
You can now specify "or patterns" inside pattern matches. Previously you could only use | (OR) on complete patterns. E.g.
>
```rs let x = Some(2u8); // Before matches!(x, Some(1) | Some(2)); // Now matches!(x, Some(1 | 2)); ```
16:21
looks ambiguous with bitwise or 😦
Avatar
Avatar
heinrich5991
You can now specify "or patterns" inside pattern matches. Previously you could only use | (OR) on complete patterns. E.g.
>
```rs let x = Some(2u8); // Before matches!(x, Some(1) | Some(2)); // Now matches!(x, Some(1 | 2)); ```
i dont think u can do a bitwise or when pattern matching
16:28
nor 1+1
16:28
well idk
16:29
i doubt they havent considered this
Avatar
they surely have considered it
Avatar
im reading the RFC but its a bit verbose
Avatar
but they also allowed impl Trait in both argument and return position with different meaning
Avatar
https://github.com/Learath2/discordbot/commit/16061e046 this commit I'm only showing you because we are all friends here
Avatar
I also disliked that
Avatar
Avatar
Learath2
https://github.com/Learath2/discordbot/commit/16061e046 this commit I'm only showing you because we are all friends here
I don't think I've ever written something uglier in my life 😛
Avatar
Avatar
heinrich5991
but they also allowed impl Trait in both argument and return position with different meaning
wdym different meaning
Avatar
with polling too, absolutely eww
Avatar
impl Trait in argument position means "any object that implements Trait can be passed here" and impl Trait in return position means "only one concrete struct implementing Trait can be returned here"
Avatar
@Learath2 u decided to start learning rust by using async first monkaS
16:31
there is a major plan to improve it
16:31
i saw
Avatar
@Ryozuki well I didn't have any other project I need to do, anyway my ugly bot is more a result of my poor planning
16:32
The next iteration will use a broadcast channel instead of polling everywhere
Avatar
yeah i guess
Avatar
(fwiw async works fairly well, they just need to relax the constraints and add some convenience syntax for stuff like streams and clone/moving into async blocks)
Avatar
u have some kind of global lock?
16:34
i find it weird to use a lock around ()
16:34
usually u open the lock and get a ref to the inside and mutate it
16:34
but ur locking just for the sake of it?
Avatar
It's actually guarding a sqlite table
16:35
It's fairly meh, but it's not a resource that has a representation I can lock inside of rust
16:35
The next iteration will involve an abstraction around the concept of table to hold the lock
16:35
are u using sqlx to interact with sqlite right
Avatar
sqlx should hide everything
16:36
u dont need to lock
16:36
if u need to lock rust will let u know asking for sync and send
16:36
im confused here
Avatar
Ofc you need to lock, sqlx won't prevent a thread from writing to a table while another is reading it. And rustc will not even know the concept of a table to ask for a sync + send
Avatar
what are you trying to protect? you're doing an SELECT, then UPDATE that should be atomic together?
Avatar
Avatar
heinrich5991
what are you trying to protect? you're doing an SELECT, then UPDATE that should be atomic together?
One thread might be deleting while another is reading
Avatar
arent transactions made for that?
Avatar
that should be no problems as far as I'm aware about sqlite3
Avatar
but you might need more guarantees than sqlite3 provides
16:38
I'm trying to understand those
Avatar
I need the table to not change while the expiry thread is reading it, it can lead to issues if someone issues a manual expiry on the other thread
Avatar
why dont u put the RwLock around the SqlitePool then?
Avatar
Well that'd also synchronize all accesses to any table at all
16:41
The entire database doesn't need to be locked, just the table
Avatar
idk why i dont like this
16:42
xd
Avatar
It's the RwLock<()> had a chat about it for a while on the rust discord
Avatar
perhaps it could be achieved within sqlite3 transactions?
Avatar
it's just guarding a resource that has no representation inside the code, ideally sqlite would be the provider of this mechanism, but I didn't find one
Avatar
transactions
Avatar
Even if there is one I doubt sqlx implements it
Avatar
ah, the charm of orms?
16:43
u can do it
Avatar
I need to call, BEGIN EXCLUSIVE
Avatar
apparently a write transaction locks the DB
16:44
how does sqlx interact with SQLITE_BUSY?
Avatar
I honestly don't know and didn't want to dig anymore after I didn't find any mention of locks in sqlx
Avatar
ah
Avatar
fwiw I did find table locks in mysql, but didn't find a similar concept for sqlite3
16:47
Furthermore in the next iteration I'll probably avoid this issue by using a mpsc channel to a single actual task doing all the sql stuff
Avatar
yeah channels best
16:47
Tools for concurrent programming in Rust. Contribute to crossbeam-rs/crossbeam development by creating an account on GitHub.
16:47
i know u dislike libs but i like recommending them
16:48
😀
Avatar
or maybe on a day when I'm less sleep deprived I'll find a way to make the operations themselves safe even if the table state is changing underneath
Avatar
that would be the best
Avatar
Avatar
Ryozuki
i know u dislike libs but i like recommending them
Hm, doesn't seem to have a mpsc channel
Avatar
Mh, I guess they managed to create a mpmc channel that is optimized for mpsc too
Avatar
This crate is an alternative to std::sync::mpsc with more features and better performance.
16:50
they say this so
Avatar
mpsc from the standard library is unsound IIRC
Avatar
I was eyeing tokio::sync::mpsc
16:51
use tokio
Avatar
I'll take a look at crossbeam too when/if I give this another go
Avatar
crtossbeam is not async
Avatar
I've been silly, I really should have dropped this whole php backend shtick instead of messing around with this for so long
16:52
nice tut
Avatar
I should have just made the bot generate the bans file
Avatar
anyway, I've learned so much doing all this, even if it doesn't help me debug the issue it's trying to solve, I'm happy
Avatar
yeah thats nice
16:55
im excited for rocket.rs 0.5 launching this friday
16:55
@Learath2 u should try it when it launches
16:55
Rocket is a web framework for the Rust programming language that makes it simple to write fast web applications without sacrificing flexibility or type safety.
Avatar
@Ryozuki How is it supposed to be better than actix?
Avatar
@Learath2 read the getting started
17:00
i use actix a lot
17:00
and its fine
17:00
but i find the idea of rocket is way better
17:01
implementing a middleware in actix is rly bad, on rocket you implement a fairing or a guard and its easier to do so
17:01
rocket has builtin config management already too
17:01
it also wraps diesel which is sync in the async enviroment of rocket
17:02
look at it like this, actix is old and has some baggage and rocket is shiny and innovative
17:02
idk
17:02
just reading their guide makes me want to use it
17:02
xd
Avatar
new good?
Avatar
new as in using more rust features that make developing website easier
17:03
websites*
Avatar
actix has had some questionable use of unsafe
17:03
IIRC
Avatar
yeah that too
17:03
it had some drama in the past
17:03
but its fixed/getting fixed
17:03
since the original author is not here
17:04
who said "this commit is not creative" or something like that to a pr fixing a unsoundness issue
17:04
xd
18:57
weinzierl 2 hours ago [–]
>
Excerpt from the abstract:
>
"This paper presents the first publicly available cryptanalytic attacks on the GEA-1 and GEA-2 algorithms."
>
[..]
>
"This unusual pattern indicates that the weakness is intentionally hidden to limit the security level to 40 bit by design."
>
So in other words: GPRS was intentionally backdoored.
18:57
i think this stuff is used on 5G, dont quote me on that tho
Avatar
i think this stuff is used on 5G ©Ryozuki
Avatar
basically, they found a backdoor
18:58
used to spy on u
18:59
GPRS is the mobile data standard for GSM mobile phones. It's from the 2G era, and is old and slow. GEA-1 is an encryption algorithm used with GPRS.
Avatar
Avatar
Patiga
@jao could you help me out?
Contribute to ddnet/ddnet-discordbot development by creating an account on GitHub.
Avatar
Let me try asking here too but I doubt you'd have a better idea, @heinrich5991 &&|| @Ryozuki. I need one task to die later than the others, can you think of a way to wait on the other tasks?
20:33
I asked on the tokio discord and one of the core developers suggested the very meh hack of abusing a mpsc channel
Avatar
Microsoft Visual Studio generates a .lib before creating a .dll, therefore it needs those prefixes before each function, otherwise it wont work.

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 ...
Avatar
Is there any work with threads in teeworlds(ddnet) code? (edited)
Avatar
Avatar
Anime.pdf
Is there any work with threads in teeworlds(ddnet) code? (edited)
what is your bug?
22:57
std::thread should work just fine
Avatar
(or the more tee-ish engine jobs which should be used if possible)
Avatar
Avatar
Deleted User
std::thread should work just fine
Its not
Avatar
or thread_init_and_detach xD
Avatar
oh yeah we do have an abstraction around threads too
Avatar
I use std::thread t1(my void function) and it gives me error
Avatar
Since none of us here have telepathic abilities we can't really diagnose from just "error" 😄
Avatar
Avatar
Anime.pdf
I use std::thread t1(my void function) and it gives me error
u cannot just run a function from a class
22:59
u need to bind this then
23:00
or use a static function and call it from there
23:00
std::bind(&Class::Func, this)
23:00
should work
23:00
Thx
23:00
I will test it tmrw
Avatar
Avatar
Learath2
oh yeah we do have an abstraction around threads too
c++11 is nicer way imo xd
Avatar
I'd disagree since I'm a fan of using only one set of abstractions, but to each their own
Avatar
What do you think about how I solved #3917?
Avatar
Microsoft Visual Studio generates a .lib before creating a .dll, therefore it needs those prefixes before each function, otherwise it wont work. Checklist Tested the change ingame Provided scree...
Avatar
It works but im not sure if there is a better way
Avatar
I don't know of any, @heinrich5991 might
Avatar
Avatar
Learath2
I'd disagree since I'm a fan of using only one set of abstractions, but to each their own
but whats wrong with c++11 tho? its standard
23:06
ez to read for everyone
Avatar
I mean if you think thread_init is any harder to read there is nothing to discuss, but given they are equally readable we already use one in the codebase, no need to introduce another one
Avatar
yeah but that makes the code more complex
23:08
a name u need to know
23:08
if u a new contributor u would search for this function
Avatar
(fwiw I'd be okay if we replaced all uses of it, mine is just a consistency thing)
Avatar
a ok
Exported 222 message(s)