using System; using GuildWarsInterface; using GuildWarsInterface.LoginServerLogic_; using GuildWarsPackets.CtoLS_; using Mod.Datastructures; using Mod.Hooks; using Mod.Networking; using Protocol.Messages; using Protocol.Messages.Login; namespace Mod.Logic.LoginServer { public class EnticeLoginLogic : LoginLogic { protected override void OnLogin(CtoLSPacket4_OldAuthLogin packet) { var request = new LoginRequest(new string(packet.EMail), PwCache.CachedPw); Client.Send(request); PwCache.CachedPw = null; LoginSuccess successResponse; Failure failResponse; switch (Client.WaitForMessage(10000, out successResponse, out failResponse)) { case 0: Console.WriteLine("timeout on login request"); return; case 1: break; case 2: OnLoginFailed(packet); return; } Game.ControlledCharacter = null; foreach (EntityView entityView in successResponse.chars) { EnticeAgent agent = Agents.CreateAgent(entityView); if (Game.ControlledCharacter == null) Game.ControlledCharacter = agent.Agent; Game.Account.AddCharacter(agent.Agent); } OnLoginSucceeded(packet); } } }