@@ -49,7 +49,10 @@ public class PluginConfig : BasePluginConfig
4949 public bool BlockGameBanned { get ; set ; } = false ;
5050
5151 [ JsonPropertyName ( "PrivateProfileWarningTime" ) ]
52- public int PrivateProfileWarningTime { get ; set ; } = 5 ;
52+ public int PrivateProfileWarningTime { get ; set ; } = 20 ;
53+
54+ [ JsonPropertyName ( "PrivateProfileWarningPrintSeconds" ) ]
55+ public int PrivateProfileWarningPrintSeconds { get ; set ; } = 3 ;
5356
5457 [ JsonPropertyName ( "DatabaseSettings" ) ]
5558 public DatabaseSettings DatabaseSettings { get ; set ; } = new DatabaseSettings ( ) ;
@@ -89,7 +92,7 @@ public sealed class DatabaseSettings
8992public class SteamRestrictPlugin : BasePlugin , IPluginConfig < PluginConfig >
9093{
9194 public override string ModuleName => "Steam Restrict" ;
92- public override string ModuleVersion => "1.4.0 " ;
95+ public override string ModuleVersion => "1.4.1 " ;
9396 public override string ModuleAuthor => "K4ryuu, Cruze @ KitsuneLab" ;
9497 public override string ModuleDescription => "Restrict certain players from connecting to your server." ;
9598
@@ -231,35 +234,38 @@ private void CheckUserViolations(nint handle, ulong authorizedSteamID)
231234 Logger . LogInformation ( $ "Steam Account Creation Date: N/A") ;
232235 //Logger.LogInformation($"HasPrime: {userInfo.HasPrime}"); Removed due to people bought prime after CS2 cannot be detected sadly (or atleast not yet)
233236 Logger . LogInformation ( $ "HasPrivateProfile: { userInfo . IsPrivate } ") ;
237+ Logger . LogInformation ( $ "HasPrivateGameDetails: { userInfo . IsGameDetailsPrivate } ") ;
234238 Logger . LogInformation ( $ "IsTradeBanned: { userInfo . IsTradeBanned } ") ;
235239 Logger . LogInformation ( $ "IsGameBanned: { userInfo . IsGameBanned } ") ;
236240 Logger . LogInformation ( $ "IsInSteamGroup: { userInfo . IsInSteamGroup } ") ;
237241 }
238242
239243 if ( IsRestrictionViolated ( player , userInfo ) )
240244 {
241- if ( Config . PrivateProfileWarningTime > 0 && userInfo . IsPrivate )
245+ if ( Config . PrivateProfileWarningTime > 0 && ( userInfo . IsPrivate || userInfo . IsGameDetailsPrivate ) )
242246 {
243247 g_iWarnTime [ player . Slot ] = Config . PrivateProfileWarningTime ;
244248 int playerSlot = player . Slot ;
245249
246- g_hTimer [ playerSlot ] = AddTimer ( 1 , ( ) =>
250+ AddTimer ( Config . PrivateProfileWarningTime , ( ) =>
251+ {
252+ if ( player ? . IsValid == true )
253+ Server . ExecuteCommand ( $ "kickid { player . UserId } \" You have been kicked for not meeting the minimum requirements.\" ") ;
254+ } ) ;
255+
256+ g_hTimer [ playerSlot ] = AddTimer ( Config . PrivateProfileWarningPrintSeconds , ( ) =>
247257 {
248258 if ( player ? . IsValid == true )
249259 {
250260 player . PrintToChat ( $ " { ChatColors . Silver } [ { ChatColors . Lime } SteamRestrict { ChatColors . Silver } ] { ChatColors . LightRed } Your Steam profile or Game details are private. You will be kicked in { g_iWarnTime [ playerSlot ] } seconds.") ;
251261 }
252-
253- g_iWarnTime [ playerSlot ] -- ;
254-
255- if ( g_iWarnTime [ playerSlot ] <= 0 )
262+ else
256263 {
257- if ( player ? . IsValid == true )
258- Server . ExecuteCommand ( $ "kickid { player . UserId } \" You have been kicked for not meeting the minimum requirements.\" ") ;
259-
260264 g_hTimer [ playerSlot ] ? . Kill ( ) ;
261265 g_hTimer [ playerSlot ] = null ;
262266 }
267+
268+ g_iWarnTime [ playerSlot ] -= Config . PrivateProfileWarningPrintSeconds ;
263269 } , TimerFlags . REPEAT ) ;
264270 }
265271 else
@@ -300,7 +306,7 @@ private bool IsRestrictionViolated(CCSPlayerController player, SteamUserInfo use
300306 if ( ! ( playerBypassConfig ? . BypassMinimumSteamAccountAge ?? false ) && Config . MinimumSteamAccountAgeInDays != - 1 && ( DateTime . Now - userInfo . SteamAccountAge ) . TotalDays < Config . MinimumSteamAccountAgeInDays )
301307 return true ;
302308
303- if ( Config . BlockPrivateProfile && ! ( playerBypassConfig ? . BypassPrivateProfile ?? false ) && userInfo . IsPrivate )
309+ if ( Config . BlockPrivateProfile && ! ( playerBypassConfig ? . BypassPrivateProfile ?? false ) && ( userInfo . IsPrivate || userInfo . IsGameDetailsPrivate ) )
304310 return true ;
305311
306312 if ( Config . BlockTradeBanned && ! ( playerBypassConfig ? . BypassTradeBanned ?? false ) && userInfo . IsTradeBanned )
0 commit comments