Skip to content

Commit

Permalink
Merge pull request #24 from RGLgg/beta
Browse files Browse the repository at this point in the history
  • Loading branch information
l-Aad-l authored Jul 18, 2020
2 parents 8136d3d + 1b6538c commit e6a1871
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 36 deletions.
21 changes: 21 additions & 0 deletions ThankYou.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Steph for maintaining and updating the first iteration of the plugin, in addition to creating the configs

Aad for making the plugin

Mastercomms for helping me out with net settings

Arie from serveme for letting me run some things by him for the configs

JarateKing for adding a .gitattributes file and fixing typos and grammar because I suck with github and english

Sigafoo for running RGL

F2 for making the original pause plugin, and others

Miggy for being a cool anticheat admin who inspired me to make the configs in the first place

shoutouts to lange, originally borrowed this from soap_tournament.smx here: https://github.com/Lange/SOAP-TF2DM/blob/master/addons/sourcemod/scripting/soap_tournament.sp#L48

nosoop for the pure checking code

Thanks to plenty of other people for helping me with miscellaneous other stuff
33 changes: 9 additions & 24 deletions addons/sourcemod/scripting/rglqol.sp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public OnPluginStart()
PrintColoredChatAll("\x07FFA07A[RGLQoL]\x01 version \x07FFA07A%s\x01 has been \x073EFF3Eloaded\x01.", PLUGIN_VERSION);
// hooks round start events
HookEvent("teamplay_round_start", EventRoundStart);
// shoutouts to lange, originally borrowed this from soap_tournament.smx here: https://github.com/Lange/SOAP-TF2DM/blob/master/addons/sourcemod/scripting/soap_tournament.sp#L48


// Win conditions met (maxrounds, timelimit)
HookEvent("teamplay_game_over", GameOverEvent);
// Win conditions met (windifference)
Expand All @@ -78,19 +77,6 @@ public OnMapStart()
ServerCommand("sm plugins unload waitforstv");
}

