3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Weapon Limiter * * Configuration File * * Console script for Battlefield Play4Free community. * Kicks players with forbidden weapons like shotguns on selected server. * * @category BFP4F * @package limiter * @author piqus <ovirendo@gmail.com> * @license MIT http://opensource.org/licenses/MIT * @version 0.3 * @link https://github.com/piqus/bfp4f-limiter */ /* Environment Configuration ***************************/ ini_set('max_execution_time', 20); date_default_timezone_set('Europe/London'); // Load composer vendors define('VENDOR_DIR', __DIR__ . '/vendor'); /* Load Classes for COMPOSER ***************************/ //require_once VENDOR_DIR.'/autoload.php'; //# or if you don't have composer #// foreach (glob("src/T4G/BFP4F/Rcon/*.php") as $class) { require_once $class; } /* Connect to DB ********************/ define('DB_TYPE', 'mysql'); define('DB_HOST', 'localhost'); define('DB_PORT', '3306'); define('DB_USER', 'root'); define('DB_PASS', 'password'); define('DB_NAME', 'limiter'); if (DB_TYPE=="mongodb") { require_once __DIR__ . '/DB-mongo.php'; } else { require_once __DIR__ . '/DB-pdosql.php'; } $db = new DB(); /* Limiter Configuration ***********************/ $configs = array( /* ------------------------------------ * GENERAL * ------------------------------------ */ // Server IP 'general.server_ip' => "127.0.0.1", //Server PORT 'general.server_port' => (int) 1337, // Server PASSWORD 'general.server_password' => "rcon_password", // Is a whole script enabled (force disable script)? 'general.script_enabled' => true, // Ignore VIPs 'general.ignore_vips' => false, // Ignore selected player to check their weapon slots? 'general.ignored_players_enabled' => false, // List of ignored players // # Profile IDs spearated by commas // # Use strings (values in quotes) instead of numeric 'general.ignored_players' => array( "2627733530", ), /* ------------------------------------ * DATABASE * ------------------------------------ */ // Collection/Table of Logs 'db.colLogs' => 'logs', // Collection/Table of Cache 'db.colCache' => 'cache', /* ------------------------------------ * WEAPON LIMITER SCRIPT * ------------------------------------ * + Weapon Limiter * + Prebuy Limiter */ // Kick for carrying disallowed weapon 'weaponLimiter.weapon_limiter_enabled' => true, // Which weapons are disallowed on server // # You may find IDs of weapon in (vendor/piqus/bfp4f-rcon/)src/T4G/BFP4F/Rcon/Support.php 'weaponLimiter.weapon_limiter_restricted_guns' => array( 3048, // MG36 3120, // FAMAS ), // Kick for prebuy? 'weaponLimiter.prebuy_limiter_enabled' => true, // Which weapons are checking for prebuy thingie 'weaponLimiter.prebuy_limiter_restricted_guns' => array( 3127, // L85A2 3128, // PKP PECHENEG 3122, // AS-VAL ), // If selected player was kicked how long (in minutes) he won't be able to rejoin server 'weaponLimiter.cache_threshold' => (int) 15, // Custom Autokick Message // # %player% - person managed to leave, soldier name // # %weapon% - found gun which violates Weapon or Prebuy Limiter // # %type% - "Prebuy Limiter" or "Weapon Limiter" // # %script% - "Prebuy Limiter" or "Weapon Limiter" // # %level% - soldier level // # %kit% - soldier class 'weaponLimiter.custom_message' => "%player% you are being autokicked (%script% - %weapon%)", // Custom Global Message triggered when player is being kicked (when script uses loadout cache from DB) // # %player% - person managed to leave, soldier name // # %weapon% - found gun which violates Weapon or Prebuy Limiter // ! Set up as empty string ("") or type (bool) false if you would like to disable this feature 'weapon.cache_msg' => "|ccc| %player% |ccc| please back in next X minutes because we are using cache", /* ------------------------------------ * LEVEL LIMITER SCRIPT * ------------------------------------ */ // Enable Level Limiter? 'levelLimiter.script_enabled' => true, // Kick soldiers below X level (not equal) // # -1 to disable // # 0 to kick -1 glitchers 'levelLimiter.kick_below_level' => (int) 0, // Kick soldiers above X level (not equal) // # 30 to disable 'levelLimiter.kick_above_level' => (int) 30, // Custom Autokick Message // # %player% - person managed to leave, soldier name // # %type% - "Below" or "Above" // # %script% - "Level Limiter" // # %level% - soldier level // # %kit% - soldier class // # Note: You may concatenate required levels using . (dot) operator. 'levelLimiter.custom_message' => "%player% you are being autokicked (level required: 0-30)", /* ------------------------------------ * CLASS LIMITER SCRIPT * ------------------------------------ */ // Enable Class Limiter? 'classLimiter.script_enabled' => false, // How many assaults can be on server per one team? 'classLimiter.max_assaults' => (int) 16, // How many engineers can be on server per one team? 'classLimiter.max_engineers' => (int) 16, // How many medics can be on server per one team? 'classLimiter.max_medics' => (int) 16, // How many recons can be on server per one team? 'classLimiter.max_recons' => (int) 16, // Custom Autokick Message // # %player% - person managed to leave, soldier name // # %script% - "Class Limiter" // # %level% - soldier level // # %kit% - soldier class 'classLimiter.custom_message' => "%player% you are being autokicked (%script%; %kit%)", ); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/jmfCL
function name:  (null)
number of ops:  88
compiled vars:  !0 = $class, !1 = $db, !2 = $configs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'max_execution_time'
          2        SEND_VAL                                                 20
          3        DO_ICALL                                                 
   22     4        INIT_FCALL                                               'date_default_timezone_set'
          5        SEND_VAL                                                 'Europe%2FLondon'
          6        DO_ICALL                                                 
   25     7        INIT_FCALL                                               'define'
          8        SEND_VAL                                                 'VENDOR_DIR'
          9        SEND_VAL                                                 '%2Fin%2Fvendor'
         10        DO_ICALL                                                 
   32    11        INIT_FCALL                                               'glob'
         12        SEND_VAL                                                 'src%2FT4G%2FBFP4F%2FRcon%2F%2A.php'
         13        DO_ICALL                                         $6      
         14      > FE_RESET_R                                       $7      $6, ->18
         15    > > FE_FETCH_R                                               $7, !0, ->18
   34    16    >   INCLUDE_OR_EVAL                                          !0, REQUIRE_ONCE
   32    17      > JMP                                                      ->15
         18    >   FE_FREE                                                  $7
   39    19        INIT_FCALL                                               'define'
         20        SEND_VAL                                                 'DB_TYPE'
         21        SEND_VAL                                                 'mysql'
         22        DO_ICALL                                                 
   41    23        INIT_FCALL                                               'define'
         24        SEND_VAL                                                 'DB_HOST'
         25        SEND_VAL                                                 'localhost'
         26        DO_ICALL                                                 
   42    27        INIT_FCALL                                               'define'
         28        SEND_VAL                                                 'DB_PORT'
         29        SEND_VAL                                                 '3306'
         30        DO_ICALL                                                 
   43    31        INIT_FCALL                                               'define'
         32        SEND_VAL                                                 'DB_USER'
         33        SEND_VAL                                                 'root'
         34        DO_ICALL                                                 
   44    35        INIT_FCALL                                               'define'
         36        SEND_VAL                                                 'DB_PASS'
         37        SEND_VAL                                                 'password'
         38        DO_ICALL                                                 
   45    39        INIT_FCALL                                               'define'
         40        SEND_VAL                                                 'DB_NAME'
         41        SEND_VAL                                                 'limiter'
         42        DO_ICALL                                                 
   47    43        FETCH_CONSTANT                                   ~15     'DB_TYPE'
         44        IS_EQUAL                                                 ~15, 'mongodb'
         45      > JMPZ                                                     ~16, ->48
   48    46    >   INCLUDE_OR_EVAL                                          '%2Fin%2FDB-mongo.php', REQUIRE_ONCE
         47      > JMP                                                      ->49
   50    48    >   INCLUDE_OR_EVAL                                          '%2Fin%2FDB-pdosql.php', REQUIRE_ONCE
   53    49    >   NEW                                              $19     'DB'
         50        DO_FCALL                                      0          
         51        ASSIGN                                                   !1, $19
   67    52        INIT_ARRAY                                       ~22     '127.0.0.1', 'general.server_ip'
   70    53        CAST                                          4  ~23     1337
         54        ADD_ARRAY_ELEMENT                                ~22     ~23, 'general.server_port'
   73    55        ADD_ARRAY_ELEMENT                                ~22     'rcon_password', 'general.server_password'
   67    56        ADD_ARRAY_ELEMENT                                ~22     <true>, 'general.script_enabled'
         57        ADD_ARRAY_ELEMENT                                ~22     <false>, 'general.ignore_vips'
         58        ADD_ARRAY_ELEMENT                                ~22     <false>, 'general.ignored_players_enabled'
         59        ADD_ARRAY_ELEMENT                                ~22     <array>, 'general.ignored_players'
   97    60        ADD_ARRAY_ELEMENT                                ~22     'logs', 'db.colLogs'
  100    61        ADD_ARRAY_ELEMENT                                ~22     'cache', 'db.colCache'
   67    62        ADD_ARRAY_ELEMENT                                ~22     <true>, 'weaponLimiter.weapon_limiter_enabled'
         63        ADD_ARRAY_ELEMENT                                ~22     <array>, 'weaponLimiter.weapon_limiter_restricted_guns'
         64        ADD_ARRAY_ELEMENT                                ~22     <true>, 'weaponLimiter.prebuy_limiter_enabled'
         65        ADD_ARRAY_ELEMENT                                ~22     <array>, 'weaponLimiter.prebuy_limiter_restricted_guns'
  130    66        CAST                                          4  ~24     15
         67        ADD_ARRAY_ELEMENT                                ~22     ~24, 'weaponLimiter.cache_threshold'
  139    68        ADD_ARRAY_ELEMENT                                ~22     '%25player%25+you+are+being+autokicked+%28%25script%25+-+%25weapon%25%29', 'weaponLimiter.custom_message'
  146    69        ADD_ARRAY_ELEMENT                                ~22     '%7Cccc%7C+%25player%25+%7Cccc%7C+please+back+in+next+X+minutes+because+we+are+using+cache', 'weapon.cache_msg'
   67    70        ADD_ARRAY_ELEMENT                                ~22     <true>, 'levelLimiter.script_enabled'
  159    71        CAST                                          4  ~25     0
         72        ADD_ARRAY_ELEMENT                                ~22     ~25, 'levelLimiter.kick_below_level'
  163    73        CAST                                          4  ~26     30
         74        ADD_ARRAY_ELEMENT                                ~22     ~26, 'levelLimiter.kick_above_level'
  172    75        ADD_ARRAY_ELEMENT                                ~22     '%25player%25+you+are+being+autokicked+%28level+required%3A+0-30%29', 'levelLimiter.custom_message'
   67    76        ADD_ARRAY_ELEMENT                                ~22     <false>, 'classLimiter.script_enabled'
  183    77        CAST                                          4  ~27     16
         78        ADD_ARRAY_ELEMENT                                ~22     ~27, 'classLimiter.max_assaults'
  186    79        CAST                                          4  ~28     16
         80        ADD_ARRAY_ELEMENT                                ~22     ~28, 'classLimiter.max_engineers'
  189    81        CAST                                          4  ~29     16
         82        ADD_ARRAY_ELEMENT                                ~22     ~29, 'classLimiter.max_medics'
  192    83        CAST                                          4  ~30     16
         84        ADD_ARRAY_ELEMENT                                ~22     ~30, 'classLimiter.max_recons'
  199    85        ADD_ARRAY_ELEMENT                                ~22     '%25player%25+you+are+being+autokicked+%28%25script%25%3B+%25kit%25%29', 'classLimiter.custom_message'
   59    86        ASSIGN                                                   !2, ~22
  203    87      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.7 ms | 1404 KiB | 21 Q