Skip to content

Commit

Permalink
Merge pull request #51 from 7mochi/remove-ghostmine
Browse files Browse the repository at this point in the history
feat: remove ghostmineblocker metamod plugin
  • Loading branch information
7mochi authored Sep 19, 2024
2 parents 7484f21 + 91c36d7 commit 099378c
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 63 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you have any problem in your server, before opening an issue or contacting me
- New intermission mode.
- More than 1 HLTV allowed.
- Force connected HLTV to have a certain delay value as a minimum (Minimum value is 30).
- Ghostmine Blocker.
- Nuke blocking capabilities (Lampgauss, ghostmine, rocket, etc)
- Simple OpenGF32 and AGFix detection (Through cheat commands).
- Take screenshots at map end and occasionally when a player dies.
- Avoid abusing a ReHLDS bug (Server disappears from the masterlist when it's' paused) only when there's no game in progress.
Expand All @@ -43,7 +43,15 @@ If you have any problem in your server, before opening an issue or contacting me
- sv_ag_block_namechange_inmatch "1"
- sv_ag_block_modelchange_inmatch "1"
- sv_ag_min_hltv_delay "30.0"
- sv_ag_block_ghostmine "1"
- sv_ag_nuke_grenade "0"
- sv_ag_nuke_crossbow "0"
- sv_ag_nuke_rpg "0"
- sv_ag_nuke_gauss "1"
- sv_ag_nuke_egon "0"
- sv_ag_nuke_tripmine "0"
- sv_ag_nuke_satchel "0"
- sv_ag_nuke_snark "0"
- sv_ag_explosion_fix "0"
- sv_ag_cheat_cmd_check_interval "5.0"
- sv_ag_cheat_cmd_max_detections "5"
- sv_ag_change_model_penalization "1"
Expand Down
12 changes: 10 additions & 2 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Si tienes algún problema en tu servidor, antes de abrir una issue o contactarme
- No se permiten cambios de nombre y model cuando hay una partida en curso (Opcional, ambos activados por defecto).
- Nuevo modo de espera al finalizar un mapa.
- Se fuerza al HLTV conectado a tener un cierto valor de delay como mínimo (Valor mínimo por defecto es 30).
- Bloqueador de ghostmines.
- Capacidades de bloqueo de nukes (Lampgauss, ghostmine, cohetes, etc)
- Detección simple de OpenGF32 y AGFix (Mediante comandos del cheat).
- Toma screenshots al termino de un mapa y ocasionalmente cuando un jugador muere.
- Se evita el abuso de un bug de ReHLDS (el servidor desaparece de la lista mundial cuando está pausado) solo cuando no hay una partida en curso.
Expand All @@ -42,7 +42,15 @@ Si tienes algún problema en tu servidor, antes de abrir una issue o contactarme
- sv_ag_block_namechange_inmatch "1"
- sv_ag_block_modelchange_inmatch "1"
- sv_ag_min_hltv_delay "30.0"
- sv_ag_block_ghostmine "1"
- sv_ag_nuke_grenade "0"
- sv_ag_nuke_crossbow "0"
- sv_ag_nuke_rpg "0"
- sv_ag_nuke_gauss "1"
- sv_ag_nuke_egon "0"
- sv_ag_nuke_tripmine "0"
- sv_ag_nuke_satchel "0"
- sv_ag_nuke_snark "0"
- sv_ag_explosion_fix "0
- sv_ag_cheat_cmd_check_interval "5.0"
- sv_ag_cheat_cmd_max_detections "5"
- sv_ag_change_model_penalization "1"
Expand Down
12 changes: 10 additions & 2 deletions README_PT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Se tiver um problema no seu servidor antes de abrir uma issue ou entrar em conta
- Não são permitidas mudanças de nome e model quando um jogo está em andamento (opcional ambos ativados por padrão).
- Novo modo de espera ao terminar um mapa.
- Es forçado a ter HLTV conectado um certo valor de delay pelo mínimo (o valor padrão mínimo é 30).
- Bloqueador de ghostmines.
- Capacidades de bloqueio de nukes (Lampgauss, ghostmine, rocket, etc.)
- Detecção simples de OpenGF32 e AGFix (Atraves do comandos do cheat).
- Faça screenshots no final de um mapa e ocasionalmente quando um jogador morre.
- Evite o abuso de um bug ReHLDS (o servidor desaparece da lista da mundial quando e pausado) apenas quando não há uma match em andamento.
Expand All @@ -41,7 +41,15 @@ Se tiver um problema no seu servidor antes de abrir uma issue ou entrar em conta
- sv_ag_block_namechange_inmatch "1"
- sv_ag_block_modelchange_inmatch "1"
- sv_ag_min_hltv_delay "30.0"
- sv_ag_block_ghostmine "1"
- sv_ag_nuke_grenade "0"
- sv_ag_nuke_crossbow "0"
- sv_ag_nuke_rpg "0"
- sv_ag_nuke_gauss "1"
- sv_ag_nuke_egon "0"
- sv_ag_nuke_tripmine "0"
- sv_ag_nuke_satchel "0"
- sv_ag_nuke_snark "0"
- sv_ag_explosion_fix "0"
- sv_ag_cheat_cmd_check_interval "5.0"
- sv_ag_cheat_cmd_max_detections "5"
- sv_ag_change_model_penalization "1"
Expand Down
4 changes: 0 additions & 4 deletions assets/addons/amxmodx/data/lang/llhl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ MINDELAY_HLTV_KICK = Delay of your HLTV is very low (Min: %.1f)
LLHL_FPS_LIMIT_MODE_AD = [%s] Both 144 and 240 fps are supported on this server. You can toggle between them with the fpslimitmode vote.
LLHL_INITIALIZING = [%s] Initializing plugin
LLHL_CANT_RUN = [%s] The '%s' plugin can only be run in the '%s' gamemode on AG 6.6 or its Mini version for HL
LLHL_GM_BLOCK_DEACTIVATED = [%s] GhostMine blocker has been deactivated
LLHL_REHLDS_DETECTED = [%s] ReHLDS detected, pauses will be blocked when there are no games in progress to avoid abusing a bug
LLHL_CHECK_GH_FAILED = [%s] Couldn't connect to Github API. Connection failed.
LLHL_CHECK_GH_PARSE_ERROR = [%s] An error occurred while parsing JSON. (Github)
Expand Down Expand Up @@ -68,7 +67,6 @@ MINDELAY_HLTV_KICK = El retraso de tu HLTV es muy bajo (Minimo: %.1f)
LLHL_FPS_LIMIT_MODE_AD = [%s] En este servidor se admiten tanto 144 como 240 fps. Puedes cambiar entre uno y otro con el voto fpslimitmode
LLHL_INITIALIZING = [%s] Inicializando el plugin
LLHL_CANT_RUN = [%s] El plugin '%s' solo puede ser ejecutado en el modo de juego '%s' en AG 6.6 o su version Mini para HL
LLHL_GM_BLOCK_DEACTIVATED = [%s] El bloqueador de GhostMine ha sido desactivado
LLHL_REHLDS_DETECTED = [%s] ReHLDS detectado, las pausas se bloquearan cuando no haya partidas en curso para evitar el abuso de un bug
LLHL_CHECK_GH_FAILED = [%s] No se pudo conectar a la API de Github. Conexión fallida.
LLHL_CHECK_GH_PARSE_ERROR = [%s] Ocurrio un error al parsear el JSON. (Github)
Expand Down Expand Up @@ -120,7 +118,6 @@ MINDELAY_HLTV_KICK = Seu atraso HLTV está muito baixo (Minimo: %.1f)
LLHL_FPS_LIMIT_MODE_AD = [%s] Tanto 144 como 240 fps são suportados neste servidor. Podes alternar entre os dois com o voto fpslimitmode
LLHL_INITIALIZING = [%s] Inicializando o plugin
LLHL_CANT_RUN = [%s] O plugin '%s' só pode ser executado no modo de jogo '%s' en AG 6.6 ou em sua versão Mini para HL
LLHL_GM_BLOCK_DEACTIVATED = [%s] O bloqueador GhostMine foi desativado
LLHL_REHLDS_DETECTED = [%s] ReHLDS detectado, as pausas serão bloqueadas quando não houver jogos em andamento para evitar o abuso de um bug
LLHL_CHECK_GH_FAILED = [%s] Não foi possível conectar à API do Github. A conexão falhou.
LLHL_CHECK_GH_PARSE_ERROR = [%s] Ocorreu um erro ao analisar o JSON. (Github)
Expand Down Expand Up @@ -172,7 +169,6 @@ MINDELAY_HLTV_KICK = 您的HLTV延时太短了. (允许的最短延时: %.1f)
LLHL_FPS_LIMIT_MODE_AD = [%s] 该服务器支持 144 和 240 fps。您可以通过投票 fpslimitmode 在两者之间切换
LLHL_INITIALIZING = [%s] 正在初始化插件...
LLHL_CANT_RUN = [%s] 插件 '%s' 只允许在AG 6.6中或装载了AG Mini的半条命中的 '%s' 游戏模式下运行.
LLHL_GM_BLOCK_DEACTIVATED = [%s] GhostMine Blocker 已被禁用.
LLHL_REHLDS_DETECTED = [%s] 检测到 ReHLDS, 为了避免发生错误,当没有比赛正在进行时,暂停功能将被禁用.
LLHL_CHECK_GH_FAILED = [%s] 无法连接到Github API,连接失败.
LLHL_CHECK_GH_PARSE_ERROR = [%s] 在解析 JSON 的过程中发生了错误. (Github)
Expand Down
Binary file removed assets/addons/metamod/dlls/gm_block_mm.dll
Binary file not shown.
Binary file removed assets/addons/metamod/dlls/gm_block_mm_i386.so
Binary file not shown.
2 changes: 0 additions & 2 deletions assets/addons/metamod/plugins.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
win32 addons/metamod/dlls/gm_block_mm.dll
win32 addons/amxmodx/dlls/amxmodx_mm.dll
linux addons/metamod/dlls/gm_block_mm_i386.so
linux addons/amxmodx/dlls/amxmodx_mm_i386.so
10 changes: 9 additions & 1 deletion assets/gamemodes/llhl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ sv_ag_block_namechange_inmatch "1"
sv_ag_block_modelchange_inmatch "1"
sv_ag_num_hltv_allowed "2"
sv_ag_min_hltv_delay "30.0"
sv_ag_block_ghostmine "1"
sv_ag_nuke_grenade "0"
sv_ag_nuke_crossbow "0"
sv_ag_nuke_rpg "0"
sv_ag_nuke_gauss "1"
sv_ag_nuke_egon "0"
sv_ag_nuke_tripmine "0"
sv_ag_nuke_satchel "0"
sv_ag_nuke_snark "0"
sv_ag_explosion_fix "0"
sv_ag_cheat_cmd_check_interval "5.0"
sv_ag_cheat_cmd_max_detections "5"
sv_ag_change_model_penalization "1"
Expand Down
3 changes: 1 addition & 2 deletions assets/motd_llhl_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ This gamemode is currently used for the Liga Latinoamericana de Half-Life (LLHL)
# New intermission mode
# More than 1 HLTV allowed
# Force connected HLTV to have a certain delay value as a minimum
# Wallhack Blocker
# Ghostmine Blocker
# Nuke blocking capabilities
# Simple OpenGF32 and AGFix detection
# Take screenshots at map end and occasionally when a player dies
# Changing model during a match subtract 1 from the score
Expand Down
3 changes: 1 addition & 2 deletions assets/motd_llhl_es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Este modo de juego se usa actualmente para la Liga Latinoamericana de Half-Life
# Nuevo modo de espera al terminar un mapa
# Permitidos mas de 1 HLTV
# Forzar a los HLTV a tener una cantidad de delay como minimo
# Bloqueador de Wallhack
# Bloqueador de Ghostmine
# Capacidades de bloqueo de Nukes
# Simple deteccion de los cheats OpenGF32 y AGFix
# Se toman screenshots al terminar el mapa y ocasionalmente cuando un jugador muere
# Cambiar de model durante una partida resta 1 de la puntuación
Expand Down
2 changes: 1 addition & 1 deletion assets/motd_llhl_pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Este modo de jogo é actualmente utilizado para a Liga Latinoamericana de Half-L
# Mais de 1 HLTV permitido
# Es forçado a ter HLTV conectado um certo valor de delay pelo mínimo
# Bloqueador de Wallhack
# Bloqueador de Ghostmine
# Capacidades de bloqueio de nukes
# Detecção simples de OpenGF32 e AGFix
# Faça screenshots no final de um mapa e ocasionalmente quando um jogador morre
# A mudança de model durante uma partida subtrai 1 da pontuação
Expand Down
59 changes: 14 additions & 45 deletions src/scripts/llhl.sma
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- New intermission mode
- More than 1 HLTV allowed
- Force connected HLTV to have a certain delay value as a minimum (Minimum value is 30)
- Ghostmine Blocker
- Nuke blocking capabilities (Lampgauss, ghostmine, rocket, etc)
- Simple OpenGF32 and AGFix detection (Through cheat commands)
- Take screenshots at map end and occasionally when a player dies
- Avoid abusing a ReHLDS bug (Server disappears from the masterlist when it's' paused) only when there's no game in progress.
Expand All @@ -46,7 +46,15 @@
- sv_ag_block_namechange_inmatch "1"
- sv_ag_block_modelchange_inmatch "1"
- sv_ag_min_hltv_delay "30.0"
- sv_ag_block_ghostmine "1"
- sv_ag_nuke_grenade "0"
- sv_ag_nuke_crossbow "0"
- sv_ag_nuke_rpg "0"
- sv_ag_nuke_gauss "1"
- sv_ag_nuke_egon "0"
- sv_ag_nuke_tripmine "0"
- sv_ag_nuke_satchel "0"
- sv_ag_nuke_snark "0"
- sv_ag_explosion_fix "0"
- sv_ag_cheat_cmd_check_interval "5.0"
- sv_ag_cheat_cmd_max_detections "5"
- sv_ag_change_model_penalization "1"
Expand Down Expand Up @@ -107,11 +115,6 @@
#define GAME_STARTING 1
#define GAME_RUNNING 2

