blue-nebula / base

Main repository of Blue Nebula, a fast-paced shooter with a unique parkour system. It is a fork of Red Eclipse and is free software.
https://blue-nebula.org
15 stars 6 forks source link

Split teamkilling moderation for bots and players #233

Closed voidanix closed 2 years ago

voidanix commented 2 years ago

This PR introduces a new variable name teamkillsplitactortype which moderates team killing based on the actor type of the target.

There are also six new variables to moderate between the players and bots:

playerteamkillwarn
playerteamkillkick
playerteamkillban

botteamkillwarn
botteamkillkick
botteamkillban

I have tested this on a private server with only bots and it seems to work correctly.

This PR will not break compatibility with existing 1.6.0 servers.

Fixes #186

TheAssassin commented 2 years ago

Unsure if this breaks compatibility with existing 1.6.0 servers.

This will alter gameplay to some extent, but in a positive way that also applies to existing clients.

I'm concerned that the variables will require a protocol break, though. I'm not entirely sure, but I think that variables are implicitly assigned an index (IIRC some enum will be generated using these macros or something like that), and that they are transmitted to the clients by those indexes. Old clients might not be able to deal with the new variables and might assign the wrong values to the variables they know.

voidanix commented 2 years ago

It seems that changing variables on a server is completely server-side: if the variable is not supported on the server, then an unknown variable message will show up.

If it is not supported by the client then they can still execute/modify that variable because the server provides it (it autocompletes too).

tl;dr this will not break compatibility with existing servers, I will update the PR body to reflect that.

TheAssassin commented 2 years ago

That sounds great, thank you. I'll try to validate your results tonight, too, to further make sure that we don't run into compatibility issues.

A detailed code review will follow afterwards.

TheAssassin commented 2 years ago

Thank you!