Raised This Month: $51 Target: $400
 12% 

[CS:S/CS:GO] CT Bans


Post New Thread Reply   
 
Thread Tools Display Modes
1DreaM
Member
Join Date: Jan 2018
Location: Slovakia
Old 01-14-2018 , 08:03   Re: CTBans Web Interface
Reply With Quote #391

Quote:
Originally Posted by paulo_crash View Post
Perfect, now yes.

Thank you very much.

https://www.zkservidores.com/ctbans.php

As you can see now there are only BUGS on the grounds of banishment.

And a suggestion is that you also put, if possible, a column that shows the steam_id of the player who applied the ban.

Making those changes more forward is more than perfect, thanks again.

And one doubt would be about the column of Time, did not understand how it works, could explain?
BUGS removed. Column added, time repaired and you can now search for names, reasons... Download new version. Thx

BTW
YOU HAVE:




You have to set link like this:

__________________
GitHub: 1DreaM
WEB: OverGame.eu

Last edited by 1DreaM; 01-14-2018 at 09:09.
1DreaM is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 01-14-2018 , 08:55   Re: CTBans Web Interface
Reply With Quote #392

Quote:
Originally Posted by 1DreaM View Post
BUGS removed. Column added, time repaired and you can now search for names, reasons... Download new version. Thx

BTW
YOU HAVE:




You have to set link like this:

Thanks, I downloaded it.

Only you removed the column with the information SteamID Admin, in case it only displays the steam but the SteamID Admin information is missing as the column title.

In case I did the correction myself, but when I updated the page the nick and the banning of the bans bounced again.

I also found errors in the syntax of the code, typing error in case, I believe if it was not me that wrote wrong and then corrected.

Correcting this now I believe it is perfect.

I apologize for bothering you.

[EDIT]
My mistake, the names and reason of the bans still bogged down.

https://www.zkservidores.com/ctbans.php

Last edited by paulo_crash; 01-14-2018 at 08:59.
paulo_crash is offline
1DreaM
Member
Join Date: Jan 2018
Location: Slovakia
Old 01-14-2018 , 09:10   Re: CTBans Web Interface
Reply With Quote #393

Quote:
Originally Posted by paulo_crash View Post
Thanks, I downloaded it.

Only you removed the column with the information SteamID Admin, in case it only displays the steam but the SteamID Admin information is missing as the column title.

In case I did the correction myself, but when I updated the page the nick and the banning of the bans bounced again.

I also found errors in the syntax of the code, typing error in case, I believe if it was not me that wrote wrong and then corrected.

Correcting this now I believe it is perfect.

I apologize for bothering you.

[EDIT]
My mistake, the names and reason of the bans still bogged down.

https://www.zkservidores.com/ctbans.php
It's problem with utf8 encoding. I'm working on it.
You aren't in any case bothering me.
__________________
GitHub: 1DreaM
WEB: OverGame.eu

Last edited by 1DreaM; 01-14-2018 at 12:18.
1DreaM is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 01-14-2018 , 23:58   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #394

Hi Byte,

Sorry it has taken so long for my reply. Unfortunately, there is no way to accommodate your use case entirely in SourcePawn with clientprefs extension because of the cached data that exists. There will still be a mismatch between the data unless I pull from SQL every time, which I would rather not do.

Instead there is another way to make your use case work. It is recommended that you do something similar to sourcebans and execute a server rcon command. There are several rcon commands already included with ctbans 2.0.0 such as the offline commands that will do exactly what you need.

As for the FakeClients, I agree. I allowed fake clients for testing purposes but it is a hassle if they are accidentally CTBanned.

Quote:
Originally Posted by Byte View Post
Hey databomb,

Nice update to your CT Bans plugin!
Thank you for the release.

I have some small suggestions:

In DisplayCTBanPlayerMenu, add a fake client check:
PHP Code:
if (IsClientInGame(iIndex) && !IsFakeClient(iIndex)) 
You don't want FakeClients (i.e. Source TV demo bots) showing up in the menu.

Also, in OnClientPostAdminCheck, consider querying the database and updating the users cookie and ban time remaining. Replacing the functionality of OnClientAuthorized. Reason for this if a user is not on the server and a web script modifies the database but leaves it in a valid state, when they rejoin their cookie may be incorrect.

Use case:
  • User is perm CT banned
  • User leaves server
  • Database edited directly or via a web script (not plugin) while user is offline
  • User joins back and is still CT banned

Here is my solution if you want to look into it but be wary of the query as it may not work on older MySQL engine versions:

PHP Code:
#define CTBAN_QUERY_BANTIME_BANTIMEREMAINING "SELECT COALESCE(sum(timeleft), 0), COALESCE(bantime, -1) FROM %s WHERE perp_steamid = '%s' AND timeleft >= 0"

public void OnClientPostAdminCheck(int iClient)
{
    
// check if we have a database connection
    
if (gH_BanDatabase != INVALID_HANDLE)
    {
        
char sAuthID[FIELD_AUTHID_MAXLENGTH];
        
GetClientAuthId(iClientAuthId_Steam2sAuthIDsizeof(sAuthID));

        
char sQuery[QUERY_MAXLENGTH];
        
Format(sQuerysizeof(sQuery), CTBAN_QUERY_BANTIME_BANTIMEREMAININGg_sLogTableNamesAuthID);
        
SQL_TQuery(gH_BanDatabaseDB_Callback_RemoteUpdatesQueryview_as<int>(iClient));
    }
    else
    {
        
CreateTimer(AUTH_RESCAN_TIMETimer_OnClientPostAdminCheckiClientTIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_OnClientPostAdminCheck(Handle hTimerany iClient)
{
    if (
gH_BanDatabase != INVALID_HANDLE && IsClientInGame(iClient))
    {
        
char sAuthID[FIELD_AUTHID_MAXLENGTH];
        
GetClientAuthId(iClientAuthId_Steam2sAuthIDsizeof(sAuthID));

        
char sQuery[QUERY_MAXLENGTH];
        
Format(sQuerysizeof(sQuery), CTBAN_QUERY_BANTIME_BANTIMEREMAININGg_sLogTableNamesAuthID);
        
SQL_TQuery(gH_BanDatabaseDB_Callback_RemoteUpdatesQueryview_as<int>(iClient));
    }
    else if(
IsClientInGame(iClient))
    {
        
CreateTimer(AUTH_RESCAN_TIMETimer_OnClientPostAdminCheckiClientTIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
void DB_Callback_RemoteUpdate(Handle hOwnerHandle hCallback, const char[] sErrorany iClient)
{
    if (
hCallback == INVALID_HANDLE)
    {
        
LogError("Error in RemoteUpdate query: %s"sError);
    }
    else
    {
        
int iRowCount SQL_GetRowCount(hCallback);
        
        if (
iRowCount)
        {
            
SQL_FetchRow(hCallback);
            
int iBanTimeRemaining SQL_FetchInt(hCallback0);
            
int iBanTime SQL_FetchInt(hCallback1);
            
            
//Update ban time remaining
            
gA_LocalTimeRemaining[iClient] = iBanTimeRemaining;
            
            if (
IsClientInGame(iClient) && !IsFakeClient(iClient)) {
                if (
iBanTime == 0) {
                    
//Permanent ban
                    
int iBannedArrayIndex FindValueInArray(gA_TimedBanLocalListiClient);
                    if (
iBannedArrayIndex != -1)
                        
RemoveFromArray(gA_TimedBanLocalListiBannedArrayIndex);
                    
                    
//Ensure the ban cookie exists
                    
SetClientCookie(iClientg_CT_CookieCOOKIE_BANNED_STRING);
                }
                else if (
iBanTimeRemaining 0) {
                    
//Ban has time left still
                    
int iBannedArrayIndex FindValueInArray(gA_TimedBanLocalListiClient);
                    
                    
//If entry does not exist (even though it should), add it in
                    
if (iBannedArrayIndex == -1)
                        
PushArrayCell(gA_TimedBanLocalListiClient);
                    
                    
//Ensure the ban cookie exists
                    
SetClientCookie(iClientg_CT_CookieCOOKIE_BANNED_STRING);
                }
                else { 
//iBanTimeRemaining <= 0
                    //Expired ban
                    
int iBannedArrayIndex FindValueInArray(gA_TimedBanLocalListiClient);
                    if (
iBannedArrayIndex != VALUE_NOT_FOUND_IN_ARRAY)
                    {
                        
// remove them from the local array
                        
RemoveFromArray(gA_TimedBanLocalListiBannedArrayIndex);
                    }
                    
                    
//Remove ban from cookie
                    
SetClientCookie(iClientg_CT_CookieCOOKIE_UNBANNED_STRING);
                }
                
                
//Finally, handle team swapping if banned
                
CreateTimer(COOKIE_INIT_CHECK_TIMETimer_CheckBanCookiesiClientTIMER_FLAG_NO_MAPCHANGE);
            }
        }
    }

Again this probably isn't needed for everyone buts its nice for those who modify the database outside of the server using web scripts.
__________________

Last edited by databomb; 01-15-2018 at 00:01.
databomb is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 01-15-2018 , 00:22   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #395

Quote:
Originally Posted by Zeddy_god View Post
It shows me they're indefinitely banned though. Doesnt happen all the time but randomly some players get ctbanned indefinitely while serving time.
The SQL is just a log of what happened. The actual ban is in clientprefs, so if your server crashes without saving the clientprefs data there could be a mismatch between the two. It's possible this could result in a permanent ban. Does your server crash often?
__________________
databomb is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 01-15-2018 , 00:28   Re: CTBans Web Interface
Reply With Quote #396

Nice. Can I link this from the OP?

Quote:
Originally Posted by 1DreaM View Post
NEW !

CTBans Web Interface.
This is especially for databomb's plugin. For other ctban plugins it will not work without changes.

Remake of databomb's ctbans-list.txt.

Prewiev: https://overgame.eu/ctbans.php

Installation is simple !
  1. Upload file to your FTP.
  2. Add database info.:
    PHP Code:
    $server=""//db host
    $username=""//db username
    $password=""//db password
    $database=""//db name

    $results_per_page="15"
  3. Change favicon and menu:

    HTML Code:
    <link rel="icon" href="LINK TO IMAGE" sizes="32x32" />
    
    <div id="mySidenav" class="sidenav">
      <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
      <a href="#home">HOME</a>
      <a href="#banlist">BanList</a>
      <a href="#forum">Unban</a>
      <a href="#hlstats">HLstatS</a>
    </div>

ChangeLog:

Code:
1.0.1
  • Updated PHP.
  • Design remake.
  • + menu, search and favicon.
  • + colors
  • ...(little changes)
__________________
databomb is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 01-15-2018 , 07:26   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #397

I found a BUG in WebInterface.

I actually do not know if it would be a BUG of it or the Plugin CTBans.

When I apply a ctban from the server console in the Games Panel CTBan shows in WebInterface as Expired Ban.

What could it be, some Plugin or WebInterface BUG?

I am using this WebInterface: https://forums.alliedmods.net/showpo...&postcount=369

[EDIT]
Another BUG that I found in WebInterface is that there are players that are banned by CTBans but still are not in WebInterface, this user STEAM_1: 0: 241413394 is banned but it is not listed in WebInterface, at least when I search for the steam of it I have no result , nor banned or expired.

And when I try to remove ban from the CTBans console from the Game Panel of the Servers does not seem to work, the players still banned, I have to log in to the server and unban it inside the server.

Last edited by paulo_crash; 01-15-2018 at 07:35.
paulo_crash is offline
1DreaM
Member
Join Date: Jan 2018
Location: Slovakia
Old 01-15-2018 , 08:49   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #398

Quote:
Originally Posted by paulo_crash View Post
I found a BUG in WebInterface.

I actually do not know if it would be a BUG of it or the Plugin CTBans.

When I apply a ctban from the server console in the Games Panel CTBan shows in WebInterface as Expired Ban.

What could it be, some Plugin or WebInterface BUG?

I am using this WebInterface: https://forums.alliedmods.net/showpo...&postcount=369

[EDIT]
Another BUG that I found in WebInterface is that there are players that are banned by CTBans but still are not in WebInterface, this user STEAM_1: 0: 241413394 is banned but it is not listed in WebInterface, at least when I search for the steam of it I have no result , nor banned or expired.

And when I try to remove ban from the CTBans console from the Game Panel of the Servers does not seem to work, the players still banned, I have to log in to the server and unban it inside the server.
1.What parameters you have set.

2.Check your db, whether the ban is listed there.

3. Its bug of plugin.
__________________
GitHub: 1DreaM
WEB: OverGame.eu

Last edited by 1DreaM; 01-15-2018 at 08:51.
1DreaM is offline
1DreaM
Member
Join Date: Jan 2018
Location: Slovakia
Old 01-15-2018 , 10:17   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #399

Quote:
Originally Posted by databomb View Post
The SQL is just a log of what happened. The actual ban is in clientprefs, so if your server crashes without saving the clientprefs data there could be a mismatch between the two. It's possible this could result in a permanent ban. Does your server crash often?
I know, but I need UDP.
There is only one reason why I didn't make as you say --> my hosting has blocked that protocol.
__________________
GitHub: 1DreaM
WEB: OverGame.eu
1DreaM is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 01-15-2018 , 10:43   Re: [CS:S/CS:GO] CT Bans
Reply With Quote #400

Quote:
Originally Posted by 1DreaM View Post
1.What parameters you have set.

2.Check your db, whether the ban is listed there.

3. Its bug of plugin.
Sim o ban consta na DB, mas mesmo assim não mostra na Web Interface.

These parameters, you mean what?
paulo_crash is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode