Bug 3291 - !buildlog and !revert to combat grief building
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Admin system
Version: unspecified
Hardware: All All
: P5 enhancement
Assignee: Tony J. White
QA Contact: Tremulous Bugs
URL:
Depends on:
Blocks:
 
Reported: 2007-07-31 21:30 EDT by Ben Millwood
Modified: 2010-05-23 13:33:42 EDT
1 user (show)

See Also:


Attachments
the patch (29.43 KB, patch)
2007-07-31 21:31 EDT, Ben Millwood
!buildlog alone (14.21 KB, patch)
2007-07-31 21:34 EDT, Ben Millwood
add revert to buildlog (19.01 KB, patch)
2007-07-31 21:35 EDT, Ben Millwood
rezyn's latest adaptation (21.64 KB, patch)
2010-02-07 17:01 EST, Chris "Lakitu7" Schwarz

Description Ben Millwood 2007-07-31 21:30:09 EDT
This is a feature that I've been working on for a while, it's quite complex but does I think have the potential to be very useful.

(copy, switch tabs, paste:)



== 1.1 Build logging and rewind capability =======

=== Links ===============
http://www.bandstand.org.uk/~benm/trem/buildlog964-6.patch
http://www.bandstand.org.uk/~benm/trem/buildlog964-clipped-1.patch
http://www.bandstand.org.uk/~benm/trem/unclip.patch

=== Summary =============
SVN: 964
Status: Released with moderate testing (version 6)
Admin flags: UR
Admin commands: !buildlog, !revert
Cvars: g_buildLogMaxLength ("25")

Every event that changes the buildable layout, buildings, deconstructions, and
destructions, is logged: this log can be read by the !buildlog command, flag U.
!buildlog takes one argument of the form (number)(a|h) where number is the 
position to start reading from and a|h filters the log by team.
Build log entries can be reverted with the !revert command (flag R) which also
takes one argument of the same form to indicate number of reversions or team
to revert. If reverting the removal of a buildable would conflict with a 
currently existing buildable (rare but possible), a warning is printed. The 
admin may then do the same command with an ! appended to the argument to 
override the warning and permanently overwrite the existing buildable.

=== Description =========
This is my most complex patch to date, requiring four helper functions, a new
struct and enum, and pointers all over the shop. Past versions have caused 
segmentation faults, infinite loops, and memory leaks, so although I am fairly
confident I have stamped out all the potential problems I still feel a 
compulsion to label it as a beta release or some such nonsense.
If a buildable is taken down to zero health, the destruction is logged then, 
and not when it explodes. If this destruction is reverted immediately the dead
buildable is quietly removed and no damage is done. If a player is standing 
where the buildable was, then the buildable is placed intangibly and players 
inside it are ejected with considerable force. When the buildable is clear,
it solidifies and resumes normal function.
To help evade abuse, a message is printed to the whole server every time
either of these commands are used, and !revert prints every action that was
undone.

==== Issues ========
Reverts are irreversible: if an admin accidentally reverts an important 
destruction or build, the action cannot be undone.
It is possible to abuse reversion and buildlog: if you suspect a move by the
enemy, you can use the log to choose a prime moment to attack or better still, 
!revert the reactor away mid-build; if your own move runs into problems, simply 
revert back to default base and all is well, and one more: 1) grab psaw 2) find
egg 3) saw 4) !revert 5) saw again 6) ??? 7) profit!
If a buildable is overwritten by a revert then its build remains logged and 
cannot be reverted, preventing the reverting of any earlier events. This is a 
bug.
Comment 1 Ben Millwood 2007-07-31 21:31:46 EDT
Created attachment 1462 [details]
the patch

This patch adds a new struct, enum, some new building functions, and two admin commands: !buildlog (flag U) and !revert (flag R)
Comment 2 Ben Millwood 2007-07-31 21:34:26 EDT
Created attachment 1463 [details]
!buildlog alone

Having heard that some people might object to !revert on the basis of possible abuse, here is a patch that adds !buildlog only. All the !revert functions and struct members have been cleaned up, there is no redundant code left.
Comment 3 Ben Millwood 2007-07-31 21:35:53 EDT
Created attachment 1464 [details]
add revert to buildlog

Just in case, here is the diff between !buildlog and both features together (i.e. adding !revert to my previous patch). It's a patch -p1 because I'm still not very good at diff.
Comment 4 Tim Angus 2007-09-22 17:27:14 EDT
Setting "Component" to "Admin system".
Comment 5 Ben Millwood 2007-11-18 09:14:09 EST
I've since released better versions of these commands but decided not to bother keeping this bug up to date, since it's unlikely to be ever committed. Closed so that (hopefully) people realise this is not the place from which to get the patch.
Comment 6 Chris "Lakitu7" Schwarz 2010-02-07 17:01:06 EST
I'd like to bring this one back to proposal. In subsequent years of work by Benmachine and Rezyn, the implementation and interface have been streamlined. More importantly, despite all our hopes to the contrary, markdecon has not weakened the threat of grief building sufficiently to make these patches no longer necessary. We do have decons fairly frequently on the Official severs, and while admins can kick and ban, without these functions, nothing can bring back a game from ruin. Nobody likes seeing a 50+ minute game end in a decon; it feels like all that time is wasted. 

There is a clamor to put these functions on the official servers, and I must agree. I also believe that trunk should contain everything necessary to properly run a Tremulous server without requiring third party patches, and as such, if the Official servers need something, it should be trunked.

Attached is the latest patch by Rezyn, adapted from Benmachine's earlier work. Objections?
Comment 7 Chris "Lakitu7" Schwarz 2010-02-07 17:01:48 EST
Created attachment 2293 [details]
rezyn's latest adaptation
Comment 8 Chris "Lakitu7" Schwarz 2010-05-23 13:33:42 EDT
Finally in (after lots more iterating) at r2020.