Bug 2857 - Designated builders feature
Status: NEW
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Admin system
Version: unspecified
Hardware: PC All
: P4 enhancement
Assignee: Tony J. White
QA Contact: Tremulous Bugs
URL:
Depends on:
Blocks:
 
Reported: 2006-08-31 08:58 EDT by Martin Doucha
Modified: 2010-07-25 10:19:25 EDT
1 user (show)

See Also:


Attachments
Partial patch (7.49 KB, patch)
2006-08-31 09:30 EDT, Martin Doucha
Second partial patch (9.50 KB, patch)
2006-09-01 09:13 EDT, Martin Doucha
Third partial patch (13.02 KB, patch)
2006-09-03 08:40 EDT, Martin Doucha
Modified third partial patch (14.50 KB, patch)
2006-09-03 15:22 EDT, Martin Doucha
Complete patch (15.24 KB, patch)
2006-09-12 05:14 EDT, Martin Doucha
svn824 designated builder (15.44 KB, patch)
2006-09-25 15:04 EDT, Tony J. White
Cancel protection before structure explodes (1.02 KB, patch)
2006-09-27 15:19 EDT, Martin Doucha
SVN829 designated builder (18.15 KB, patch)
2006-10-14 05:42 EDT, Martin Doucha
typo-free SVN829 designated builder (18.15 KB, patch)
2006-10-14 12:11 EDT, Martin Doucha
SVN1006 designated builder (27.13 KB, patch)
2007-09-24 13:36 EDT, Martin Doucha

Description Martin Doucha 2006-08-31 08:58:56 EDT
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.
Comment 1 Martin Doucha 2006-08-31 09:30:40 EDT
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.
Comment 2 Martin Doucha 2006-09-01 09:13:27 EDT
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
Comment 3 Martin Doucha 2006-09-03 08:40:11 EDT
Created attachment 1053 [details]
Third partial patch

Another field testing patch, this time with teamvotes. The only thing left to do is persistent designation.
Comment 4 Martin Doucha 2006-09-03 15:22:13 EDT
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.
Comment 5 Martin Doucha 2006-09-12 05:14:26 EDT
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.
Comment 6 Tony J. White 2006-09-25 15:04:25 EDT
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.
Comment 7 Martin Doucha 2006-09-27 15:19:26 EDT
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.
Comment 8 Martin Doucha 2006-10-14 05:42:50 EDT
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().
Comment 9 Martin Doucha 2006-10-14 12:11:52 EDT
Created attachment 1118 [details]
typo-free SVN829 designated builder

Sorry, I've left a little typo in the previous patch.
Comment 10 Tim Angus 2007-09-22 17:27:13 EDT
Setting "Component" to "Admin system".
Comment 11 Martin Doucha 2007-09-24 13:36:18 EDT
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.
Comment 12 Khalsa 2009-10-08 01:20:45 EDT
I vote this has been superceded by mark deconstruct and all the bp changes.
Comment 13 WilliamH 2010-07-25 10:19:25 EDT
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.