Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Fork Namespace #415

Merged
merged 2 commits into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public SharedPlugin __pl_sourcebans =
public __pl_sourcebans_SetNTVOptional()
{
MarkNativeAsOptional("SBBanPlayer");
MarkNativeAsOptional("SourceBans_BanPlayer");
MarkNativeAsOptional("SourceBans_ReportPlayer");
MarkNativeAsOptional("SBPP_BanPlayer");
MarkNativeAsOptional("SBPP_ReportPlayer");
}
#endif

Expand All @@ -59,7 +59,7 @@ public __pl_sourcebans_SetNTVOptional()
* @param sReason The reason to ban the player from the server
* @noreturn
*********************************************************/
#pragma deprecated Use SourceBans_BanPlayer() instead.
#pragma deprecated Use SBPP_BanPlayer() instead.
native void SBBanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);

/*********************************************************
Expand All @@ -71,7 +71,7 @@ native void SBBanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason
* @param sReason The reason to ban the player from the server
* @noreturn
*********************************************************/
native void SourceBans_BanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);
native void SBPP_BanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);

/*********************************************************
* Reports a player
Expand All @@ -81,7 +81,7 @@ native void SourceBans_BanPlayer(int iAdmin, int iTarget, int iTime, const char[
* @param sReason The reason to report the player
* @noreturn
*********************************************************/
native void SourceBans_ReportPlayer(int iReporter, int iTarget, const char[] sReason);
native void SBPP_ReportPlayer(int iReporter, int iTarget, const char[] sReason);

/*********************************************************
* Called when the admin banning the player.
Expand All @@ -91,7 +91,7 @@ native void SourceBans_ReportPlayer(int iReporter, int iTarget, const char[] sRe
* @param iTime The time to ban the player for (in minutes, 0 = permanent)
* @param sReason The reason to ban the player from the server
*********************************************************/
forward void SourceBans_OnBanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);
forward void SBPP_OnBanPlayer(int iAdmin, int iTarget, int iTime, const char[] sReason);

/*********************************************************
* Called when a new report is inserted
Expand All @@ -101,6 +101,6 @@ forward void SourceBans_OnBanPlayer(int iAdmin, int iTarget, int iTime, const ch
* @param sReason The reason to report the player
* @noreturn
*********************************************************/
forward void SourceBans_OnReportPlayer(int iReporter, int iTarget, const char[] sReason);
forward void SBPP_OnReportPlayer(int iReporter, int iTarget, const char[] sReason);

//Yarr!
10 changes: 5 additions & 5 deletions game/addons/sourcemod/scripting/sbpp_main.sp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#pragma semicolon 1
#include <sourcemod>
#include <sourcebans>
#include <sourcebanspp>

#undef REQUIRE_PLUGIN
#include <adminmenu>
Expand Down Expand Up @@ -141,11 +141,11 @@ public bool AskPluginLoad(Handle myself, bool late, char[] error, int err_max)
RegPluginLibrary("sourcebans++");

CreateNative("SBBanPlayer", Native_SBBanPlayer);
CreateNative("SourceBans_BanPlayer", Native_SBBanPlayer);
CreateNative("SourceBans_ReportPlayer", Native_SBReportPlayer);
CreateNative("SBPP_BanPlayer", Native_SBBanPlayer);
CreateNative("SBPP_ReportPlayer", Native_SBReportPlayer);

g_hFwd_OnBanAdded = CreateGlobalForward("SourceBans_OnBanPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String);
g_hFwd_OnReportAdded = CreateGlobalForward("SourceBans_OnReportPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_String);
g_hFwd_OnBanAdded = CreateGlobalForward("SBPP_OnBanPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String);
g_hFwd_OnReportAdded = CreateGlobalForward("SBPP_OnReportPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_String);

LateLoaded = late;

Expand Down
6 changes: 3 additions & 3 deletions game/addons/sourcemod/scripting/sbpp_report.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define PLUGIN_VERSION "1.6.3-rc.1"

#include <sourcemod>
#include <sourcebans>
#include <sourcebanspp>

#pragma newdecls required

Expand Down Expand Up @@ -132,7 +132,7 @@ public Action OnClientSayCommand(int iClient, const char[] sCommand, const char[
return Plugin_Stop;
}

SourceBans_ReportPlayer(iClient, iTargetCache[iClient], sArgs);
SBPP_ReportPlayer(iClient, iTargetCache[iClient], sArgs);

AddCooldown(iClient);

Expand All @@ -141,7 +141,7 @@ public Action OnClientSayCommand(int iClient, const char[] sCommand, const char[
return Plugin_Stop;
}

public void SourceBans_OnReportPlayer(int iReporter, int iTarget, const char[] sReason)
public void SBPP_OnReportPlayer(int iReporter, int iTarget, const char[] sReason)
{
if (!IsValidClient(iReporter))
return;
Expand Down
4 changes: 2 additions & 2 deletions game/addons/sourcemod/scripting/sbpp_sleuth.sp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#pragma semicolon 1
#include <sourcemod>
#undef REQUIRE_PLUGIN
#include <sourcebans>
#include <sourcebanspp>

#define PLUGIN_VERSION "1.6.3-PRE"

Expand Down Expand Up @@ -235,7 +235,7 @@ stock BanPlayer(client, time)
{
decl String:Reason[255];
Format(Reason, sizeof(Reason), "[SourceSleuth] %T", "sourcesleuth_banreason", client);
SourceBans_BanPlayer(0, client, time, Reason);
SBPP_BanPlayer(0, client, time, Reason);
}

PrintToAdmins(const String:format[], any:...)
Expand Down