public OnClientPostAdminCheck(client)
{
CreateTimer(15.0, prWelcomeClient, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}

public Action prWelcomeClient(Handle timer, int userid)
{
int client = GetClientOfUserId(userid);
if (client)
{
PrintColoredChat(client, "\x07FFA07A[RGLQoL]\x01 This server is running RGL QoL version \x07FFA07A%s\x01", PLUGIN_VERSION);
}
}

public Action EventRoundStart(Handle event, const char[] name, bool dontBroadcast)
{
Expand All @@ -102,7 +88,7 @@ public Action EventRoundStart(Handle event, const char[] name, bool dontBroadcas
// checks stuff for restarting server
public Action checkStuff(Handle timer)
{
// we could use tv_enable value here but it wouldn't be accurate if stv hasn't joined yet
// using tv_enable value here would be inaccurate if stv hasn't joined yet
char tvStatusOut[512];
ServerCommandEx(tvStatusOut, sizeof(tvStatusOut), "tv_status");
if (StrContains(tvStatusOut, "SourceTV not active") != -1)
Expand All @@ -125,7 +111,7 @@ public Action checkStuff(Handle timer)
{
CfgExecuted = false;
}
// if the server isnt empty, don't restart! Duh
// if the server isnt empty, don't restart!
if (curplayers > 0)
{
LogMessage("[RGLQoL] At least 1 player on server. Not restarting.");
Expand All @@ -143,7 +129,7 @@ public Action checkStuff(Handle timer)
LogMessage("[RGLQoL] STV is currently live! Not restarting.");
return;
}
// ok. if we got this far, restart the server
// restarts the server if it is empty
else
{
LogMessage("[RGLQoL] Server empty. Issuing sv_shutdown.");
Expand Down Expand Up @@ -180,7 +166,7 @@ public OnSTVChanged(ConVar convar, char[] oldValue, char[] newValue)
if (StringToInt(newValue) == 1)
{
LogMessage("[RGLQoL] tv_enable changed to 1! Changing level in 30 seconds unless manual map change occurs before then.");
change30();
change15();
}
else if (StringToInt(newValue) == 0)
{
Expand All @@ -191,7 +177,6 @@ public OnSTVChanged(ConVar convar, char[] oldValue, char[] newValue)
public OnServerCfgChanged(ConVar convar, char[] oldValue, char[] newValue)
{
// if cfg changes, then update tv_maxclients to 5
// closes https://github.com/stephanieLGBT/rgl-server-resources/issues/14
if (GetConVarInt(FindConVar("tv_maxclients")) == 128)
{
SetConVarInt(FindConVar("tv_maxclients"), 5);
Expand Down Expand Up @@ -235,7 +220,7 @@ public SetDefaultWhitelist()
}
}

// pure checking code below provided by nosoop ("top kekkeroni#4449" on discord) thank you i love you
// pure checking code
public Action OnPure(int client, const char[] command, int argc)
{
if (argc > 0)
Expand All @@ -252,16 +237,16 @@ public void InvokePureCommandCheck(any ignored)
if (StrContains(pureOut, "changelevel") != -1)
{
LogMessage("[RGLQoL] sv_pure cvar changed! Changing level in 30 seconds unless manual map change occurs before then.");
change30();
change15();
}
}

public change30()
public change15()
{
if (!alreadyChanging)
{
g_hWarnServ = CreateTimer(5.0, WarnServ, TIMER_FLAG_NO_MAPCHANGE);
g_hForceChange = CreateTimer(30.0, ForceChange, TIMER_FLAG_NO_MAPCHANGE);
g_hForceChange = CreateTimer(15.0, ForceChange, TIMER_FLAG_NO_MAPCHANGE);
alreadyChanging = true;
}
}
Expand Down
8 changes: 7 additions & 1 deletion addons/sourcemod/scripting/rglupdater.sp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ public OnRGLBetaChanged(ConVar convar, char[] oldValue, char[] newValue)

public OnClientPostAdminCheck(client)
{
CreateTimer(15.0, prWelcomeClient, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
char cfgVal[128];
GetConVarString(FindConVar("servercfgfile"), cfgVal, sizeof(cfgVal));
if (StrContains(cfgVal, "rgl") != -1)
{
CreateTimer(15.0, prWelcomeClient, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}

}

public Action prWelcomeClient(Handle timer, int userid)
Expand Down
22 changes: 12 additions & 10 deletions cfg/rgl_base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
// Created May 11, 2019 -- Updated May 22, 2020
// DO NOT EXEC THIS MANUALLY

sm plugins load rglqol // loads the qol plugin in RGL configs
sm plugins reload updater // reloads updater to prevent issues where it refuses to update on changelevel
sm_updater 2 // sets updater to download only plugins/cfgs
sm_updater_check // autoupdates to prevent tampering with non custom cfgs

// TF2 Comp Fixes
sm_deterministic_fall_damage 1
sm_fix_ghost_crossbow_bolts 1
sm_fix_slope_bug 1
sm_fix_sticky_delay 1
sm_gunboats_always_apply 0
sm_projectiles_ignore_teammates 0
sm_remove_halloween_souls 1
sm_remove_medic_attach_speed 0
sm_remove_pipe_spin 0
sm_rest_in_peace_rick_may 128
sm_deterministic_fall_damage 1
sm_fix_ghost_crossbow_bolts 1
sm_fix_slope_bug 1
sm_fix_sticky_delay 1
sm_gunboats_always_apply 0
sm_projectiles_ignore_teammates 0
sm_remove_halloween_souls 1
sm_remove_medic_attach_speed 0
sm_remove_pipe_spin 0
sm_rest_in_peace_rick_may 128
sm_winger_jump_bonus_when_fully_deployed 0

con_timestamp "1" // timestamps console log
Expand Down Expand Up @@ -114,6 +115,7 @@ tv_maxrate "0" // sets STV maxrate to unlimite
tv_msg "" // turns off any previously set tv_msg stuff
tv_relayvoice "0" // turns off voice in STV
tv_snapshotrate "66" // broadcasts 66 STV snapshots per second
tv_deltacache "0" // forces full ticks to be sent to stv as opposed to delta ticks
tv_timeout "10" // sets STV timeout to 10 seconds
tv_transmitall "1" // transmits all entity data from STV, not just visible entities
// ^ THIS DOES NOT REPLACE SOURCETV+, which can be found here: https://github.com/dalegaard/srctvplus
Expand Down
2 changes: 1 addition & 1 deletion cfg/rgl_off.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ mp_maxrounds "0" // unsets maxrounds
sv_password "" // defaults server password. overwritten by password in server.cfg, if you have one set
tv_password "" // defaults stv password


sm plugins unload rglqol // unloads the qol plugin so that it does not interfer with any other config.

exec "server.cfg" // execs the settings in your server.cfg
servercfgfile "server.cfg" // execs your server cfg file on map change
Expand Down

0 comments on commit e6a1871

Please sign in to comment.