public Character(int id, Account owner, string name, Gender gender, Breed breed, int level, List<int> colors, int lastUse, Network.Types.context.EntityDispositionInformations disposition, Network.Types.character.CharacterCharacteristicsInformations characteristics) { _id = id; _owner = owner; _name = name; _gender = gender; _breed = breed; _level = level; _look = new Network.Types.EntityLook(this, colors); _lastUse = lastUse; _disposition = disposition; _characteristics = characteristics; }
private void Parse_AuthenticationTicketMessage(AuthenticationTicketMessage message) { _account = Environment.Instance.GetWaitingAccount(message.Ticket); if (_account == null) { _client.Send(new Utils.Objects.Packet(PacketID.AuthenticationTicketRefusedMessage)); return; } if (_account.Connected) { _client.Send(new Utils.Objects.Packet(PacketID.AlreadyConnectedMessage)); return; } _account.Connected = true; _client.Send(new Utils.Objects.Packet(PacketID.AuthenticationTicketAcceptedMessage)); _client.Send(new BasicTimeMessage()); _client.Send(new AccountCapabilitiesMessage( (int)_account.Id )); _client.Send(new Utils.Objects.Packet(PacketID.BasicNoOperationMessage)); }
public bool Contains(Account friend) { return _friends.Where(friendz => friendz.Friend == friend).FirstOrDefault() != null; }
public FriendInformations Add(Account target) { return Add(new FriendInformations(target)); }
public bool Remove(Account target) { return Remove(FindOne(friend => friend.Friend == target)); }
/// <summary> /// Add an account in the account list awaiting connection to gameserver. /// </summary> /// <param name="key">Retrieval key</param> /// <param name="value">Awaiting account</param> public void AddWaitingAccount(string key, Account value) { _waitingAccounts.Add(key, value); }
/// <summary> /// Initialize and insert the character in the database. /// </summary> /// <param name="owner">Owner of character</param> /// <param name="name">Character's name</param> /// <param name="gender">Character's gender</param> /// <param name="breed">Character's breed</param> /// <param name="colors">Character's colors</param> /// <returns>Character created</returns> public static Character New(Account owner, string name, Gender gender, Breed breed, List<int> colors) { Character ret = new Character ( ++s_lastId, owner, name, gender, breed, GlobalConfig.Network.Game.StartLevel, colors, Environment.Instance.Now, new Network.Types.context.EntityDispositionInformations ( GlobalConfig.Network.Game.StartMap, GlobalConfig.Network.Game.StartCell, Directions.SOUTH_WEST ), new Network.Types.character.CharacterCharacteristicsInformations ( GlobalConfig.Network.Game.StartLevel, breed, (5*GlobalConfig.Network.Game.StartLevel-5), (GlobalConfig.Network.Game.StartLevel - 1), 0, 0, 0, 0, 0, 0, 0, 0 ) ); Insert(ret); return ret; }