// Is GhostMineBlock loaded?
#define GMB_NOTLOADED 0
#define GMB_LOADED 1 // Reserved for future use
#define GMB_BLOCKED 2 // Reserved for future use

// MM: Match Manager
#define MM_NO_TEAM "NO"
#define MM_BLUE_TEAM "BLUE"
Expand All @@ -129,7 +132,6 @@ enum _:LLHLFile {
}

new gGameState;
new gGhostMineBlockState;
new gNumDetections[MAX_PLAYERS + 1];
new gOldPlayerModel[MAX_PLAYERS + 1][HL_MAX_TEAMNAME_LENGTH];
new gDeathScreenshotTaken[MAX_PLAYERS + 1];
Expand All @@ -144,7 +146,6 @@ new gCvarBlockNameChangeInMatch;
new gCvarBlockModelChangeInMatch;
new gCvarNumHLTVAllowed;
new gCvarMinHLTVDelay;
new gCvarBlockGhostmine;
new gCvarCheatCmdCheckInterval;
new gCvarCheatCmdMaxDetections;
new gCvarChangeModelPenalization;
Expand Down Expand Up @@ -217,24 +218,11 @@ public plugin_init() {
new gamemode[32];
get_cvar_string("sv_ag_gamemode", gamemode, charsmax(gamemode));

// Check if GhostMineBlock is loaded even when the gamemode isn't LLHL
if (!cvar_exists("gm_block_on")) {
gGhostMineBlockState = GMB_NOTLOADED;
} else {
gGhostMineBlockState = GMB_LOADED;
}

if (!equali(gamemode, PLUGIN_GAMEMODE)) {
server_print("%L", LANG_SERVER, "LLHL_CANT_RUN", PLUGIN_ACRONYM, PLUGIN, PLUGIN_GAMEMODE);
// If GhostMineBlock is loaded and the gamemode isn't LLHL, it'll be deactivated
if (gGhostMineBlockState == GMB_LOADED) {
gGhostMineBlockState = GMB_BLOCKED;
set_cvar_num("gm_block_on", 0);
server_print("%L", LANG_SERVER, "LLHL_GM_BLOCK_DEACTIVATED", PLUGIN_ACRONYM);
// Try to load the default motd
server_cmd("motdfile motd.txt", PLUGIN_GAMEMODE);
server_exec();
}
// Try to load the default motd
server_cmd("motdfile motd.txt", PLUGIN_GAMEMODE);
server_exec();
pause("ad");
return;
}
Expand Down Expand Up @@ -280,10 +268,6 @@ public plugin_init() {

gGameState = GAME_IDLE;

if (gGhostMineBlockState == GMB_LOADED) {
gCvarBlockGhostmine = create_cvar("sv_ag_block_ghostmine", "1");
}

// Check updates from Github Repo
gCvarCheckUpdates = create_cvar("sv_ag_check_updates", "1");
gCvarCheckUpdatesRetrys = create_cvar("sv_ag_check_updates_retrys", "3");
Expand All @@ -297,13 +281,6 @@ public plugin_init() {
set_cvar_num("sv_proxies", get_pcvar_num(gCvarNumHLTVAllowed));
hook_cvar_change(gCvarNumHLTVAllowed, "CvarHLTVAllowedHook");
hook_cvar_change(get_cvar_pointer("sv_proxies"), "CvarSVProxiesHook");

if (cvar_exists("sv_ag_block_ghostmine")) {
// Reload GhostMineBlock original cvar
set_cvar_num("gm_block_on", get_pcvar_num(gCvarBlockGhostmine));
hook_cvar_change(gCvarBlockGhostmine, "CvarGhostMineHook");
hook_cvar_change(get_cvar_pointer("gm_block_on"), "MetaCvarGhostMineHook");
}

gSpawnOrigins = ArrayCreate(3);
gSpawnAngles = ArrayCreate(3);
Expand Down Expand Up @@ -629,7 +606,7 @@ public FwMsgIntermission(id) {
public TaskPreIntermission() {
// Show vEngine
set_dhudmessage(0, 100, 200, -1.0, -0.125, 0, 0.0, 99.0);
show_dhudmessage(0, "%s v%s^n----------------------^nHLTV Allowed: %i^nServer fps: %.1f^nGhostmine Blocker: %s", PLUGIN_ACRONYM, VERSION, get_pcvar_num(gCvarNumHLTVAllowed), (1.0 / gActualServerFPS), !cvar_exists("sv_ag_block_ghostmine") ? "Not available" : get_pcvar_num(gCvarBlockGhostmine) ? "On" : "Off");
show_dhudmessage(0, "%s v%s^n----------------------^nHLTV Allowed: %i^nServer fps: %.1f", PLUGIN_ACRONYM, VERSION, get_pcvar_num(gCvarNumHLTVAllowed), (1.0 / gActualServerFPS));
client_cmd(0, "wait;wait;snapshot");
}

Expand Down Expand Up @@ -821,14 +798,6 @@ public CvarSVProxiesHook(pcvar, const old_value[], const new_value[]) {
set_pcvar_string(gCvarNumHLTVAllowed, new_value);
}

public CvarGhostMineHook(pcvar, const old_value[], const new_value[]) {
set_cvar_string("gm_block_on", new_value);
}

public MetaCvarGhostMineHook(pcvar, const old_value[], const new_value[]) {
set_pcvar_string(gCvarBlockGhostmine, new_value);
}

public CvarCheatCmdIntervalHook(pcvar, const old_value[], const new_value[]) {
remove_task(TASK_CHEATCHECKER);
set_task(floatmax(1.0, get_pcvar_float(gCvarCheatCmdCheckInterval)), "CheatCommandRun", TASK_CHEATCHECKER);
Expand Down

0 comments on commit 099378c

Please sign in to comment.