1 (edited by kmopsuy 2017-11-16 22:09:49)

Topic: Server / client comunication

Hello! I have already compiled tw source (ddnet) i am diving into code but i would like to ask where i can find class responsible for server/client comunication. When i write in remote console "grenade" server gives me grende, "ninja" boom i have ninja.
In which dir can i find this functions?

2

Re: Server / client comunication

kmopsuy wrote:

Hello! I have already compiled tw source (ddnet) i am diving into code but i would like to ask where i can find class responsible for server/client comunication. When i write in remote console "grenade" server gives me grende, "ninja" boom i have ninja.
In which dir can i find this functions?

https://github.com/ddnet/ddnet/blob/mas … s.cpp#L156
https://github.com/ddnet/ddnet/blob/mas … ands.h#L16

3

Re: Server / client comunication

Yeah i have already noticed that but i mean client side (receiving).
Thanks for answer C:

4 (edited by unsigned char* 2017-11-17 17:01:54)

Re: Server / client comunication

Weapons are managed in server side... client only knows information about active weapon.
- Server & Client knows the structure of a character: https://github.com/ddnet/ddnet/blob/mas … rk.py#L148
- Server & Client knows info about weapons too: https://github.com/ddnet/ddnet/blob/mas … ent.py#L72
- Server sends info to client: https://github.com/ddnet/ddnet/blob/mas … .cpp#L1044
- Client receive the info: https://github.com/ddnet/ddnet/blob/mas … .cpp#L1101
- Client render the player using the received info: https://github.com/ddnet/ddnet/blob/mas … .cpp#L1041

** In some cases you can trick the client into behaving as you expect (or something similar) without having to change things in the client

5

Re: Server / client comunication

Thanks a lot it works fine! Ty for explaining. unsigned char* big_smile