@@ -189,53 +189,53 @@ private void OnPlayerConnectFull(CCSPlayerController player)
189
189
}
190
190
}
191
191
192
- await CheckUserViolations ( handle , authorizedSteamID ) ;
192
+ Server . NextWorldUpdate ( ( ) =>
193
+ {
194
+ CheckUserViolations ( handle , authorizedSteamID ) ;
195
+ } ) ;
193
196
} ) ;
194
197
}
195
198
196
- private async Task CheckUserViolations ( nint handle , ulong authorizedSteamID )
199
+ private void CheckUserViolations ( nint handle , ulong authorizedSteamID )
197
200
{
198
201
SteamService steamService = new SteamService ( this ) ;
199
- await steamService . FetchSteamUserInfo ( handle , authorizedSteamID ) ;
202
+ steamService . FetchSteamUserInfo ( handle , authorizedSteamID ) ;
200
203
201
204
SteamUserInfo ? userInfo = steamService . UserInfo ;
202
205
203
- Server . NextWorldUpdate ( ( ) =>
204
- {
205
- CCSPlayerController ? player = Utilities . GetPlayerFromSteamId ( authorizedSteamID ) ;
206
+ CCSPlayerController ? player = Utilities . GetPlayerFromSteamId ( authorizedSteamID ) ;
206
207
207
- if ( player ? . IsValid == true && userInfo != null )
208
+ if ( player ? . IsValid == true && userInfo != null )
209
+ {
210
+ Logger . LogInformation ( $ "{ player . PlayerName } info:") ;
211
+ Logger . LogInformation ( $ "CS2Playtime: { userInfo . CS2Playtime } ") ;
212
+ Logger . LogInformation ( $ "CS2Level: { userInfo . CS2Level } ") ;
213
+ Logger . LogInformation ( $ "SteamLevel: { userInfo . SteamLevel } ") ;
214
+ if ( ( DateTime . Now - userInfo . SteamAccountAge ) . TotalSeconds > 30 )
215
+ Logger . LogInformation ( $ "Steam Account Creation Date: { userInfo . SteamAccountAge : dd-MM-yyyy} ") ;
216
+ else
217
+ Logger . LogInformation ( $ "Steam Account Creation Date: N/A") ;
218
+ Logger . LogInformation ( $ "HasPrime: { userInfo . HasPrime } ") ;
219
+ Logger . LogInformation ( $ "HasPrivateProfile: { userInfo . IsPrivate } ") ;
220
+ Logger . LogInformation ( $ "IsTradeBanned: { userInfo . IsTradeBanned } ") ;
221
+ Logger . LogInformation ( $ "IsGameBanned: { userInfo . IsGameBanned } ") ;
222
+ Logger . LogInformation ( $ "IsInSteamGroup: { userInfo . IsInSteamGroup } ") ;
223
+
224
+ if ( IsRestrictionViolated ( player , userInfo ) )
208
225
{
209
- Logger . LogInformation ( $ "{ player . PlayerName } info:") ;
210
- Logger . LogInformation ( $ "CS2Playtime: { userInfo . CS2Playtime } ") ;
211
- Logger . LogInformation ( $ "CS2Level: { userInfo . CS2Level } ") ;
212
- Logger . LogInformation ( $ "SteamLevel: { userInfo . SteamLevel } ") ;
213
- if ( ( DateTime . Now - userInfo . SteamAccountAge ) . TotalSeconds > 30 )
214
- Logger . LogInformation ( $ "Steam Account Creation Date: { userInfo . SteamAccountAge : dd-MM-yyyy} ") ;
215
- else
216
- Logger . LogInformation ( $ "Steam Account Creation Date: N/A") ;
217
- Logger . LogInformation ( $ "HasPrime: { userInfo . HasPrime } ") ;
218
- Logger . LogInformation ( $ "HasPrivateProfile: { userInfo . IsPrivate } ") ;
219
- Logger . LogInformation ( $ "IsTradeBanned: { userInfo . IsTradeBanned } ") ;
220
- Logger . LogInformation ( $ "IsGameBanned: { userInfo . IsGameBanned } ") ;
221
- Logger . LogInformation ( $ "IsInSteamGroup: { userInfo . IsInSteamGroup } ") ;
222
-
223
- if ( IsRestrictionViolated ( player , userInfo ) )
224
- {
225
- Server . ExecuteCommand ( $ "kickid { player . UserId } \" You have been kicked for not meeting the minimum requirements.\" ") ;
226
- }
227
- else if ( ! IsDatabaseConfigDefault ( ) )
228
- {
229
- ulong steamID = player . AuthorizedSteamID ? . SteamId64 ?? 0 ;
226
+ Server . ExecuteCommand ( $ "kickid { player . UserId } \" You have been kicked for not meeting the minimum requirements.\" ") ;
227
+ }
228
+ else if ( ! IsDatabaseConfigDefault ( ) )
229
+ {
230
+ ulong steamID = player . AuthorizedSteamID ? . SteamId64 ?? 0 ;
230
231
231
- if ( steamID != 0 )
232
- {
233
- var databaseService = new DatabaseService ( Config . DatabaseSettings ) ;
234
- Task . Run ( async ( ) => await databaseService . AddAllowedUserAsync ( steamID , Config . DatabaseSettings . TablePurgeDays ) ) ;
235
- }
232
+ if ( steamID != 0 )
233
+ {
234
+ var databaseService = new DatabaseService ( Config . DatabaseSettings ) ;
235
+ Task . Run ( async ( ) => await databaseService . AddAllowedUserAsync ( steamID , Config . DatabaseSettings . TablePurgeDays ) ) ;
236
236
}
237
237
}
238
- } ) ;
238
+ }
239
239
}
240
240
241
241
private bool IsRestrictionViolated ( CCSPlayerController player , SteamUserInfo userInfo )
0 commit comments