Skip to content

Conversation

@anaether
Copy link

@anaether anaether commented May 23, 2018

  • Adding Forward OnPlayerBlocked
  • Changing Syntax to sm 1.7
  • Updating the Updater Lib also to the new sm 1.7 syntax.
  • The automated build will fail because they dont use my updated updater.inc
    -! 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

  • [#] New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

anaether added 2 commits May 23, 2018 20:02
- Adding Forward OnPlayerBlocked
- Changing Syntax to sm 1.7
@Groruk Groruk requested review from Groruk and rumblefrog May 23, 2018 19:18
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);
Copy link
Member

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);
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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);
Copy link
Member

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));
Copy link
Member

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];
Copy link
Member

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);
Copy link
Member

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

@rumblefrog
Copy link
Member

I have reviewed this PR mostly, note some of the changes are optional but a bonus. But some are required for a response.

@anaether
Copy link
Author

I change it later then

@@ -0,0 +1,97 @@
#if defined _updater_included
Copy link
Member

@rumblefrog rumblefrog May 23, 2018

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

anaether added 3 commits May 24, 2018 08:59
- 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.)
Copy link
Member

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

@rumblefrog
Copy link
Member

Now being handled by #483

@rumblefrog rumblefrog closed this Jun 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants