NEUER LOGIN SCREEEEEEEEEEN

This commit is contained in:
hydrant
2020-05-04 23:03:39 +02:00
parent b61c57a2d1
commit 36cacd4775
47 changed files with 18613 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Database;
@@ -26,10 +26,13 @@ namespace ReallifeGamemode.Server.Events
player.SetData("isLoggedIn", false);
player.Position = new Vector3(-1883.736, -781.4911, -10);
bool registered = false;
using (var dbContext = new DatabaseContext())
{
if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName.ToLower() == player.SocialClubName.ToLower()))
registered = dbContext.Users.Where(u => u.Name == player.Name).Any();
if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName == player.SocialClubName))
{
string msg2 = "~m~*** " + player.Name + "[" + player.SocialClubName + "] (" + player.Address + ") hat versucht, sich einzuloggen, steht aber nicht auf der Whitelist.";
ChatService.BroadcastAdmin(msg2, AdminLevel.ADMIN);
@@ -43,13 +46,16 @@ namespace ReallifeGamemode.Server.Events
}
}
registered = false;
if (IsPlayerBanned(player)) return;
NAPI.Task.Run(() =>
{
player.TriggerEvent("CLIENT:PlaySound", "music/login", "mp3", 20);
}, delayTime: 1000);
player.TriggerEvent("SERVER:Login_ShowBrowser");
player.TriggerEvent("SERVER:Login_ShowBrowser", registered);
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")";
ChatService.BroadcastAdmin(msg, AdminLevel.ADMIN);