formatted code
This commit is contained in:
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
if(!dbContext.WhitelistEntries.Any(w => w.SocialClubName.ToLower() == player.SocialClubName.ToLower()))
|
||||
if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName.ToLower() == player.SocialClubName.ToLower()))
|
||||
{
|
||||
string msg2 = "~m~*** " + player.Name + "[" + player.SocialClubName + "] (" + player.Address + ") hat versucht, sich einzuloggen, steht aber nicht auf der Whitelist.";
|
||||
ChatService.BroadcastAdmin(msg2, AdminLevel.ADMIN);
|
||||
@@ -44,7 +44,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID:" + player.Handle.Value + "] (" + player.Address + ")";
|
||||
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN);
|
||||
}
|
||||
|
||||
|
||||
private bool IsPlayerBanned(Client player)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
@@ -69,7 +69,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
var timeStamp = bannedUser.UntilDateTime;
|
||||
int unixTimestamp = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||
|
||||
if(timeStamp > unixTimestamp)
|
||||
if (timeStamp > unixTimestamp)
|
||||
{
|
||||
player.SendChatMessage("Du bist noch bis zum !{#FF4040}" + dt.AddSeconds(timeStamp).ToLocalTime() + " Uhr ~s~gebannt. [" + bannedUser.Reason + "]");
|
||||
player.Kick();
|
||||
@@ -80,7 +80,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
user.BanId = null;
|
||||
dbContext.SaveChanges();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user