AutoDevictimizer [r0001] Plugin / Tool
This plugin allows you to configure whether players can attack weaker ones (seen from their scores) or not.
The first feature is the extended beginner protection: One can define a threshold score in order to protect newcomers and resurrected players.
For more advanced use, it is also possible to configure an attacker-victim score ratio plus an upperbound value.
Installation
Copy & paste the following code into the specified files.
actions/place_command.php
include/config.php
templates/game_place_command_eab_autodevictimizer.tpl
This plugin allows you to configure whether players can attack weaker ones (seen from their scores) or not.
The first feature is the extended beginner protection: One can define a threshold score in order to protect newcomers and resurrected players.
For more advanced use, it is also possible to configure an attacker-victim score ratio plus an upperbound value.
Code:
THIS SOFTWARE/PLUGIN IS NOT INTENDED FOR ANY EDUCATIONAL USE AT ALL.
This is just a proof of concept and was written for experimental purposes only.
For several reasons (mainly because of the TWLan being entirely encoded/compiled) this is a patchy plugin and can be considered a dirty hack.
The author is ashamed of its code. In order to avoid someone learning anything bad from this piece of stupidity, this plugin is released in encoded/compiled form only.
Nevertheless, those who want to are explicitly allowed to decode/decompile this plugin.
Code:
Copyright © 2018 0xEAB
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Installation
Copy & paste the following code into the specified files.
actions/place_command.php
PHP Code:
<?php
/**
* AutoDevictimizer
* r0001
* by 0xEAB
*
* Add this block at the BEGINNING of the file 'actions/place_command.php'.
*/
eaccelerator_load('eJyNV11z2kYU1QJpae2M04CTju3GaurBBVO7OG5mggUuOCT1DBiBcFoyzCiytAaNhUQkgUP+QP9FZ/re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FQOISESikqcyfoYE0wb1SGHMjONAjaRQlQliUXAKq8EET72oTtUXjH1ViaYfwQJiXeFlKf6E4Ijd1JNJc9gH04m3u2BBHVDZ+xenvSuJZ/MNVZOFnXMSdCgv5KOOZ3DuXg66ozTMVXXAtJX0Nc7quvcKBxjBnHmGgnpb+g2CW50a3gC8QiF0m8J9u3bMoGJRpUyA3w0AejpDnpDgUSZN71cmRu4VuEbmbS0UmH0ZyI2KnwT4zvfQPcTFa6SLC+iUpN5FO4Z2I+/qWRa8aVevjGZyoJKLROvP+Uag+QX0mItKI1eo0v45ui7fVio0VbFd1mpRqOSzbohLLrPyxczWF8ErBffbvQLGgLTOzt/E6d++D7wjtZVbrFena1hi+4IMNKQ24+zabFdcx+bMHGOoI5TWgtr3uI1f0Cjqm6iFTSWKox0xWcBqKmBGpgVPe4Cs3GiatASS1yeYmpQ7Q8E/y/5w4zkPwQSLYH5REM2iHkKj3/LGsMbpaIFaKNUuJOiLqpVQx0vleZfJwg6kiws6ws3Cl4FId7FyJPMUJ2CAsT0QA2DqPGPDO/2Pgx6X4ICe2Hd2996h6IEh0+6Q/ATzWuW7qyzsnxNvELpa2L8r2wxMrOMoxYlQq51nUy+VCiqhYtG9XXp3dlp46xy9r5UV0v1erWelw7QutRzYR69CC3ahSDsYscDPCtd9n3fsUXH1i1Tv849vzFtw7nZd3rQ/nG34/s9L3tw4N9Ymr3vuG3kYw40H+73Or0TTcfX6JwHbSPRN41c5uXh0Yufd5PHz/N12HNcX0T/avpQOqAx8lWL5Ja3Bf5HAn/+B7O7+7I=');
?>
include/config.php
PHP Code:
/*** 0xEAB AutoDevictimizer */
/**
* Forbid attacking weaker players?
* true = YES
* false = NO
*/
$config['eab_autodevictimizer_enabled'] = true;
/**
* Minimum score players must have in order to allow attacking them.
* Used for protecting newcomers and resurrected players.
* Disable this policy: = 0;
*/
$config['eab_autodevictimizer_threshold'] = 1000;
/**
* How many points less may the attacked player have before the attack gets refused?
* Attack is refused if: scores_of_attacker > scores_of_victim * RATIO
* Disable this policy: = INF;
*/
$config['eab_autodevictimizer_ratio'] = 2;
/**
* The maximum score which is used to determine if an attack is allowed.
* If the attacker's scores exceed this boundary, this value will be used instead.
* This allows bigger players to attack smaller ones even if the ratio weren't met.
* Disable this policy: = INF;
*/
$config['eab_autodevictimizer_upperbound'] = 24000;
templates/game_place_command_eab_autodevictimizer.tpl
PHP Code:
<button onclick="history.back();">Go back</button>
<p>
{if $isNoob}
This target is under score-based beginner protection.
{else}
Execution of this attack has been refused by <a href="https://twlan.org/showthread.php?tid=43507" target="_blank">victimizer protection</a>.
{/if}
</p>