Protocol info
Forum rules
Please follow the common behaviour rules (viewtopic.php?f=113&t=2199) and write english-only.
Please follow the common behaviour rules (viewtopic.php?f=113&t=2199) and write english-only.
Protocol info
Hi
I wanted to remake tw in C#.
I'm reading tw and ddnet source code about 2 days.
i didn't any info about tw protocol definitions, like packet structure or packing method or any info.
Please tell what files i have to read in repo also more info mean how client authentication works.
So.. just tell what i should read and do
Note: I'm not C\C++ expert, that's why i'm here
I wanted to remake tw in C#.
I'm reading tw and ddnet source code about 2 days.
i didn't any info about tw protocol definitions, like packet structure or packing method or any info.
Please tell what files i have to read in repo also more info mean how client authentication works.
So.. just tell what i should read and do
Note: I'm not C\C++ expert, that's why i'm here
- deen
- Posts: 3576
- Joined: Mon May 05, 2014 2:30 pm
- Player profile: https://ddnet.org/players/deen/
- Discord: deen#5910
Re: Protocol info
Maybe this Rust reimplementation will help you: https://github.com/heinrich5991/libtw2
Re: Protocol info
LOL, tnx dude but i don't know Rust , just give 2/3 minute and tell me about tw protocol, pleasedeen wrote: ↑Thu Sep 14, 2017 9:46 am Maybe this Rust reimplementation will help you: https://github.com/heinrich5991/libtw2
- deen
- Posts: 3576
- Joined: Mon May 05, 2014 2:30 pm
- Player profile: https://ddnet.org/players/deen/
- Discord: deen#5910
Re: Protocol info
There is also https://github.com/ddnet/ddnet/blob/mas ... .h#L15-L28
Other than that, just reading the code, maybe stepping through with a debugger, could help.
Other than that, just reading the code, maybe stepping through with a debugger, could help.
Re: Protocol info
oh yeah that packets structure tnx, where's message definitions ?deen wrote: ↑Thu Sep 14, 2017 10:07 am There is also https://github.com/ddnet/ddnet/blob/mas ... .h#L15-L28
Other than that, just reading the code, maybe stepping through with a debugger, could help.
- Ryozuki
- Posts: 1748
- Joined: Tue Feb 24, 2015 7:28 am
- Location: Catalonia
- Player profile: http://ddnet.tw/players/Ryozuki/
- Mapper profile: http://ddnet.tw/mappers/Ryozuki/
- Clan: Unique
- Website: https://edgarluque.com
- Discord: Ryozuki#2188
Re: Protocol info
The structs used to send/recieve messages are generated by a python script, here is the generated file:
From my experience with it, the client uses for outgoing messages from the client.
e.g:
I think its CNetMsg_Sv_* for outgoing messages from server to client.
Also from what i saw you use CNetObj_* structs to convert the data recieved (e.g projectile info CNetObj_Projectile)
To send a packet, the CMsgPacker is used.
Example sending a chat packet:
From my experience with it, the client uses
Code: Select all
CNetMsg_Cl_*
e.g:
Code: Select all
CNetMsg_Cl_Say // used to send a chat message.
Also from what i saw you use CNetObj_* structs to convert the data recieved (e.g projectile info CNetObj_Projectile)
To send a packet, the CMsgPacker is used.
Example sending a chat packet:
Code: Select all
// send chat message
CNetMsg_Cl_Say Msg;
Msg.m_Team = Team;
Msg.m_pMessage = pLine;
CMsgPacker packet(Msg.MsgID());
Msg.Pack(&packet);
Client()->SendMsg(&packet, MSGFLAG_VITAL);
// or a shorter version
CNetMsg_Cl_Say Msg;
Msg.m_Team = Team;
Msg.m_pMessage = pLine;
Client()->SendPackMsg(&Msg, MSGFLAG_VITAL);
-
- Posts: 47
- Joined: Sat Sep 05, 2015 7:18 pm
Re: Protocol info
Packet header: https://github.com/heinrich5991/libtw2/ ... /packet.md
If you want, we could work together to create some documentation. You can find me on IRC, or on many instant messengers.
Code I use to generate the system messages: https://github.com/heinrich5991/libtw2/ ... _system.py (original code does ad-hoc parsing).
If you want, we could work together to create some documentation. You can find me on IRC, or on many instant messengers.
Code I use to generate the system messages: https://github.com/heinrich5991/libtw2/ ... _system.py (original code does ad-hoc parsing).
- mokuz
- Posts: 755
- Joined: Sat Apr 30, 2016 5:34 pm
- Location: Finland
- Player profile: https://ddnet.tw/players/Mokuz/
- Mapper profile: https://ddnet.tw/mappers/Mokuz/
- Clan: Legendary
Re: Protocol info
Neat!
SpoilerShow
Nothing to see here uwu
mods banned my previous sig :( this is censorship freedom of speech is dead xoxox
mods banned my previous sig :( this is censorship freedom of speech is dead xoxox
Who is online
Users browsing this forum: No registered users and 9 guests