Пример #1
0
        public static void HandleSelectCharacterReq(CharacterSession session, ClientSelectCharacterReq selectCharacterReq)
        {
            CharacterModel character = session.GetCharacterById(selectCharacterReq.CharacterId);

            if (character == null)
            {
                return;
            }

            ServerClusterModel node = ServerManager.Instance.GetServerNode(
                ConfigurationManager <CharacterServerConfig> .Instance.Model.Server.Id);

            if (node == null)
            {
                return;
            }

            session.SendMessage(new ServerSelectCharacterRes
            {
                Unknown0 = new ServerSelectCharacterRes.UnknownStructure
                {
                    CharacterId = character.Id,
                    AccountId   = session.Account.Id,
                    Host        = node.Host,
                    Port        = node.Port,
                    Position    = new WorldPosition
                    {
                        MapId       = character.MapId,
                        Origin      = new Vector3(character.X, character.Y, character.Z),
                        Orientation = character.O
                    }
                }
            });
        }