using System; using GuildWarsInterface.Datastructures.Components; using GuildWarsInterface.GameServerLogic_; using Mod.Datastructures; using Mod.Networking; using Protocol.Components; using Protocol.Messages; using Protocol.Messages.CharacterCreation; namespace Mod.Logic.GameServer { public class EnticeCharacterCreationLogic : CharacterCreationLogic { protected override void OnValidateNewCharacter(string name, AgentAppearance appearance) { var appearanceComponent = new Appearance(appearance.Sex, appearance.Height, appearance.SkinColor, appearance.HairColor, appearance.Face, appearance.Profession, appearance.Hairstyle, appearance.Campaign); Client.Send(new CharCreateRequest(name, appearanceComponent)); CharCreateSuccess successResponse; Failure failResponse; switch (Client.WaitForMessage(2000, out successResponse, out failResponse)) { case 0: Console.WriteLine("timeout on charcreate request"); return; case 1: var createdCharacter = Agents.CreateAgent(successResponse.chara.uuid).Agent; createdCharacter.Name = name; createdCharacter.Appearance = appearance; OnValidationSucceeded(createdCharacter); break; case 2: Console.WriteLine("charcreate failed error: " + failResponse.error); OnValidationFailed(); return; } } } }