Пример #1
0
 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;
 }
Пример #2
0
        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));
        }
Пример #3
0
 public bool Contains(Account friend)
 {
     return _friends.Where(friendz => friendz.Friend == friend).FirstOrDefault() != null;
 }
Пример #4
0
 public FriendInformations Add(Account target)
 {
     return Add(new FriendInformations(target));
 }
Пример #5
0
 public bool Remove(Account target)
 {
     return Remove(FindOne(friend => friend.Friend == target));
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
        /// <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;
        }