Wie schaut denn euer C# Code aus? Wo ruft ihr denn die statischen Methoden auf? Was sagen die Debug Messages?
Der Code dafür sieht so aus:
Code
private void LoginPlayer(IBasicClient sender, object[] args)
{
Console.WriteLine("Debug message #1");
var username = (string)args[0];
var password = (string)args[1];
var key = "ZENSIERT";
var url = "http://forum.arizona-life.de/WbbVerify.php" + "&username=" + username + "&password=" + password;
System.Threading.Tasks.Task.Run(() =>
{
var webClient = new WebClient();
LoginResponse result = WebResult(webClient, url);
if (result == null)
{
sender.TriggerEvent("Client:Auth:LoginFailed", "Benutzername / Passwort falsch");
return;
}
if (result.banned)
{
sender.TriggerEvent("Client:Auth:LoginBanned", result.banReason);
sender.Kick("Dein Account wurde gesperrt.");
return;
}
if (result.StatusCode == 1)
{
var user = Server.Db.Users.AsQueryable().FirstOrDefault(x => x.ForumId == result.userID);
if (user == null)
{
var dbUser = new User
{
ForumId = result.userID,
SocialClubName = sender.SocialClubName,
Registered = DateTime.Now,
Characters = new List<ObjectId>()
};
Server.Db.Users.InsertOne(dbUser);
user = dbUser;
}
if (result.TemporaryCitizen && DateTime.Now >= user.Registered.AddDays(7))
{
_logger.Info($"Authentication for {username} failed! Reason: Probebürgerschaft abgelaufen");
sender.TriggerEvent("Client:Auth:WhiteListRequired");
sender.Kick("WhiteList: Probebürgerschaft abgelaufen.");
return;
}
_logger.Info($"{username} wurde erfolgreich eingeloggt!");
sender.TriggerEvent("Client:Auth:LoginSucceeded", "ok");
sender.Freezed = false;
user.Username = result.username;
lock (_loginQueue)
{
if (!_loginQueue.ContainsKey(sender))
_loginQueue.Add(sender, (user, 0));
}
Server.Db.Users.ReplaceOne(x => x.Id == user.Id, user);
if (!user.Characters.Any())
{
sender.SetSkin(0x705E61F2);
sender.Position = new Vector3(-812.1313f, 175.0686f, 76.74537f);
sender.Rotation = 115;
sender.PlayAnimation("anim@heists@fleeca_bank@scope_out@return_case", "trunk_action", 9);
// CharacterEditor Öffnen
sender.TriggerEvent("CharacterEditor:Open");
Console.WriteLine("LoginQueue enthält: " + _loginQueue.Keys.Count);
}
else
{
sender.TriggerEvent("Client:Auth:ShowCharSelection", 0);
}
return;
}
else
{
sender.TriggerEvent("Client:Auth:LoginFailed", "Benutzername / Passwort falsch");
return;
}
});
}
Alles anzeigen