Tremulous needs some sort of protection against griefers and noob builders. That might be designated builder who could place decon protection on some structures so nondesignated builders could not decon them.
Created attachment 1050[details]
Partial patch
This patch is what I wrote so far. Current features:
- !(un)designate admin command, gives and revokes designated builder privileges, uses 'd' flag in admin.dat
- any structure built by designated builder is automatically protected
- only designated builder can decon protected structures
- designated builder can toggle structure protection using the reload key (only works for grangers and humans with ckit)
TODO:
!!! DB presence check - when the team has no designated builder, all structures should lose protection
- teamvote (un)designation
- list of persistent designated builders
- temporary (teamvote/admin command) designation should be revoked on teamchange
Right now, I need a little help with finding the right place for DB presence check. If all designated builders of one team leave or lose designation while the base is still protected, it might make more harm than good. CalculateRanks() might be a good place, however, it would check too often (each time somebody dies). Another possibility is doing the check in ClientDisconnect(), G_admin_designate() and some teamchange function.
Created attachment 1051[details]
Second partial patch
This patch should be ready for some field testing. I've made the G_CheckDBProtection() function that checks for DB presence in teams and if none found, it will cancel protection on structures. This function is called from G_admin_designate(), ClientDisconnect() and G_ChangeTeam(). The designated builder status is now revoked on teamchange.
TODO:
- teamvote designation
- persistent designated builder list
- field testing
Created attachment 1053[details]
Third partial patch
Another field testing patch, this time with teamvotes. The only thing left to do is persistent designation.
Created attachment 1055[details]
Modified third partial patch
This patch is a small improvement of structure protection toggle and it adds /resign command I forgot to add earlier. Designated builders can now toggle structure protection by pressing the reload key when they're grangers or use ckit or they can use /protect command when they have evolved or bought gun.
Created attachment 1071[details]
Complete patch
This is the final patch. I've added permanent designation flag 'S' which is checked at each teamchange (if permanently designated builder is undesignated by teamvote, his/her designation will be restored on teamchange). The only thing left to do is testing.
Created attachment 1097[details]
svn824 designated builder
* I changed the 'S' flag to '#' (letters are only used for command flags by
convention)
* Reformatted to match tremulous coding style.
I'm currently running this on my server and will apply to SVN after some testing. Thanks.
Created attachment 1099[details]
Cancel protection before structure explodes
This patch cancels both DB and SD protection of structures which are about to blow up. It allows all builders to prevent unnecessary damage to other structures.
Created attachment 1117[details]
SVN829 designated builder
I've added designation status to !listplayers (D = designated, P = permanent designation) and DBCommand() to send commands only to designated builders of one team. When somebody tries to decon a protected structure, designated builders will be notified through DBCommand().
Created attachment 1520[details]
SVN1006 designated builder
Here's an update of designated builder for SVN1006.
New features compared to the last patch:
- G_FreeBuildableAllowed() - function which tests if the player is allowed to free a marked buildable and use the buildpoints
- G_DeconstructAllowed() - function which tests if the player is allowed to decon/mark/unmark a buildable
- designation voting code has been updated to keep up with current teamvote code
- added UI scripts voteTeamDesignate and voteTeamUndesignate for use in vote menus, the menus are not changed yet though.
- marked deconstruct is now abused to prevent buildpoint stealing
How marked deconstruct abuse works? When somebody builds useless crap on the other side of map, the designated builder can simply protect it and mark it. Then nobody but a designated builder is allowed to use those buildpoints until structure protection has been turned off.
I've handcrufted (no, it's not a typo) the patch from KOCOUR-CZ DEV patch which had a few extra features and originally removed denybuild so there might be some hidden bugs. This patch doesn't touch denybuild but a replacement patch is also available if somebody would want it. Anyway, patched SVN1006 compiles cleanly and a few minutes of playtesting on localhost didn't crash the server.
How does mark deconstruct help control who is building? If people go around marking things, they can cause problems even without actually building anything. Because of the bp changes, it matters more when a structure is moved to a bad spot or at the wrong time, not less. Personally I'd really like to see this.
Created attachment 1050 [details] Partial patch This patch is what I wrote so far. Current features: - !(un)designate admin command, gives and revokes designated builder privileges, uses 'd' flag in admin.dat - any structure built by designated builder is automatically protected - only designated builder can decon protected structures - designated builder can toggle structure protection using the reload key (only works for grangers and humans with ckit) TODO: !!! DB presence check - when the team has no designated builder, all structures should lose protection - teamvote (un)designation - list of persistent designated builders - temporary (teamvote/admin command) designation should be revoked on teamchange Right now, I need a little help with finding the right place for DB presence check. If all designated builders of one team leave or lose designation while the base is still protected, it might make more harm than good. CalculateRanks() might be a good place, however, it would check too often (each time somebody dies). Another possibility is doing the check in ClientDisconnect(), G_admin_designate() and some teamchange function.
Created attachment 1051 [details] Second partial patch This patch should be ready for some field testing. I've made the G_CheckDBProtection() function that checks for DB presence in teams and if none found, it will cancel protection on structures. This function is called from G_admin_designate(), ClientDisconnect() and G_ChangeTeam(). The designated builder status is now revoked on teamchange. TODO: - teamvote designation - persistent designated builder list - field testing
Created attachment 1053 [details] Third partial patch Another field testing patch, this time with teamvotes. The only thing left to do is persistent designation.
Created attachment 1055 [details] Modified third partial patch This patch is a small improvement of structure protection toggle and it adds /resign command I forgot to add earlier. Designated builders can now toggle structure protection by pressing the reload key when they're grangers or use ckit or they can use /protect command when they have evolved or bought gun.
Created attachment 1071 [details] Complete patch This is the final patch. I've added permanent designation flag 'S' which is checked at each teamchange (if permanently designated builder is undesignated by teamvote, his/her designation will be restored on teamchange). The only thing left to do is testing.
Created attachment 1097 [details] svn824 designated builder * I changed the 'S' flag to '#' (letters are only used for command flags by convention) * Reformatted to match tremulous coding style. I'm currently running this on my server and will apply to SVN after some testing. Thanks.
Created attachment 1099 [details] Cancel protection before structure explodes This patch cancels both DB and SD protection of structures which are about to blow up. It allows all builders to prevent unnecessary damage to other structures.
Created attachment 1117 [details] SVN829 designated builder I've added designation status to !listplayers (D = designated, P = permanent designation) and DBCommand() to send commands only to designated builders of one team. When somebody tries to decon a protected structure, designated builders will be notified through DBCommand().
Created attachment 1118 [details] typo-free SVN829 designated builder Sorry, I've left a little typo in the previous patch.
Created attachment 1520 [details] SVN1006 designated builder Here's an update of designated builder for SVN1006. New features compared to the last patch: - G_FreeBuildableAllowed() - function which tests if the player is allowed to free a marked buildable and use the buildpoints - G_DeconstructAllowed() - function which tests if the player is allowed to decon/mark/unmark a buildable - designation voting code has been updated to keep up with current teamvote code - added UI scripts voteTeamDesignate and voteTeamUndesignate for use in vote menus, the menus are not changed yet though. - marked deconstruct is now abused to prevent buildpoint stealing How marked deconstruct abuse works? When somebody builds useless crap on the other side of map, the designated builder can simply protect it and mark it. Then nobody but a designated builder is allowed to use those buildpoints until structure protection has been turned off. I've handcrufted (no, it's not a typo) the patch from KOCOUR-CZ DEV patch which had a few extra features and originally removed denybuild so there might be some hidden bugs. This patch doesn't touch denybuild but a replacement patch is also available if somebody would want it. Anyway, patched SVN1006 compiles cleanly and a few minutes of playtesting on localhost didn't crash the server.