Skip to content

Commit

Permalink
Merge pull request #75 from RGLgg/beta
Browse files Browse the repository at this point in the history
  • Loading branch information
l-Aad-l committed May 16, 2024
2 parents 6c8468e + e9dea27 commit 8a9a260
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 67 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
SM_VERSION: ["1.10"]
SM_VERSION: ["1.11"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -44,9 +44,10 @@ jobs:
# wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/latest/download/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
- name: Get latest version of TF2 Comp Fixes and its DHooks dependency
run: |
wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.12/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
wget -q -O tmp.zip https://github.com/peace-maker/DHooks2/releases/download/v2.2.0-detours17/dhooks-2.2.0-detours17-sm110.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.13/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# wget -q -O tmp.zip https://github.com/peace-maker/DHooks2/releases/download/v2.2.0-detours17/dhooks-2.2.0-detours17-sm110.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# Dhooks was bundled with Sourcemod starting SM 1.11 Release

working-directory: ${{ env.SOURCEMOD_PATH }}/

# SrcTV+: https://github.com/dalegaard/srctvplus
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
SM_VERSION: ["1.10"]
SM_VERSION: ["1.11"]

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
SM_VERSION: ["1.10"]
SM_VERSION: ["1.11"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -45,9 +45,10 @@ jobs:
# wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/latest/download/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
- name: Get latest version of TF2 Comp Fixes and its DHooks dependency
run: |
wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.12/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
wget -q -O tmp.zip https://github.com/peace-maker/DHooks2/releases/download/v2.2.0-detours17/dhooks-2.2.0-detours17-sm110.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.13/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# wget -q -O tmp.zip https://github.com/peace-maker/DHooks2/releases/download/v2.2.0-detours17/dhooks-2.2.0-detours17-sm110.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# Dhooks was bundled with Sourcemod starting SM 1.11 Release

working-directory: ${{ env.SOURCEMOD_PATH }}/

# SrcTV+: https://github.com/dalegaard/srctvplus
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![RGL.gg](https://img.shields.io/badge/RGL.gg-blue?logo=data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABEXAAARFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKITtQenz/f/6/P//+vz///r8///6/P///////4u89cYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeD7EHu9f7///////////////////////////+MvvbGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlguxB+Pv///////////////////7+/v//////jL72xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATZjvPkaV8P9VnfH/h7n1/9Xn/P/5+/7//////4u99sUAAAAAAAAAAAAAAAAAAAAATJjwv0uW782SwfbNh7v1zUyX8NpMl+//TJfv/0uX7/9Ll+//XKDx/9vq/P+rz/j0j8D2zJDA9s2QwPbNjr/2zU2X8O9Klu//5/H8//n7/v9XnfD/TZjw/k2Y8P9NmPD/TZjw/02Y8P9GlO/+vtr6//////////////////////9NmPDuTJfv/67Q+P//////cKzz/0yX7/9NmPD/TZjw/02Y8P9NmPD/TZjw/02Y8P/d6/z////////////6/P//TZjw7k2Y8P9tqvL//////8vh+v9AkO7/TJfv/02Y8P9NmPD/TZjw/02Y8P9Ml+//Tpnv//r8////////+vz//02Y8O5NmPD/QZHu/+z0/f//////psz4/4O39P9QmvD/TJfv/0mV7/9Sm/D/ca3z/63Q+P/2+f7///////r8//9NmPDuTZjw/1ad8P/+/v//////////////////5O/9/1Sb8P+61/n/+vv+//3+/v///////////////v/6/P//TZjw+UyX7/+u0Pj/6vP9/+v0/f/+/v/+/v7+/////////////////+71/f6rzvj/da/z/2Gk8f/s9f3/5vH9/0uY8DZLmPA5MYjtOSSB7Dkgf+xs7/b+///////+/v7/6/P9/3Ou8/9Dku//Spbv0kuY8DdHle85JIHsOSWC7DkAAAAAAAAAAAAAAAAAAAAAJ4PsQO71/v///////////8Hb+f9Ml+//TZjw/02Y8MUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeD7EHu9f7///////3+/v9ipPH/TJfv/02Y8P9NmPDGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAohOxB6/T9//3+/v9vq/P/TJfv/02Y8P9MmPD/TZjwxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASZbvPXqy8/m01PnubKry7kyX7+5NmPDuTZjw70yY8LgAAAAAAAAAAAAAAAAAAAAA8A8AAPAPAADwDwAA8A8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8A8AAPAPAADwDwAA8A8AAA==)](https://rgl.gg/?r=38)
[![Beta Build](https://github.com/RGLgg/server-resources-updater/workflows/Beta%20Build/badge.svg)](https://github.com/RGLgg/server-resources-updater/actions?query=workflow%3A%22Beta+Build%22)
[![Release Build](https://github.com/RGLgg/server-resources-updater/workflows/Release%20Build/badge.svg)](https://github.com/RGLgg/server-resources-updater/actions?query=workflow%3A%22Release+Build%22)
[![Sourcemod Version](https://img.shields.io/badge/SourceMod-v1.10-blue?labelColor=d9860a&color=5596cf)](https://www.sourcemod.net/downloads.php?branch=1.10-dev&all=1)
[![Sourcemod Version](https://img.shields.io/badge/SourceMod-v1.11-blue?labelColor=d9860a&color=5596cf)](https://www.sourcemod.net/downloads.php?branch=stable)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/RGLgg/server-resources-updater)](https://github.com/RGLgg/server-resources-updater/releases/latest)
[![GitHub All Releases](https://img.shields.io/github/downloads/RGLgg/server-resources-updater/total)](https://github.com/RGLgg/server-resources-updater/releases/latest/download/server-resources-updater.zip)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/RGLgg/server-resources-updater/blob/master/LICENSE)

**Please ensure you read ALL of the [Installation](https://github.com/RGLgg/server-resources-updater/tree/master#installation) section.**
Clicking on the `Clone and download` button will not work, instead ensure your server has [SourceMod 1.10](https://www.sourcemod.net/downloads.php?branch=1.10-dev&all=1) and click this badge [![GitHub All Releases](https://img.shields.io/github/downloads/RGLgg/server-resources-updater/total)](https://github.com/RGLgg/server-resources-updater/releases/latest/download/server-resources-updater.zip)
Clicking on the `Clone and download` button will not work, instead ensure your server has [SourceMod 1.11](https://www.sourcemod.net/downloads.php?branch=stable) and click this badge [![GitHub All Releases](https://img.shields.io/github/downloads/RGLgg/server-resources-updater/total)](https://github.com/RGLgg/server-resources-updater/releases/latest/download/server-resources-updater.zip)

If youre running a **linux distro**, please **make sure it's up to date with EPEL**, some servers may have issues with TF2 Comp Fixes / RGL Updater.

Expand All @@ -23,7 +23,7 @@ Parts of this README are still in the process of being updated.
* [TF2 Competitive Fixes](https://github.com/ldesgoui/tf2-comp-fixes)
* Various technical or gameplay changes catered towards competitive play.
* Included dependency
* [DHooks2](https://github.com/peace-maker/DHooks2)
* ~~[DHooks2](https://github.com/peace-maker/DHooks2)~~ - As of SM 1.11, it is prebundled in Sourcemod, users no longer have to manually maintain this package.
* By twiikuu
* [Progressive Ruleset Timer Plugins](https://github.com/b4nnyBot/Progressive-Ruleset-Timer-Plugins)
* Creates dynamic win conditions for 5CP gamemodes
Expand Down Expand Up @@ -70,19 +70,19 @@ If you have problems with the plugin, or if you have a suggestion, please submit

# Installation
## Prerequisites
[![Sourcemod Version](https://img.shields.io/badge/SourceMod-v1.10-blue?labelColor=d9860a&color=5596cf)](https://www.sourcemod.net/downloads.php?branch=1.10-dev&all=1)
[![Sourcemod Version](https://img.shields.io/badge/SourceMod-v1.11-blue?labelColor=d9860a&color=5596cf)](https://www.sourcemod.net/downloads.php?branch=stable)

With the TF2 Comp Fixes plugin requiring SM 1.10 at minimum due to SM 1.9 now being phased out. The RGL Server Resources Updater will **only support SourceMod 1.10 and higher**. Please make sure you get the right version for your server's operating system! Any previous versions of SourceMod are **unsupported**.
With SM 1.10 causing issues, SM 1.11 is required for this plugin. The RGL Server Resources Updater will **only support SourceMod 1.11 and higher**. Please make sure you get the right version for your server's operating system! Any previous versions of SourceMod are **unsupported**.

**Note**: This plugin breaks on the SourceMod v1.11. Use the [1.10](https://www.sourcemod.net/downloads.php?branch=1.10-dev&all=1) branch instead.
**Note**: Use the [1.11](https://www.sourcemod.net/downloads.php?branch=stable) branch instead.

This guide [here](https://wiki.alliedmods.net/Upgrading_SourceMod) contains instructions on how to upgrade the files, but please consider doing a fresh install of all your current files to avoid any potential issues.

After installation, typing `sm version` into the server console will confirm if the update was successful.

## Install Instructions

1. [Update SourceMod to at least 1.10](https://www.sourcemod.net/downloads.php?branch=1.10-dev&all=1). SourceMod 1.11 currently breaks this plugin, however.
1. [Update SourceMod to at least 1.11](https://www.sourcemod.net/downloads.php?branch=stable).
2. Download the latest zip by clicking on this badge [![GitHub All Releases](https://img.shields.io/github/downloads/RGLgg/server-resources-updater/total)](https://github.com/RGLgg/server-resources-updater/releases/latest/download/server-resources-updater.zip).

3. Navigate to your server install folder in an (S)FTP client of your choice.
Expand Down
2 changes: 2 additions & 0 deletions addons/sourcemod/scripting/improved_match_timer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public void OnPluginStart(){
public Action OnExec(int client, const char[] command, int argc){
winlimit_original = -1;
timelimit_original = -1;
return Plugin_Continue;
}

public void OnMapStart()
Expand Down Expand Up @@ -122,6 +123,7 @@ public Action WaitTime(Handle timer){
doOnRestart = true;
timer2 = CreateTimer(0.5, CheckRoundTime, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
timer1 = INVALID_HANDLE;
return Plugin_Continue;
}

public Action CheckRoundTime(Handle timer){
Expand Down
62 changes: 35 additions & 27 deletions addons/sourcemod/scripting/rglqol.sp
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#pragma newdecls required
#pragma semicolon 1

#include <sourcemod>
#include <color_literals>
#include <regex>

#define PLUGIN_NAME "RGL.gg QoL Tweaks"
#define PLUGIN_VERSION "1.4.3"
#define PLUGIN_VERSION "1.4.5"

bool:CfgExecuted;
bool:alreadyChanging;
bool:IsSafe;
bool:warnedStv;
isStvDone = -1;
stvOn;
formatVal;
slotVal;
curplayers;
Handle:g_hForceChange;
Handle:g_hWarnServ;
Handle:g_hcheckStuff;
Handle:g_hSafeToChangeLevel;
bool CfgExecuted;
bool alreadyChanging;
bool IsSafe;
bool warnedStv;
int isStvDone = -1;
int stvOn;
int formatVal;
int slotVal;
int curplayers;
Handle g_hForceChange;
Handle g_hWarnServ;
Handle g_hcheckStuff;
Handle g_hSafeToChangeLevel;

public Plugin:myinfo =
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = "Stephanie, Aad",
Expand All @@ -30,7 +31,7 @@ public Plugin:myinfo =
url = "https://github.com/RGLgg/server-resources-updater"
}

public OnPluginStart()
public void OnPluginStart()
{
// creates cvar for antitrolling stuff
CreateConVar
Expand Down Expand Up @@ -64,7 +65,7 @@ public OnPluginStart()
RegServerCmd("changelevel", changeLvl);
}

public OnMapStart()
public void OnMapStart()
{
delete g_hForceChange;
delete g_hWarnServ;
Expand All @@ -83,6 +84,7 @@ public Action EventRoundStart(Handle event, const char[] name, bool dontBroadcas
AntiTrollStuff();
// prevents stv done notif spam if teams play another round before 90 seconds have passed
delete g_hSafeToChangeLevel;
return Plugin_Continue;
}

// checks stuff for restarting server
Expand Down Expand Up @@ -115,23 +117,24 @@ public Action checkStuff(Handle timer)
if (curplayers > 0)
{
LogMessage("[RGLQoL] At least 1 player on server. Not restarting.");
return;
return Plugin_Continue;
}
else if (!CfgExecuted)
// if the rgl isnt exec'd dont restart.
{
LogMessage("[RGLQoL] RGL config not executed. Not restarting.");
return;
return Plugin_Continue;
}
// if the stv hasnt ended aka if the GAME hasn't ended + 90 seconds, don't restart. If isStvDone is -1 or 1 then it's ok.
else if (isStvDone == 0)
{
LogMessage("[RGLQoL] STV is currently live! Not restarting.");
return;
return Plugin_Continue;
}
return Plugin_Continue;
}

public OnRGLChanged(ConVar convar, char[] oldValue, char[] newValue)
public void OnRGLChanged(ConVar convar, char[] oldValue, char[] newValue)
{
if (StringToInt(newValue) == 1)
{
Expand All @@ -152,7 +155,7 @@ public OnRGLChanged(ConVar convar, char[] oldValue, char[] newValue)
}

// this section was influenced by f2's broken FixSTV plugin
public OnSTVChanged(ConVar convar, char[] oldValue, char[] newValue)
public void OnSTVChanged(ConVar convar, char[] oldValue, char[] newValue)
{
if (StringToInt(newValue) == 1)
{
Expand All @@ -165,7 +168,7 @@ public OnSTVChanged(ConVar convar, char[] oldValue, char[] newValue)
}
}

public OnServerCfgChanged(ConVar convar, char[] oldValue, char[] newValue)
public void OnServerCfgChanged(ConVar convar, char[] oldValue, char[] newValue)
{
// if cfg changes, then update tv_maxclients to 5
if (GetConVarInt(FindConVar("tv_maxclients")) == 128)
Expand All @@ -177,7 +180,7 @@ public OnServerCfgChanged(ConVar convar, char[] oldValue, char[] newValue)
AntiTrollStuff();
}

public SetDefaultWhitelist()
public void SetDefaultWhitelist()
{
// check to see if tftrue exists, and if it fails to load after a tf2 update use default mp_tournament_whitelist
if(FileExists("addons/TFTrue.vdf"))
Expand Down Expand Up @@ -233,7 +236,7 @@ public void InvokePureCommandCheck(any ignored)
}
}

public change15()
public void change15()
{
if (!alreadyChanging)
{
Expand All @@ -257,19 +260,22 @@ public Action GameOverEvent(Handle event, const char[] name, bool dontBroadcast)
{
g_hcheckStuff = CreateTimer(600.0, checkStuff, _, TIMER_REPEAT);
}
return Plugin_Continue;
}

public Action unloadMapChooserNextMap(Handle timer)
{
ServerCommand("sm plugins unload nextmap");
ServerCommand("sm plugins unload mapchooser");
return Plugin_Continue;
}

public Action WarnServ(Handle timer)
{
LogMessage("[RGLQoL] An important cvar has changed. Forcing a map change in 25 seconds unless the map is manually changed before then.");
PrintColoredChatAll("\x07FFA07A[RGLQoL]\x01 An important cvar has changed. Forcing a map change in 25 seconds unless the map is manually changed before then.");
g_hWarnServ = null;
return Plugin_Continue;
}

public Action SafeToChangeLevel(Handle timer)
Expand All @@ -282,6 +288,7 @@ public Action SafeToChangeLevel(Handle timer)
IsSafe = true;
}
g_hSafeToChangeLevel = null;
return Plugin_Continue;
}

public Action changeLvl(int args)
Expand All @@ -307,9 +314,10 @@ public Action ForceChange(Handle timer)
GetCurrentMap(mapName, sizeof(mapName));
ForceChangeLevel(mapName, "Important cvar changed! Forcibly changing level to prevent bugs.");
g_hForceChange = null;
return Plugin_Continue;
}

public AntiTrollStuff()
public void AntiTrollStuff()
{
if (!GetConVarBool(FindConVar("rgl_cast")))
{
Expand Down Expand Up @@ -363,7 +371,7 @@ public AntiTrollStuff()
}
}

public OnPluginEnd()
public void OnPluginEnd()
{
PrintColoredChatAll("\x07FFA07A[RGLQoL]\x01 version \x07FFA07A%s\x01 has been \x07FF4040unloaded\x01.", PLUGIN_VERSION);
}
Loading

0 comments on commit 8a9a260

Please sign in to comment.