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-04-29 00:00:00Z and 2024-04-30 00:00:00Z
Avatar
Relevant upstream commit: https://github.com/teeworlds/teeworlds/commit/d2924b5ad6982945da5f2db299d964133a3e5e63 Closes https://github.com/ChillerDragon/ddnet/issues/7 The snap item obj_character contains a field called m_TriggeredEvents It is responsible for effects and sounds. Those flags are set in the gamecore. So if the servers gamecore ticks twice and resets the flags before a snap is sent t...
Avatar
ws-client BOT 2024-04-29 01:17:04Z
<ChillerDragon> In a few days we will probably reach issue/pr #8303 on the ddnet/ddnet repo poggers2
01:17
<ChillerDragon> @Tyrone you mean where to put what if statement in the code? there is highlight already
01:19
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
Will look at this in the morning thank you tho Mr dragon
Avatar
!image More of a missing feature than a bug maybe. I realized that while working on colored broadcast where I wanted to use the cursor to keep track of line offsets while doing multiple text containers for different colors. Slap this code in any OnRender() method to reproduce. ```C++ STextContainerIndex Line1, Line2; CTextCursor Cursor; TextRender()->SetCursor(&Cursor, 40.0f, 40.0f, 12.0f, TEX...
Avatar
Example rcon command: broadcast "aaaaaaa^123bbbbbbbbbbbb^321cccccccccccccccccc" ^123 and ^321 are the color codes that will not be included in the displayed text !ddnet_teeworlds_broadcast_color_codes See https://github.com/ddnet/ddnet/issues/4897

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possi...
Avatar
d2139e4 Use net_addr_str directly to format address including port - Robyt3 938d264 Fix wrong server address used in password popup when redirected - Robyt3 7e857ce Merge pull request #8280 from Robyt3/Client-Redirect-Password-Fix - def-
Avatar

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.com/ddnet/ddnet/#using-addresssan...
Avatar
morning
Avatar
Avatar
Ryozuki
morning
gm
Avatar
ws-client BOT 2024-04-29 11:39:42Z
<ChillerDragon> gn
Avatar
What function is called when a player hooks a player? Like OnCharacerDeath, but I couldn't find something similar to OnHook
Avatar
I don't think there is a hook for it since nothing acts on that information
Avatar
Are there other functions that are called along with the hook?
Avatar
I meant "hook" as in "hooking point". As in I don't think any function is called when you successfully attach your hook to another tee
13:28
But check gamecore to be sure
13:29
SetHookedPlayer is called. Maybe you can check that
❤️ 1
Avatar
Is there a way to do the ger10.ddnet.org whitelist handshake thing via bash terminal? Just pinging it is not enough
Avatar
curl <url> maybe
Avatar
hey, i was trying to make thingy which would parse numeric string and return little endian bytes from that string. here's what ive done #[derive(Debug)] struct IntRepr(Vec<u8>); impl IntRepr { pub fn new() -> Self { Self(Vec::new()) } fn div2(&self, num: &str) -> Option<(String, bool)> { let mut remainder = false; let result = num .chars() .map(|ch| { let mut new = ch as u8 - b'0'; if remainder { new += 10; } if new & 1 != 0 { remainder = true; } else { remainder = false; } new >>= 1; (new + b'0') as char }) .collect::<String>(); if result.len() > 0 { Some((result, remainder)) } else { None } } fn set_bit(&mut self, n: usize) { if let None = self.0.get(n / 8) { self.0.push(0); } self.0[n / 8] |= 1 << (n % 8); } pub fn from_str(s: &str) -> Self { let mut int_repr = IntRepr::new(); let mut result = s.to_string(); for i in 0.. { match int_repr.div2(&result) { Some((string, remainder)) => { result = string; if result.as_bytes()[0] == b'0' { result.remove(0); } if remainder { int_repr.set_bit(i); } } None => break, } } int_repr } pub fn bytes(&self) -> &[u8] { &self.0 } } fn main() { let int_repr = IntRepr::from_str("3000"); let bytes = int_repr.bytes(); let foo = [bytes[0], bytes[1]]; assert_eq!(u16::from_le_bytes(foo), 3000); } how bad is this? justatest (edited)
Avatar
Avatar
MilkeeyCat
hey, i was trying to make thingy which would parse numeric string and return little endian bytes from that string. here's what ive done #[derive(Debug)] struct IntRepr(Vec<u8>); impl IntRepr { pub fn new() -> Self { Self(Vec::new()) } fn div2(&self, num: &str) -> Option<(String, bool)> { let mut remainder = false; let result = num .chars() .map(|ch| { let mut new = ch as u8 - b'0'; if remainder { new += 10; } if new & 1 != 0 { remainder = true; } else { remainder = false; } new >>= 1; (new + b'0') as char }) .collect::<String>(); if result.len() > 0 { Some((result, remainder)) } else { None } } fn set_bit(&mut self, n: usize) { if let None = self.0.get(n / 8) { self.0.push(0); } self.0[n / 8] |= 1 << (n % 8); } pub fn from_str(s: &str) -> Self { let mut int_repr = IntRepr::new(); let mut result = s.to_string(); for i in 0.. { match int_repr.div2(&result) { Some((string, remainder)) => { result = string; if result.as_bytes()[0] == b'0' { result.remove(0); } if remainder { int_repr.set_bit(i); } } None => break, } } int_repr } pub fn bytes(&self) -> &[u8] { &self.0 } } fn main() { let int_repr = IntRepr::from_str("3000"); let bytes = int_repr.bytes(); let foo = [bytes[0], bytes[1]]; assert_eq!(u16::from_le_bytes(foo), 3000); } how bad is this? justatest (edited)
nice understanding of bit manipulation!
Avatar
foo
that's probably the only part I understand 🤔
(edited)
Avatar
Avatar
Sedonya
Are there other functions that are called along with the hook?
In F-DDrace there is
Avatar
Avatar
MilkeeyCat
hey, i was trying to make thingy which would parse numeric string and return little endian bytes from that string. here's what ive done #[derive(Debug)] struct IntRepr(Vec<u8>); impl IntRepr { pub fn new() -> Self { Self(Vec::new()) } fn div2(&self, num: &str) -> Option<(String, bool)> { let mut remainder = false; let result = num .chars() .map(|ch| { let mut new = ch as u8 - b'0'; if remainder { new += 10; } if new & 1 != 0 { remainder = true; } else { remainder = false; } new >>= 1; (new + b'0') as char }) .collect::<String>(); if result.len() > 0 { Some((result, remainder)) } else { None } } fn set_bit(&mut self, n: usize) { if let None = self.0.get(n / 8) { self.0.push(0); } self.0[n / 8] |= 1 << (n % 8); } pub fn from_str(s: &str) -> Self { let mut int_repr = IntRepr::new(); let mut result = s.to_string(); for i in 0.. { match int_repr.div2(&result) { Some((string, remainder)) => { result = string; if result.as_bytes()[0] == b'0' { result.remove(0); } if remainder { int_repr.set_bit(i); } } None => break, } } int_repr } pub fn bytes(&self) -> &[u8] { &self.0 } } fn main() { let int_repr = IntRepr::from_str("3000"); let bytes = int_repr.bytes(); let foo = [bytes[0], bytes[1]]; assert_eq!(u16::from_le_bytes(foo), 3000); } how bad is this? justatest (edited)
A character type.
16:06
looks rly hacky tho
Avatar
but it works 😏
Avatar
try to remove the allocations
16:07
maybe return a iterator
16:07
idk
16:07
to_string is a allocation
Avatar
it's a feature
Avatar
pub const fn to_digit(self, radix: u32) -> Option<u32> { // If not a digit, a number greater than radix will be created. let mut digit = (self as u32).wrapping_sub('0' as u32); if radix > 10 { assert!(radix <= 36, "to_digit: radix is too high (maximum 36)"); if digit < 10 { return Some(digit); } // Force the 6th bit to be set to ensure ascii is lower case. digit = (self as u32 | 0b10_0000).wrapping_sub('a' as u32).saturating_add(10); } // FIXME: once then_some is const fn, use it here if digit < radix { Some(digit) } else { None } }
Avatar
Why is this done here? It should be done at the network layer already, the network layer should not be reporting packets from addresses other than the server we connected to.
https://github.com/ddnet/ddnet/pull/8248#discussion_r1582984486 With "network layer" you mean checking this in CNetClient::Recv, @heinrich5991 ?
17:35
479d0ea Update Finnish language file - invalid-email-address 7f3543f Update Finnish language file - invalid-email-address c745964 Correct Finnish translations - invalid-email-address a9e75a9 Correct Finnish translations - invalid-email-address 4291073 Update data/languages/finnish.txt - def- 03a0071 Merge pull request #8269 from PotatoCreator/master - Robyt3
Avatar
Avatar
Peakies
justatest
justatest git hard fr
cry_kanna 1
Avatar
how many developeres are working on ddnet?
Exported 44 message(s)