-
Notifications
You must be signed in to change notification settings - Fork 177
sbpp_main (Update) #475
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
sbpp_main (Update) #475
Conversation
- Adding Forward OnPlayerBlocked - Changing Syntax to sm 1.7
| Format(temp, 125, "Result of AddToTopMenu: %d", res); | ||
| LogToFile(logFile, temp); | ||
| LogToFile(logFile, "Added Ban option to admin menu"); | ||
| TopMenuObject res = AddToTopMenu(hTopMenu, "sm_ban", TopMenuObject_Item, AdminMenu_Ban, player_commands, "sm_ban", ADMFLAG_BAN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the method map here
| player_commands, // We are a submenu of Player Commands | ||
| "sm_ban", // The command to be finally called (Override checks) | ||
| ADMFLAG_BAN); // What flag do we need to see the menu option | ||
| AddToTopMenu(hTopMenu, "sm_ban", TopMenuObject_Item, AdminMenu_Ban, player_commands, "sm_ban", ADMFLAG_BAN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the method map here
| int param, // client idx of admin who chose the option (if used) | ||
| char[] buffer, // Output buffer (if used) | ||
| int maxlength) // Output buffer (if used) | ||
| public void AdminMenu_Ban(Handle topmenu, TopMenuAction action, TopMenuObject object_id, int param, char[] buffer, int maxlength) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace generic handle declaration for topmenu
| } | ||
|
|
||
| public VerifyInsert(Handle:owner, Handle:hndl, const String:error[], DataPack dataPack) | ||
| public void VerifyInsert(Handle owner, Handle hndl, const char[] error, DataPack dataPack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While here, use the new SQLQueryCallback typedef
| } | ||
|
|
||
| public SelectBanIpCallback(Handle:owner, Handle:hndl, const String:error[], any:data) | ||
| public void SelectBanIpCallback(Handle owner, Handle hndl, const char[] error, any data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, new typedef. And data type declaration can be DataPack
| } | ||
|
|
||
| public SMCResult:ReadConfig_EndSection(Handle:smc) | ||
| public SMCResult ReadConfig_EndSection(Handle smc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smc type declaration
| , iTarget = GetNativeCell(2) | ||
| , iReasonLen; | ||
| int iReporter = GetNativeCell(1); | ||
| int iTarget = GetNativeCell(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again not necessary, but you already have done it.
| dataPack.WriteCell(GetClientUserId(target)); | ||
| dataPack.WriteCell(time); | ||
| dataPack.WriteCell( _:reasonPack); | ||
| dataPack.WriteCell(view_as<char>(reasonPack)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be int?
| decl String:banName[128]; | ||
| decl String:banReason[256]; | ||
| decl String:Query[1024]; | ||
| char banName[128]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge
| CreateConVar("sb_version", SB_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); | ||
| CreateConVar("sbr_version", SBR_VERSION, _, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY); | ||
|
|
||
| CreateConVar("sb_version", SB_VERSION, _, FCVAR_NOTIFY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPONLY and REPLICATED flags should remain
|
I have reviewed this PR mostly, note some of the changes are optional but a bonus. But some are required for a response. |
|
I change it later then |
| @@ -0,0 +1,97 @@ | |||
| #if defined _updater_included | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also believe we shouldn't include updater dependency as it's not part of SB, if people want to compile it with updater they should pull it from the respective source. Our CI pulls it from the source. You should tryinclude before the newdecl pragma
- Update isnt done, need to make SQLQueryCallback for the SQL Callback methods.
|
|
||
| /********************************************************* | ||
| * Called when a player was blocked from server because he is banned. | ||
| * (game = csgo: you where banned not includes, only if loading screen appiers it counts.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation doesn't seem to be grammatically correct
|
Now being handled by #483 |
-! I forgot to change the description in sourcebanspp.inc for the new added forward.
Motivation and Context
The changes are not required but a good base for the future. The sm 1.7 syntax is more and more in use.
How Has This Been Tested?
Its tested on my TestServer for the game csgo.
Screenshots (if appropriate):
Types of changes
Checklist: