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-01-10 00:00:00Z and 2024-01-11 00:00:00Z
Avatar
რილია 2024-01-10 06:20:45Z
i think i am gonna face an issue
06:21
i implemented this void CGameContext::ConRegister(IConsole::IResult *pResult, void *pUserData)
06:21
and this function is static
06:22
isn't it gonna broke if many tees try to register ?
06:26
this function reads the whole .text file full of usernames and passwords and if that username or password is not existed, it appends the username and password to the file (edited)
06:27
what happens if the file gets to big ?
06:27
what if when reading the file, some tee tries to register ?
Avatar
Avatar
Scrumplex
True. Not sure. I think the definition is a bit fuzzy as it was mostly influenced by the GPL
See that's why copyright sucks. You waste so much time and still don't understand anything. Laws are still very subjective and it's interpretation can vary too much xd Your precious awesome short time
Avatar
Wednesday for opengl
Avatar
Avatar
რილია
what happens if the file gets to big ?
that might become a problem later
justatest 1
Avatar
Avatar
რილია
what if when reading the file, some tee tries to register ?
the calls happen after each other, not at the same time
👍 1
Avatar
Avatar
fokkonaut
that might become a problem later
რილია 2024-01-10 07:49:06Z
i implement the time of the creation and want to add last time used on every user data, so then later I'll be able to delete the unused ones (edited)
Avatar
Avatar
რილია
isn't it gonna broke if many tees try to register ?
no, it's just static because it's a callback. You have the userdata and other shit as arguments
Avatar
რილია 2024-01-10 07:56:01Z
in c++ strings are such a pain in the ass (edited)
07:56
std::string is worth shit
Avatar
Avatar
რილია
in c++ strings are such a pain in the ass (edited)
What exactly do you need
Avatar
use rust
Avatar
Avatar
Jupstar ✪
What exactly do you need
რილია 2024-01-10 08:07:37Z
look at this shit, i no longer know what am i doing std::string line; std::string username; std::string password; std::string money; std::ifstream ifile; ifile.open("build/BankAccounts.txt"); if(ifile.good()) { for(unsigned int LineNumber=0; std::getline(ifile, line); LineNumber++) { for(unsigned int CharNumber=0; CharNumber <= line.length(); CharNumber++) { if(Char == ' ') { char Char = line[CharNumber]; char buff[CharNumber]; line.copy(buff, CharNumber-1, 0); buff[CharNumber] = '\0'; username = buff; pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", username.c_str()); } } // pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", ); } }
08:08
copy is a string method, but you can't copy to an string with it, you need to make a char array like in c
08:09
what the fak is this ?
Avatar
is it fine ? char buff[CharNumber];
Avatar
Avatar
რილია
რილია 2024-01-10 08:10:53Z
wrong link, let me fix it
Avatar
Avatar
Vexar
is it fine ? char buff[CharNumber];
რილია 2024-01-10 08:11:48Z
of course not (edited)
Avatar
what you want exactly to do ?
Avatar
Avatar
Vexar
what you want exactly to do ?
რილია 2024-01-10 08:14:18Z
separate the username and password from a .text file
08:14
i used space to separate them all
Avatar
your file is like this ? mamad pass12345
Avatar
რილია 2024-01-10 08:15:31Z
mohammad mohammad455 0 2024-01-10 edwardddd edward3232 0 2024-01-10 someoneelse malekesh232 0 2024-01-10
Avatar
Avatar
Vexar
your file is like this ? mamad pass12345
რილია 2024-01-10 08:15:37Z
yes
08:16
why you using file don't understand what's wrong with sql or sqlite ?
Avatar
რილია 2024-01-10 08:16:33Z
i never used sql that's all
Avatar
You can start now it's better option than file
08:17
DDNet already have it's base to use you just need add your table and some query for register, login and etc.
Avatar
Avatar
Vexar
You can start now it's better option than file
რილია 2024-01-10 08:18:18Z
yeh i come to a point that i realized c++ is not for these kind of things
Avatar
no you can use it in C++ and it's fine but in my experiences SQL is way better than file in account management purposes
Avatar
chillerdragon BOT 2024-01-10 08:24:08Z
By the way both onbgy fng and fokkonaut use self made file formats for accounts in production with lots of players
Avatar
@რილია
Avatar
chillerdragon BOT 2024-01-10 08:26:41Z
I would use one file per account not all in one file
Avatar
Avatar
Vexar
@რილია
რილია 2024-01-10 08:27:17Z
you made it look easy 😂
Avatar
Avatar
chillerdragon
I would use one file per account not all in one file
in that case it's fine to use separate files and folder
Avatar
Avatar
რილია
you made it look easy 😂
create a new folder for each account as it's id and inside folder put your databases as file like account that include username,password,level,register date and etc
Avatar
Avatar
chillerdragon
I would use one file per account not all in one file
რილია 2024-01-10 08:28:22Z
it was on back of my head too.
Avatar
Avatar
Vexar
create a new folder for each account as it's id and inside folder put your databases as file like account that include username,password,level,register date and etc
რილია 2024-01-10 08:29:44Z
i will do it later
Avatar
#include <iostream> #include <fstream> #include <sstream> #include <string> int main() { std::string line; std::string username; std::string password; int level; std::string registerDate; std::ifstream ifile("BankAccounts.txt"); if (ifile.is_open()) { while (std::getline(ifile, line)) { std::istringstream iss(line); if (iss >> username >> password >> level >> registerDate) { std::cout << "Username: " << username << "\nPassword: " << password << "\nLevel: " << level << "\nRegister Date: " << registerDate << "\n=======================================" << std::endl; } else { std::cerr << "Error extracting values from the line." << std::endl; } } ifile.close(); } else { std::cerr << "Error opening file." << std::endl; } return 0; }
08:29
I forgot to copy and paste codes 😄
Avatar
Avatar
chillerdragon
I would use one file per account not all in one file
Yes, embrace the unix. Everything is a file
Avatar
Avatar
რილია
look at this shit, i no longer know what am i doing std::string line; std::string username; std::string password; std::string money; std::ifstream ifile; ifile.open("build/BankAccounts.txt"); if(ifile.good()) { for(unsigned int LineNumber=0; std::getline(ifile, line); LineNumber++) { for(unsigned int CharNumber=0; CharNumber <= line.length(); CharNumber++) { if(Char == ' ') { char Char = line[CharNumber]; char buff[CharNumber]; line.copy(buff, CharNumber-1, 0); buff[CharNumber] = '\0'; username = buff; pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", username.c_str()); } } // pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "chatresp", ); } }
So you are writing a custom serialization method. Yeah that's not the easiest
08:36
Besides I'd not store accounts in a text file. Look at what u really want You want all lines And u want to split every line
08:36
Do these two steps after each other
Avatar
ChillerDragon BOT 2024-01-10 08:36:43Z
on what does >> split?
Avatar
Wat
Avatar
ChillerDragon BOT 2024-01-10 08:37:34Z
wat dis do if (iss >> username >> password >> level >> registerDate)
Avatar
Xd
Avatar
Avatar
Vexar
#include <iostream> #include <fstream> #include <sstream> #include <string> int main() { std::string line; std::string username; std::string password; int level; std::string registerDate; std::ifstream ifile("BankAccounts.txt"); if (ifile.is_open()) { while (std::getline(ifile, line)) { std::istringstream iss(line); if (iss >> username >> password >> level >> registerDate) { std::cout << "Username: " << username << "\nPassword: " << password << "\nLevel: " << level << "\nRegister Date: " << registerDate << "\n=======================================" << std::endl; } else { std::cerr << "Error extracting values from the line." << std::endl; } } ifile.close(); } else { std::cerr << "Error opening file." << std::endl; } return 0; }
რილია 2024-01-10 08:39:15Z
i don't get this, i just do my character by character method (edited)
Avatar
Avatar
ChillerDragon
wat dis do if (iss >> username >> password >> level >> registerDate)
it's use std::istringstream to extract a space-separated string and store to variables
Avatar
Avatar
რილია
i don't get this, i just do my character by character method (edited)
as you wish 😉
❤️ 1
Avatar
Avatar
Vexar
#include <iostream> #include <fstream> #include <sstream> #include <string> int main() { std::string line; std::string username; std::string password; int level; std::string registerDate; std::ifstream ifile("BankAccounts.txt"); if (ifile.is_open()) { while (std::getline(ifile, line)) { std::istringstream iss(line); if (iss >> username >> password >> level >> registerDate) { std::cout << "Username: " << username << "\nPassword: " << password << "\nLevel: " << level << "\nRegister Date: " << registerDate << "\n=======================================" << std::endl; } else { std::cerr << "Error extracting values from the line." << std::endl; } } ifile.close(); } else { std::cerr << "Error opening file." << std::endl; } return 0; }
and some ppl say rust is ugly (edited)
Avatar
რილია 2024-01-10 09:31:31Z
i did it finally
Avatar
Avatar
Ryozuki
and some ppl say rust is ugly (edited)
I won't 😄
Avatar
Avatar
Ryozuki
such a murican song
y do u think that
Avatar
idk maybe im biased cuz ur american
Avatar
Avatar
რილია
i did it finally
noice
Avatar
it’s british
Avatar
is smith a name more common in britain?
09:32
aye innit
09:32
was gonna say that
Avatar
probably as common
09:32
i don’t think the smiths were ever very successful in the usa
09:32
at least compared to in the uk
Avatar
Avatar
Vexar
#include <iostream> #include <fstream> #include <sstream> #include <string> int main() { std::string line; std::string username; std::string password; int level; std::string registerDate; std::ifstream ifile("BankAccounts.txt"); if (ifile.is_open()) { while (std::getline(ifile, line)) { std::istringstream iss(line); if (iss >> username >> password >> level >> registerDate) { std::cout << "Username: " << username << "\nPassword: " << password << "\nLevel: " << level << "\nRegister Date: " << registerDate << "\n=======================================" << std::endl; } else { std::cerr << "Error extracting values from the line." << std::endl; } } ifile.close(); } else { std::cerr << "Error opening file." << std::endl; } return 0; }
my rust version use std::{ error::Error, io::{BufRead, BufReader}, }; fn main() -> Result<(), Box<dyn Error>> { let file = std::fs::File::open("BankAccounts.txt")?; let buff = BufReader::new(file); for line in buff.lines() { let line = line?; let mut line = line.split_ascii_whitespace(); let username = line.next().expect("error getting username"); let password = line.next().expect("error getting password"); let level = line.next().expect("error getting level"); let register_date = line.next().expect("error getting register_date"); println!("Username: {username}, password: {password}, level: {level}, register_date: {register_date}"); } Ok(()) }
09:50
it doesnt allocate on the loop btw
09:50
ok it does
09:50
on the first line? xD cuz its a String
Avatar
Avatar
Ryozuki
my rust version use std::{ error::Error, io::{BufRead, BufReader}, }; fn main() -> Result<(), Box<dyn Error>> { let file = std::fs::File::open("BankAccounts.txt")?; let buff = BufReader::new(file); for line in buff.lines() { let line = line?; let mut line = line.split_ascii_whitespace(); let username = line.next().expect("error getting username"); let password = line.next().expect("error getting password"); let level = line.next().expect("error getting level"); let register_date = line.next().expect("error getting register_date"); println!("Username: {username}, password: {password}, level: {level}, register_date: {register_date}"); } Ok(()) }
I know nothing about rust but seem scary a little don't know 😄
Avatar
whats scary xD
09:52
@Vexar in rust u use iterators a lot
09:52
they are lazy and epic
09:52
in c++ its kind of a hassle
09:52
lines() returns a iterator over lines
09:53
split_ascii_whitespaces returns a iterator over words separated by a whitespace ascii looking char
09:53
and it doesnt allocate its references
09:53
cuz slicing in rust is epic
09:53
and safe
09:53
then i use the iterator manually with next()
09:53
instead of using it with a for loop
09:53
since i know the exact items
Avatar
u use iterators a lot in cpp too? xd
Avatar
hmm yeah i heard that rust's safety is on another level but done anything with rust (edited)
Avatar
At least in the std
Avatar
Avatar
Ewan
u use iterators a lot in cpp too? xd
its funny to use being() end() everywhere, is that still needed in modern cpp?
09:54
begin*
Avatar
u have to accept its way easier to write in rust
Avatar
I know rust is easier than c/c++
Avatar
@Ewan are they lazy btw?
Avatar
for(auto &it : container)
Avatar
Avatar
Vexar
I know rust is easier than c/c++
who told u that
Avatar
it is iterator
Avatar
its a mix match the difficulty
09:55
some stuff is easier some is harder
Avatar
Avatar
Ryozuki
who told u that
well maybe not easier but cool and have more fun
Avatar
holding unsafe guarantees can be harder i think
Avatar
Debatable
Avatar
if u do unsafe code
Avatar
Avatar
Ryozuki
some stuff is easier some is harder
well like other programming languages
Avatar
no i would say most other languages (not functional) are easier than c++ or rust
09:56
functional is its own weird world
Avatar
as I know in 2023 python were easier to learn and use right ?
Avatar
Avatar
Vexar
well maybe not easier but cool and have more fun
this is true which is why u should learn
09:57
if u need help ask here
09:57
its a rust safe zone
09:57
justatest
Avatar
Most of time I use C++ cuz of DDNet base and nodejs for my backend api
09:58
iterators are fun xd
Avatar
cpp and js experience
Avatar
but If I'm going to learn a new language I choose Rust
Avatar
Avatar
Ewan
cpp and js experience
ur gonna hate rust xdd
Avatar
fn main() { let fib = Fibonacci::new(); // Take 20 fibonacci numbers and put them into a vector. let result: Vec<u64> = fib.take(20).collect(); println!("{:?}", result); } // [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181]
09:58
using iterators to make a series
09:58
impl Iterator for Fibonacci { type Item = u64; fn next(&mut self) -> Option<Self::Item> { let r = self.b; self.b = self.a; self.a += r; Some(r) } }
Avatar
Avatar
Ewan
cpp and js experience
it's a client side accounting system that using nodejs and mongodb to register, login, ...
Avatar
Avatar
Ewan
ur gonna hate rust xdd
🤣
Avatar
super cool
Avatar
Avatar
Vexar
it's a client side accounting system that using nodejs and mongodb to register, login, ...
dont listen ur gonna love rust
Avatar
rust is epic but it will be steep learning curve
Avatar
I love all language they have their own magical world
Avatar
a good stack for replacing nodejs and mongodb is: axum for http server sqlx to interact with postgres (dont use mongodb bro)
Avatar
but it’s web scale
Avatar
let me save your message it could be helpful for next project
10:00
(its parody btw)
10:02
@Vexar and example of the stack i mentioned: https://github.com/ZhyraPlugins/xivhub-market-api/tree/master
A api to upload and request market data from FFXIV - GitHub - ZhyraPlugins/xivhub-market-api: A api to upload and request market data from FFXIV
10:02
i also use prometheus
10:02
to have data on grafana
10:02
altho i abandoned this project rn
Avatar
what's FFXIV ?!
10:04
is it final fantasy XIV ?! 😄
Avatar
Avatar
Vexar
is it final fantasy XIV ?! 😄
yes
Avatar
A six year old Linux kernel mailing list discussion has been reignited over the prospects of converting the Linux kernel to supporting modern C++ code.
12:11
😬
12:13
Template programming incoming
Avatar
Avatar
Ryozuki
a good stack for replacing nodejs and mongodb is: axum for http server sqlx to interact with postgres (dont use mongodb bro)
BlaiZephyr | meloƞ 2024-01-10 12:13:44Z
I have a dejavu - didnt we Talk about Rust and sqlx with axum 2 days ago ? kek (edited)
Avatar
Avatar
chillerdragon
I would use one file per account not all in one file
chillerdragon: sqlite would usually be better than a hand-rolled file format
13:09
Vcc - the Vulkan Clang Compiler, is a proof-of-concept C and C++ compiler for Vulkan leveraging Clang as a front-end, and Shady our own research IR and compiler. Unlike other shading languages, Vcc aims to stick closely to standard C/C++ languages and merely adds a few new intrinsics to cover GPU features. Vcc is similar to CUDA or Metal in this regard, and aims to bring the advantages of standard host languages to Vulkan shaders1.
Avatar
Avatar
Ryozuki
Time to compile ddnet for gpu
13:26
Does DNA have anything like IF-statements, GOTO-jumps, or WHILE loops? In software development, these constructs have the following functions: IF-statements: An IF statement executes the code in a
13:26
Nature Reviews Genetics - The use of mathematical modelling to elucidate genetic, molecular and cellular processes is an integral part of systems biology. This Review presents the main methods to...
13:26
@Jupstar ✪ time to reprogram humanity
Avatar
A toy programming language with time travel. Contribute to ambulancja/mariposa development by creating an account on GitHub.
13:32
lol
Avatar
mariposa is spanish for butterfly
13:33
taps shoulder
Avatar
Chiller Dragon BOT 2024-01-10 14:07:43Z
yes I assumed that as common knowledge and it was also recommended in this chat. I just mentioned that self rolled file formats also work and they even work in bigger tw scale. They might be worth the trade off. If you do not need to run complex queries or join tables and similar. Just have some level/xp/points and simple ranks files work fine. And they do not require complex external libraries.
Replying to @heinrich5991 chillerdragon: sqlite would usually be better than a hand-rolled file fo…
14:10
so one account per line and it is space seperated? What if the values contain spaces? Do you disallow spaces in passwords? Do you escape spaces somehow?
Replying to @Vexar it's use `std::istringstream` to extract a space-separated string and st…
Avatar
since you surely don't save passwords unhashed, spaces are no problem
14:53
sqlite offers a couple of things for free that you don't get with plain files
14:53
e.g. crash safety
14:53
the data is still there, even if you were in the middle of overwriting it
14:54
for your hand-rolled file format, that's harder to guarantee
15:07
In computer science, ACID (atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. In the context of databases, a sequence of database operations that satisfies the ACID properties (which can be perceived as a single logi...
Avatar
chillerdragon BOT 2024-01-10 16:05:16Z
lmao the trolling
Replying to @heinrich5991 since you surely don't save passwords unhashed, spaces are no problem
16:06
Yea that’s nice. But not needed for all small tw mods
Replying to @heinrich5991 the data is still there, even if you were in the middle of overwriting i…
Avatar
Avatar
chillerdragon
Yea that’s nice. But not needed for all small tw mods
you don't need the data in small tw mods?
16:12
seems like a problem that could occur there
16:12
a player tries to log out, the server crashes while writing their money value, the player is sad that they lost their account and their stats
Avatar
Can someone unban me on the brazilian mod map
Avatar
ChillerDragon BOT 2024-01-10 16:19:19Z
@heinrich5991 yes can happen but does not have to. Not sure if noby in years of running file based stats had that issue ever. I know fokko did not run into that issue. And using this statistically valuable data i can say its worth a shot for mamad to not spend 30 minutes understanding sql if he intends to rewrite the whole mod soon anyways.
16:20
imo self rolled file stats have a bad rap. Using git backups and write to other file and copy on finish and lock files you can get something you fully understand and easy to setup that should not result in complete data loss.
Avatar
sounds like you're partially emulating sqlite
Avatar
ChillerDragon BOT 2024-01-10 16:21:39Z
i never visited a single db lecture in uni idk how real databases do anything
Avatar
sqlite is basically a "file based solution" that you're trying to do
Avatar
ChillerDragon BOT 2024-01-10 16:22:31Z
for my tw mods sql also worked better. I did some file based fng mod once and I had some bug in the locking mechanism.
16:23
But I would not recommend new coders to mess with sql for their first mod. Might cause rage quits and have less learnings.
16:23
Or at least mention file based is also an option
16:24
@heinrich5991 i had to actually giggle a bit on your hashing comment i can not tell if you were trying to be funny or not xd
16:24
i think he even said the passwords should be short so he can read them better xD
Avatar
Doing the “file based solution” properly is far harder than you make it out to be. It only appears so simple because you ignore much of the possible issues 😄
16:25
If nothing ever goes wrong, yes, the file based solution is trivial and works well
Avatar
ChillerDragon BOT 2024-01-10 16:25:57Z
17:08:32 bridge | mamad_melanin: i just wanna look at them in a text file, each of them looking good, not to long
16:27
15:52:58 bridge | heinrich5991: since you surely don't save passwords unhashed, spaces are no problem
16:27
comedy gold
16:28
@Learath2 yea im saying that nothing actually did go wrong as far as i know
Avatar
I remember stuff going wrong for whatever reason
16:28
was it in ddnet's file time score?
16:28
or some random city mod?
16:28
maybe I'm even misremembering
Avatar
ChillerDragon BOT 2024-01-10 16:28:56Z
ddnet file score did have some wonkeyyness here and there for sure
Avatar
I am serious about the fact that you should save passwords hashed
16:29
then all the character set issues go away, too
16:29
win-win
Avatar
ChillerDragon BOT 2024-01-10 16:29:23Z
Okay does not make it less funny
Avatar
Avatar
heinrich5991
then all the character set issues go away, too
Usernames 😬
Avatar
chillerdragon: when SQL to bash commands compiler
Avatar
Avatar
Learath2
Usernames 😬
passwords needing to adhere to some limited character set does not pass my security smell test
16:35
usernames doing the same is fine IMO
16:36
but yea, need to do that if you don't want to have a abc\nPassword: 123\nMoney: 10000000\n as username (edited)
Avatar
That is true. But it's a common source of bugs, especially if you are rolling your own
Avatar
that's not your money for a long time 😏
16:39
16:39
epic
16:39
the 3d cube is back
16:40
plasma 6 gonna hit different
Avatar
sounds like 2005 linux 😄
16:40
this time with AR? 😛
Avatar
what is ar
16:40
i am young
16:40
i wasnt alive in 2005
16:40
ok maybe i was
16:41
but learath wasnt
Avatar
learath2 isn't <20 years old IIRC
Avatar
Everything above 255 seems to be clamped somewhere else. At least go max. ./DDNet-Server "sv_welcome xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxY" !image

Checklist

  • [x] Te...
Avatar
he is so 12
Avatar
In this post, we will analyze how Vanguard attempts to keep away bad actors by utilizing a simple yet brutally strong method
Avatar
Avatar
heinrich5991
learath2 isn't <20 years old IIRC
There is this ongoing meme that I am 12
Avatar
Avatar
Jupstar ✪
what is ar
ah augmented reality yeah i remember
Avatar
Avatar
Learath2
There is this ongoing meme that I am 12
why meme
Avatar
Avatar
Jupstar ✪
why meme
It's only one of my ages. I'm also 86
Avatar
Learath21 he's 21
Avatar
that blog theme reminds me of some vmprotect writeup (edited)
Avatar
Avatar
Learath2
It's only one of my ages. I'm also 86
i thought we changed it to 84, so it's divisible by 12
Avatar
I'll allow it
Avatar
born in 2012
16:46
24.12
Avatar
Avatar
heinrich5991
that blog theme reminds me of some vmprotect writeup (edited)
too complex for me but I found the subject interesting to share
Avatar
რილია 2024-01-10 16:49:02Z
why every time my server get shutdowned the server setting goes to default (when you make a server on unmodified client)
16:49
but when i clone and run it, it works as intended
Avatar
server or client
16:49
u cant talk about both xd
Avatar
რილია 2024-01-10 16:49:55Z
server
Avatar
well what do u expect?
16:50
do u change it in F2 console?
Avatar
რილია 2024-01-10 16:50:32Z
i change the whole bunch of shit
Avatar
the server does not persist these changed values
16:50
u gotta create a cfg file ahead of starting
16:50
and change your stuff there
16:51
but, u just gave me a good idea, thanks for that
Avatar
რილია 2024-01-10 16:52:06Z
i changed the .cfg file in data, and i build from source
Avatar
mh i always find it annoying to change cfgs in build dir.. i use the config dir instead
Avatar
რილია 2024-01-10 16:53:05Z
by config directory you mean ~/.loacal/share/ddnet ?
Avatar
yes
Avatar
რილია 2024-01-10 16:53:21Z
ah brother
Avatar
but if u create a cfg file. at least name it different to the default ones (edited)
16:53
else u override them with the cmake command
Avatar
რილია 2024-01-10 16:53:58Z
thank you
Avatar
func.func @add_plus_two(%arg0: i32, %arg1: i32) -> i32 { %c1_i32 = arith.constant 1 : i32 %alloca = memref.alloca() : memref<1xi32> %c0 = arith.constant 0 : index memref.store %c1_i32, %alloca[%c0] : memref<1xi32> %c0_0 = arith.constant 0 : index %0 = memref.load %alloca[%c0_0] : memref<1xi32> %c1_i32_1 = arith.constant 1 : i32 %1 = arith.addi %0, %c1_i32_1 : i32 %c0_2 = arith.constant 0 : index memref.store %1, %alloca[%c0_2] : memref<1xi32> %2 = arith.addi %arg0, %arg1 : i32 %c0_3 = arith.constant 0 : index %3 = memref.load %alloca[%c0_3] : memref<1xi32> %4 = arith.addi %2, %3 : i32 return %4 : i32 } i have a quiz for u, does this end up allocating when compiled to assembly by llvm? (edited)
16:59
its MLIR code btw
Avatar
@Jupstar ✪ u can talk about both if u click "start a local server" on ur client
Avatar
Avatar
Ryozuki
func.func @add_plus_two(%arg0: i32, %arg1: i32) -> i32 { %c1_i32 = arith.constant 1 : i32 %alloca = memref.alloca() : memref<1xi32> %c0 = arith.constant 0 : index memref.store %c1_i32, %alloca[%c0] : memref<1xi32> %c0_0 = arith.constant 0 : index %0 = memref.load %alloca[%c0_0] : memref<1xi32> %c1_i32_1 = arith.constant 1 : i32 %1 = arith.addi %0, %c1_i32_1 : i32 %c0_2 = arith.constant 0 : index memref.store %1, %alloca[%c0_2] : memref<1xi32> %2 = arith.addi %arg0, %arg1 : i32 %c0_3 = arith.constant 0 : index %3 = memref.load %alloca[%c0_3] : memref<1xi32> %4 = arith.addi %2, %3 : i32 return %4 : i32 } i have a quiz for u, does this end up allocating when compiled to assembly by llvm? (edited)
yes, but is your question if it alocates from heap?
17:00
if it allocates at all
17:00
on the stack
17:00
and it doesnt
17:00
0000000000000030 <add_plus_two>: 30: 8d 44 37 02 lea eax,[rdi+rsi*1+0x2] 34: c7 44 24 fc 02 00 00 mov DWORD PTR [rsp-0x4],0x2 3b: 00 3c: c3 ret
17:00
its funny
17:01
fn add_plus_two(x: i32, y: i32) -> i32 { let mut z: i32 = 1; z = z + 1; return x + y + z; }
17:01
this is the original code btw
Avatar
so you mean it gets optimized away?
Avatar
yeah, i made so the compiler emits allocas (which are stack allocations) for local variables, and u load and store the values when a expression needs it or sets it in a assignment
17:02
but ultimately there are no stack allocations
17:02
because llvm can figure it out
Avatar
epic compiler moment
Avatar
since MLIR (and llvm ir) are in SSA form allocas are the easy way to modify stuff and implement "variables" itself
17:03
SSA = single assignment form
17:03
the difference between MLIR and LLVM here is
17:03
MLIR has even more info
17:03
like the shape of the alloca
17:03
it also does alloc for heap
17:03
the memref<1xi32> is the shape
Avatar
Avatar
Jupstar ✪
epic compiler moment
რილია 2024-01-10 17:05:37Z
so if there was a .cfg being in build/data directory, it gets on the way of the user data directory, am i right ?
Avatar
Avatar
რილია
so if there was a .cfg being in build/data directory, it gets on the way of the user data directory, am i right ?
i dont understand what you try to say, but no, it won't be inside the user data dir
17:08
./my_server -f my_cfg.cfg
17:08
next to my_server there must be a cfg named my_cfg
Avatar
Avatar
Jupstar ✪
i dont understand what you try to say, but no, it won't be inside the user data dir
რილია 2024-01-10 17:10:09Z
if you have two autoexec_server.cfg . one in data directory and another one in ~/.local/share/ddnet directory, which one get executed ?
Avatar
@Learath2 i made a sin and tried league on lutris and it worked
17:10
i thought vanguard or idk made it impossible
Avatar
Avatar
რილია
if you have two autoexec_server.cfg . one in data directory and another one in ~/.local/share/ddnet directory, which one get executed ?
the config dir
Avatar
linux is awesome
17:15
21f6af9 Increase sv_welcome to 256 - ChillerDragon 035cb6e Merge pull request #7784 from ChillerDragon/pr_256_welcome - heinrich5991
Avatar
Avatar
Learath2
Doing the “file based solution” properly is far harder than you make it out to be. It only appears so simple because you ignore much of the possible issues 😄
works perfectly for me
17:20
But tbh I also spent some time improving it and making it work nice and smooth
17:21
But wish I had SQL haha
Avatar
It's not impossible to do properly. There is just more to it then it might seem at a first glance
Avatar
ChillerDragon BOT 2024-01-10 17:35:36Z
lerato is 12 forever
17:35
like peter pan
17:42
i do not like how many emails the new merge queue sends :(
17:43
17:43
was bors as spammy?
Avatar
ws-client BOT 2024-01-10 17:46:48Z
<ChillerDragon> Ah wait no its twice as many emails
17:47
<ChillerDragon> It used to be one comment from ddnet mergers saying "Thanks bors+r" and the one "pr closed as merged" email. Now its one "Thanks" comment. One merge added email. Two merge done emails.
Avatar
Xd
18:03
Also stop white design
18:03
Boomer
Avatar
რილია 2024-01-10 18:45:21Z
hello there, i am in the progress of making account system, day 4
18:46
with c++ of course
Avatar
ChillerDragon BOT 2024-01-10 18:46:18Z
C masterrace
Avatar
რილია 2024-01-10 18:48:12Z
how can i swap a text in a file ?, example: swap "21548" at line 4 and character 30 (edited)
18:49
i implemented 90% of it
Avatar
ChillerDragon BOT 2024-01-10 18:49:28Z
as far as i know there is no such thing as swap in a text file
18:49
only read in all content change the content in c++ and write out all content
Avatar
რილია 2024-01-10 18:50:09Z
then lets learn sql
Avatar
ChillerDragon BOT 2024-01-10 18:50:12Z
there probably is some smart way to write at a specific offset but that seems advanced
Avatar
Avatar
ChillerDragon
there probably is some smart way to write at a specific offset but that seems advanced
რილია 2024-01-10 18:50:52Z
do you implemented your acc system with sql ?
Avatar
ChillerDragon BOT 2024-01-10 18:51:10Z
ddnet++ is using ddnets sql infrastructure
18:51
btw i made a yt series on how to add txt based accs
18:51
i did not link it earlier because you were doing just fine
18:51
might be too beginner for you
Avatar
რილია 2024-01-10 18:51:53Z
trollet
Avatar
ChillerDragon BOT 2024-01-10 18:51:59Z
im serious
18:52
in case u are curious here is a 1 hour video on how to do txt accounts using tw style file code so no c++ streams https://www.youtube.com/watch?v=Bwt1PoFWOOA
18:53
you do not need sql to change values just read in the file change the content and write it out
Avatar
Avatar
ChillerDragon
in case u are curious here is a 1 hour video on how to do txt accounts using tw style file code so no c++ streams https://www.youtube.com/watch?v=Bwt1PoFWOOA
რილია 2024-01-10 18:53:30Z
i will check it out, thanks ❤️
Avatar
ChillerDragon BOT 2024-01-10 18:53:52Z
or if you have specific fixed offsets you can lookup on how to start writing at a offset in c++ i think that works too
Avatar
Avatar
ChillerDragon
you do not need sql to change values just read in the file change the content and write it out
რილია 2024-01-10 18:54:02Z
sounds exactly the thing i want
Avatar
ChillerDragon BOT 2024-01-10 18:54:04Z
fseek and shits
18:54
well thats C
18:54
idk c++
18:54
are you still storing all accounts in one file?
18:54
i highly recommend not to do that and use one file per user instead
Avatar
Avatar
ChillerDragon
are you still storing all accounts in one file?
რილია 2024-01-10 18:55:14Z
yes, that is the challenge, but i did not knew it's such a pain (edited)
Avatar
Avatar
ChillerDragon
are you still storing all accounts in one file?
რილია 2024-01-10 18:57:20Z
the way i implemented it, the account address is just a line number in the text file 😂
Avatar
ChillerDragon BOT 2024-01-10 18:57:37Z
yea i would not recommend doing that
18:57
will be annoying to maintain if you have thousands of accounts
18:58
working with big text files might break your tooling
18:58
consume a lot of ram while reading it
18:58
break your editor when opening it to debug stuff
18:58
etc
Avatar
Avatar
რილია
how can i swap a text in a file ?, example: swap "21548" at line 4 and character 30 (edited)
რილია 2024-01-10 18:59:41Z
it took me a whole day, and i still have no idea how to do this
Avatar
ChillerDragon BOT 2024-01-10 18:59:51Z
arent you basically done?
18:59
do what?
Avatar
რილია 2024-01-10 19:00:57Z
i have everything except changing the value in the text file
Avatar
ChillerDragon BOT 2024-01-10 19:01:17Z
does everything includ adding accounts?
f3 1
19:01
and loading accounts?
f3 1
19:01
then just call your load method change the values and call your save method
Avatar
რილია 2024-01-10 19:03:27Z
to this point everything i don was reading the file and append(register an account) to it
Avatar
ChillerDragon BOT 2024-01-10 19:04:02Z
i see
Avatar
რილია 2024-01-10 19:04:38Z
even file get readed every time someone wants to register to be sure that the account is not existed brownbear (edited)
Avatar
ChillerDragon BOT 2024-01-10 19:13:56Z
I want to find a string in a file and replace it with user input. Here is my rough code. #include <iostream> #include <fstream.h> #include <string.h> int main(){ istream rea...
heartw 1
19:14
this might work for replacing but i am not sure i can recommend doing that
Avatar
How to make the distance to draw players? How to use fng to protect against cheat clients
Avatar
Don't allow the camera to go out of bounds so that we don't see ugliness in areas that are normally inaccessible and not visible with a sensible amount of zoom. !oops

Checklist

  • [x] Tested the change ingame
  • [x] Provided screenshots if it is a visual change
  • [x] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added cover...
Avatar
The IClient::Disconnect function is always called at the beginning of the IClient::Connect function. The IClient::Disconnect function calls IClient::DisconnectWithReason, if the client is not already offline, which performs cleanup of temporary commands and demo recorders already, so the same cleanup in the Connect function is unnecessary. An assertion is added to ensure that the client was properly disconnected before connecting. Connecting while the client is already quitting or r...
Avatar
Avatar
ChillerDragon
Click to see attachment 🖼️
configure your email client
20:44
ChillerDragon
Avatar
Avatar
Ryozuki
@Learath2 i made a sin and tried league on lutris and it worked
Vanguard isn’t on league yet but it will be next patch 😄
Avatar
Let's follow riot's shenanigans and implement kernel level anti cheat for ddnet too 😎
Avatar
Avatar
Learath2
Vanguard isn’t on league yet but it will be next patch 😄
next patch? they've been saying it comes soon for a while now. is it actually coming?
Avatar
link?
Avatar
idk if next patch tho
Avatar
(I remember them saying it comes soon a couple of years back)
Avatar
Now there's a lot of players talking about. Plus they made it official on the S14 video
Avatar
Hm, I assumed next patch because they said it in the season 2024 video thing
Avatar
ppl still cheat on their csgo clone right?
21:15
xd
Avatar
valorant? I do not think so? Idk haven't heard about it.
21:16
But it will still reduce the cheaters by a lot as now you require quite the skills to cheat
Avatar
its hilarius users dont know anything and allow to install this
Avatar
Avatar
Devinci
But it will still reduce the cheaters by a lot as now you require quite the skills to cheat
*more money
Avatar
Ofc they are still cheating on valorant
Avatar
I'm quitting lol tho. @Ryozuki teach me dota xd
Avatar
dota best
Avatar
the peopl with the skills aren't the ones cheating, I'd wager
Avatar
but i ocasionally play a lol game to socialize with normal ppl
Avatar
Avatar
heinrich5991
the peopl with the skills aren't the ones cheating, I'd wager
idk about that
21:17
i think ppl with the skills know to cheat the best
21:17
this reminded me of the minecraft speedrun drama
Avatar
Avatar
heinrich5991
*more money
well, it will still reduce the amount of cheaters 🤷‍♂️. I'm really against the idea tho as I don't think cheaters are really an issue for 99.9% of the community (I made up that stat) (edited)
Avatar
(hardly means barely btw) (edited)
21:18
i remembered this nice vid xd
Avatar
ehh, well, you got it. whoops
Avatar
true but it's still a minority
Avatar
Avatar
Devinci
well, it will still reduce the amount of cheaters 🤷‍♂️. I'm really against the idea tho as I don't think cheaters are really an issue for 99.9% of the community (I made up that stat) (edited)
this is like the state enforcing security through control
21:18
1984
Avatar
but it's sad that the biggest minecraft youtuber (ever) is a cheater xD
21:19
and he got his success by cheating
Avatar
Avatar
Jupstar ✪
but it's sad that the biggest minecraft youtuber (ever) is a cheater xD
i heard rumors he is a groomer too
21:19
but idk if true
Avatar
In late 2022, Dream was accused of flirting with and grooming a minor by Twitter user 'Anastasia' who claimed she was 17 years old at the time she had an encounter with the YouTube star. Since then, the YouTuber claims he has been “harassed for almost a year due to false accusations.”
21:19
maybe its just attention seeking from someone tho
Avatar
where are the default entities located i cant find them lol
Avatar
Editor
21:49
Entities clear
Avatar
thanks
Avatar
chillerdragon BOT 2024-01-10 22:00:49Z
Sounds time consuming
Replying to @heinrich5991 configure your email client
22:08
troll
Avatar
Avatar
chillerdragon
Sounds time consuming
not a lot more time-consuming than complaining ^^
22:15
chillerdragon
Avatar
6 separate entities and a macro to keep pressing a bind to make em move
22:24
this lags the helll outta the game
Avatar
3eeba01 Remove duplicate cleanup when connecting - Robyt3 4231954 Merge pull request #7786 from Robyt3/Client-Connect-Cleanup-Cleanup - def-
Avatar
chillerdragon BOT 2024-01-10 22:36:19Z
Doubt took me 1 minute
Replying to @heinrich5991 not a lot more time-consuming than complaining ^^
22:37
Did you ever configure your email client to do such things? Is it easy? I couldn’t even think of a regex without false positives. And i somehow doubt gmail supports regex at all
Avatar
@BlaiZephyr | meloƞ thanks for hoping on me
23:00
i finally made this
23:00
after 2 days of brain killing
23:00
Avatar
BlaiZephyr | meloƞ 2024-01-10 23:01:28Z
Pat Pat Pat it'll be okay
Avatar
@-StormAx what are you doing?
Avatar
Avatar
fokkonaut
@-StormAx what are you doing?
old freeze
23:02
when ninja has a katana
Avatar
stars?
23:02
ah
Avatar
no the katana
Avatar
i see
23:03
I miss the stars. They were so perfect to time things + whenever I see old teeworlds videos or the trailer on steam it just feels like nostalgia and a whole different game :(
23:04
@Learath2 when ur promised clientside alternative to get them back
Avatar
Avatar
fokkonaut
I miss the stars. They were so perfect to time things + whenever I see old teeworlds videos or the trailer on steam it just feels like nostalgia and a whole different game :(
i dont lol
Avatar
Avatar
fokkonaut
I miss the stars. They were so perfect to time things + whenever I see old teeworlds videos or the trailer on steam it just feels like nostalgia and a whole different game :(
its awful, add old starts is possible only by changing client version to 16010
Avatar
nah, you can simply render them clientside
23:06
the client knows about all the info needed in order to replay the old server behaviour for the stars
23:06
if you know that, where is stars is sending?
Avatar
wdym?
Avatar
some netmsg, so server understand what to set freezebar || stars
Avatar
thanks
23:08
I'm just too lazy and busy to do it myself but I really want this as an option back
23:08
clientsided
23:09
good night
Avatar
Avatar
-StormAx
some netmsg, so server understand what to set freezebar || stars
As you can see in the link, the client with new HUD Version will not receive the stars. Simply render them clientside. The Info you need is sent via DDNetCharacter snap object.
23:11
This info is also used by the client to render the freeze bar.
23:11
So i can just set it as local variable (edited)
23:11
Cool
Avatar
You mean as config option clientside?
23:12
yes
23:12
or what?
Avatar
Avatar
fokkonaut
yes
exacly what i ment
Exported 456 message(s)