TomenetGame / tomenet

TomeNET is an online multiplayer roguelike role-playing game
https://www.tomenet.eu/
Other
69 stars 11 forks source link

Feature/buff window #13

Closed EvgenijK closed 3 years ago

EvgenijK commented 3 years ago

It would be nice to have indicators for some timed effects on character. Especially for resistances. There is even a 4-year old topic on forum about it https://tomenet.eu/phpBB3/viewtopic.php?f=7&t=932

This code adds indicators for timed four basic resistances, poison resistance, mana resistance and timed full ESP. Indicators placed under location coordinates, left from the map on the main window. Because of placement they are only visible if big_map option is turned on.

image

Please leave comments if this code needs corrections to be accepted.

jezek commented 3 years ago

I see, there is new code added to server, which sends new packets when drawing to client. Does the new server code works (have you tested it) with previous clients?

EvgenijK commented 3 years ago

I see, there is new code added to server, which sends new packets when drawing to client. Does the new server code works (have you tested it) with previous clients?

Thanks for pointing on this. I tested and it didn't work.

I updated game version and added client version check in server functions.

mhirki commented 3 years ago

I think adding 7 new packet types is a total waste. Everything should be compressed into a single new packet with 32 bits reserved for flags.

EvgenijK commented 3 years ago

I think adding 7 new packet types is a total waste. Everything should be compressed into a single new packet with 32 bits reserved for flags.

I see two variants of this: 1) Send flags to toggle the indicators, i.e. if the indicator flag is in the packet, then toggle it on interface. This way requires to store flags on client. 2) Send flags as state of indicators - if flag is set in the packet, then draw indicator, if flag isn't set, then erase it. There is no need to store info in this variant, but we have to send info about all indicators each time.

I hope i explained this variants clearly enough. Personally I more like second variant.

What do you think, what would be better solution?

jezek commented 3 years ago

@EvgenijK

What do you think, what would be better solution?

I would opt for the second variant too.

mhirki commented 3 years ago

Yeah, variant 2 is definitely the answer.

EvgenijK commented 3 years ago

@jezek @mhirki I made changes, waiting for the review.

jezek commented 3 years ago

I've tested this PR. After merging to current mater, it compiles (server+client) on ubuntu 20.10 without introducing new warnings. I've also tested new (4.7.3.1) server against new (4.7.3.1) and old (4.7.3) client and vice versa. Everything works as described in this PR, no bugs spotted.

mhirki commented 3 years ago

Thanks for the testing jezek. I did my own testing and everything seems to work. I'm gonna merge the code now.