Commit 0b088956 authored by Neoony's avatar Neoony
Browse files

v0.3.1 -Added chat command !discord to join Discord over MOTD -Added chat...

v0.3.1 -Added chat command !discord to join Discord over MOTD -Added chat command !charts to show steamcharts over MOTD -Added message about joining discord upon player join -Added message about joining discord every 5 minutes -Added message about steamcharts every 7 minutes
parent 395dd709
Pipeline #10558 passed with stages
in 6 minutes and 44 seconds
...@@ -73,4 +73,11 @@ ...@@ -73,4 +73,11 @@
- Built on SourceMod 1.11 (Server must have 1.10.0 or higher) - Built on SourceMod 1.11 (Server must have 1.10.0 or higher)
- Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket - Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket
- Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/ - Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/
- Some small bugfixes - Some small bugfixes
\ No newline at end of file
**v0.3.1**
- Added chat command !discord to join Discord over MOTD
- Added chat command !charts to show steamcharts over MOTD
- Added message about joining discord upon player join
- Added message about joining discord every 5 minutes
- Added message about steamcharts every 7 minutes
\ No newline at end of file
...@@ -25,6 +25,13 @@ https://forums.alliedmods.net/showthread.php?t=152216 ...@@ -25,6 +25,13 @@ https://forums.alliedmods.net/showthread.php?t=152216
**This is included with the plugin.** **This is included with the plugin.**
-- --
**Console Commands:**
**"sm_discord"**
*"Show discord invite link"*
**"sm_charts"**
*"Show steamcharts"*
**Server Commands:** **Server Commands:**
**"l_query"** **"l_query"**
*"Debug, query the servers status"* *"Debug, query the servers status"*
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <socket> #include <socket>
#include <cURL> #include <cURL>
#define PluginVer "v0.3" #define PluginVer "v0.3.1"
public Plugin myinfo = public Plugin myinfo =
{ {
...@@ -69,6 +69,7 @@ int StartVoteTimeleft; ...@@ -69,6 +69,7 @@ int StartVoteTimeleft;
Handle VoteHandle = INVALID_HANDLE; Handle VoteHandle = INVALID_HANDLE;
Handle Timer1[MAXPLAYERS+1] = INVALID_HANDLE; Handle Timer1[MAXPLAYERS+1] = INVALID_HANDLE;
Handle Timer2[MAXPLAYERS+1] = INVALID_HANDLE; Handle Timer2[MAXPLAYERS+1] = INVALID_HANDLE;
Handle Timer3[MAXPLAYERS+1] = INVALID_HANDLE;
Handle PopulatedRedirectTimer = INVALID_HANDLE; Handle PopulatedRedirectTimer = INVALID_HANDLE;
Handle HudTimer = INVALID_HANDLE; Handle HudTimer = INVALID_HANDLE;
//Handle XPcheckTimer[10] = INVALID_HANDLE; //Handle XPcheckTimer[10] = INVALID_HANDLE;
...@@ -76,6 +77,8 @@ int XPcheckcounter[10]; ...@@ -76,6 +77,8 @@ int XPcheckcounter[10];
Handle RefreshServersTimer = INVALID_HANDLE; Handle RefreshServersTimer = INVALID_HANDLE;
Handle CheckRefreshTime = INVALID_HANDLE; Handle CheckRefreshTime = INVALID_HANDLE;
int CurRefreshTime; int CurRefreshTime;
Handle DiscordTimer = INVALID_HANDLE;
Handle ChartsTimer = INVALID_HANDLE;
//Handle HudTimer = INVALID_HANDLE; //Handle HudTimer = INVALID_HANDLE;
int CurrentlyShowing; int CurrentlyShowing;
...@@ -169,6 +172,10 @@ public void OnPluginStart() ...@@ -169,6 +172,10 @@ public void OnPluginStart()
//Refresh servers //Refresh servers
RegServerCmd("l_rsdump", SCommand_LRSdump, "Show what RSaddrx it got (debug)"); RegServerCmd("l_rsdump", SCommand_LRSdump, "Show what RSaddrx it got (debug)");
//Console commands
RegConsoleCmd("sm_discord", CCommand_discord, "Show discord invite link");
RegConsoleCmd("sm_charts", CCommand_charts, "Show steamcharts");
StartSQL(); StartSQL();
...@@ -198,6 +205,8 @@ public void OnPluginStart() ...@@ -198,6 +205,8 @@ public void OnPluginStart()
CheckRefreshTime = CreateTimer(GetConVarFloat(l_refreshservers), CheckRefreshTm, _, TIMER_REPEAT); CheckRefreshTime = CreateTimer(GetConVarFloat(l_refreshservers), CheckRefreshTm, _, TIMER_REPEAT);
HudTimer = CreateTimer(1.0, HudTmr, _, TIMER_REPEAT); HudTimer = CreateTimer(1.0, HudTmr, _, TIMER_REPEAT);
DiscordTimer = CreateTimer(300.0, DiscordTmr, _, TIMER_REPEAT);
ChartsTimer = CreateTimer(420.0, ChartsTmr, _, TIMER_REPEAT);
l_serverformat = CreateConVar( "l_serverformat", "%name - %map (%numplayers/%maxplayers)", "Dont change, this is here because of issues with strings and % sign." ); l_serverformat = CreateConVar( "l_serverformat", "%name - %map (%numplayers/%maxplayers)", "Dont change, this is here because of issues with strings and % sign." );
...@@ -224,6 +233,42 @@ public void OnLibraryAdded(const char[] name) ...@@ -224,6 +233,42 @@ public void OnLibraryAdded(const char[] name)
} }
} }
public Action CCommand_discord(int client, int args)
{
PrintToChat(client, "https://discord.gg/UH6Sc6B");
ShowMOTDPanel(client, "Discord", "https://discord.gg/UH6Sc6B", 2);
}
public Action CCommand_charts(int client, int args)
{
//PrintToChat(client, "https://steamcharts.com/app/17740");
ShowMOTDPanel(client, "Steamcharts", "https://steamcharts.com/app/17740", 2);
}
public Action DiscordTmr(Handle timer)
{
PrintToChatAll("\x04[L] \x01Join Official \x077988d9Discord\x01 channel by typing \x077988d9!discord\x01, to find out when games are happening");
//Clear timer
if (DiscordTimer != INVALID_HANDLE)
{
KillTimer(DiscordTimer);
DiscordTimer = INVALID_HANDLE;
}
DiscordTimer = CreateTimer(300.0, DiscordTmr, _, TIMER_REPEAT);
}
public Action ChartsTmr(Handle timer)
{
PrintToChatAll("\x04[L] \x01Check for population statistics with \x077988d9!charts\x01");
//Clear timer
if (ChartsTimer != INVALID_HANDLE)
{
KillTimer(ChartsTimer);
ChartsTimer = INVALID_HANDLE;
}
ChartsTimer = CreateTimer(420.0, ChartsTmr, _, TIMER_REPEAT);
}
public void OnClientPutInServer(int Client) public void OnClientPutInServer(int Client)
{ {
//Clear timer //Clear timer
...@@ -238,6 +283,12 @@ public void OnClientPutInServer(int Client) ...@@ -238,6 +283,12 @@ public void OnClientPutInServer(int Client)
KillTimer(Timer2[Client]); KillTimer(Timer2[Client]);
Timer2[Client] = INVALID_HANDLE; Timer2[Client] = INVALID_HANDLE;
} }
//Clear timer
if (Timer3[Client] != INVALID_HANDLE)
{
KillTimer(Timer3[Client]);
Timer3[Client] = INVALID_HANDLE;
}
PrintToChat(Client, "\x04[L] \x01This server is running\x04 [Lobby]\x01 %s by\x07ff6600 Neoony", PluginVer); PrintToChat(Client, "\x04[L] \x01This server is running\x04 [Lobby]\x01 %s by\x07ff6600 Neoony", PluginVer);
Timer1[Client] = CreateTimer(5.0, Tmr1, Client, TIMER_REPEAT); Timer1[Client] = CreateTimer(5.0, Tmr1, Client, TIMER_REPEAT);
} }
...@@ -620,6 +671,12 @@ public Action Tmr1(Handle timer, int Client) ...@@ -620,6 +671,12 @@ public Action Tmr1(Handle timer, int Client)
KillTimer(Timer2[Client]); KillTimer(Timer2[Client]);
Timer2[Client] = INVALID_HANDLE; Timer2[Client] = INVALID_HANDLE;
} }
//Clear timer
if (Timer3[Client] != INVALID_HANDLE)
{
KillTimer(Timer3[Client]);
Timer3[Client] = INVALID_HANDLE;
}
PrintToChat(Client, "\x04[L] \x01\x07008000Welcome\x01 in the Empires\x04 Lobby\x01"); PrintToChat(Client, "\x04[L] \x01\x07008000Welcome\x01 in the Empires\x04 Lobby\x01");
Timer2[Client] = CreateTimer(5.0, Tmr2, Client, TIMER_REPEAT); Timer2[Client] = CreateTimer(5.0, Tmr2, Client, TIMER_REPEAT);
//Clear timer //Clear timer
...@@ -638,13 +695,42 @@ public Action Tmr2(Handle timer, int Client) ...@@ -638,13 +695,42 @@ public Action Tmr2(Handle timer, int Client)
KillTimer(Timer1[Client]); KillTimer(Timer1[Client]);
Timer1[Client] = INVALID_HANDLE; Timer1[Client] = INVALID_HANDLE;
} }
//Clear timer
if (Timer3[Client] != INVALID_HANDLE)
{
KillTimer(Timer3[Client]);
Timer3[Client] = INVALID_HANDLE;
}
PrintToChat(Client, "\x04[L] \x01A vote about joining a server will be created when this lobby reaches\x07ff6600 %d\x01 players in a team", GetConVarInt(l_minplayers)); PrintToChat(Client, "\x04[L] \x01A vote about joining a server will be created when this lobby reaches\x07ff6600 %d\x01 players in a team", GetConVarInt(l_minplayers));
Timer3[Client] = CreateTimer(5.0, Tmr3, Client, TIMER_REPEAT);
//Clear timer
if (Timer2[Client] != INVALID_HANDLE)
{
KillTimer(Timer2[Client]);
Timer2[Client] = INVALID_HANDLE;
}
}
public Action Tmr3(Handle timer, int Client)
{
//Clear timer
if (Timer1[Client] != INVALID_HANDLE)
{
KillTimer(Timer1[Client]);
Timer1[Client] = INVALID_HANDLE;
}
//Clear timer //Clear timer
if (Timer2[Client] != INVALID_HANDLE) if (Timer2[Client] != INVALID_HANDLE)
{ {
KillTimer(Timer2[Client]); KillTimer(Timer2[Client]);
Timer2[Client] = INVALID_HANDLE; Timer2[Client] = INVALID_HANDLE;
} }
PrintToChat(Client, "\x04[L] \x01Join Official \x077988d9Discord\x01 channel by typing \x077988d9!discord\x01, to find out when games are happening");
//Clear timer
if (Timer3[Client] != INVALID_HANDLE)
{
KillTimer(Timer3[Client]);
Timer3[Client] = INVALID_HANDLE;
}
} }
public OnMapStart() public OnMapStart()
...@@ -919,6 +1005,12 @@ public void OnClientDisconnect(int Client) ...@@ -919,6 +1005,12 @@ public void OnClientDisconnect(int Client)
KillTimer(Timer2[Client]); KillTimer(Timer2[Client]);
Timer2[Client] = INVALID_HANDLE; Timer2[Client] = INVALID_HANDLE;
} }
//Clear timer
if (Timer3[Client] != INVALID_HANDLE)
{
KillTimer(Timer3[Client]);
Timer3[Client] = INVALID_HANDLE;
}
} }
//SQL //SQL
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
{ {
"Version" "Version"
{ {
"Latest" "v0.3" "Latest" "v0.3.1"
} }
"Notes" "Built on SourceMod 1.11.0 (Server must have 1.10.0 or higher)" "Notes" "Added chat command !discord to join Discord over MOTD"
"Notes" "Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket" "Notes" "Added chat command !charts to show steamcharts over MOTD"
"Notes" "Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/" "Notes" "Added message about joining discord upon player join"
"Notes" "Some small bugfixes" "Notes" "Added message about joining discord every 5 minutes"
"Notes" "Added message about steamcharts every 7 minutes"
} }
"Files" "Files"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment