Esempio n. 1
0
        public static void HandleRealmList(WorldSession session, ClientRealmList realmList)
        {
            var serverRealmList = new ServerRealmList
            {
                Messages = ServerManager.ServerMessages
                           .Select(m => new NetworkMessage
                {
                    Index    = m.Index,
                    Messages = m.Messages
                })
                           .ToList()
            };

            foreach (ServerInfo server in ServerManager.Servers)
            {
                serverRealmList.Realms.Add(new ServerRealmList.RealmInfo
                {
                    RealmId          = server.Model.Id,
                    RealmName        = server.Model.Name,
                    Type             = (RealmType)server.Model.Type,
                    Status           = RealmStatus.Up,
                    Population       = RealmPopulation.Low,
                    Unknown8         = new byte[16],
                    AccountRealmInfo = new ServerRealmList.RealmInfo.AccountRealmData
                    {
                        RealmId = server.Model.Id
                    }
                });
            }

            session.EnqueueMessageEncrypted(serverRealmList);
        }
Esempio n. 2
0
        public static void HandleRealmList(WorldSession session, ClientRealmList realmList)
        {
            var serverRealmList = new ServerRealmList();

            foreach (ServerManager.ServerInfo server in ServerManager.Servers)
            {
                // TODO: finish this...
                serverRealmList.Realms.Add(new ServerRealmList.RealmInfo
                {
                    Unknown0   = 1,
                    Realm      = server.Model.Name,
                    Type       = (RealmType)server.Model.Type,
                    Status     = RealmStatus.Up,
                    Population = RealmPopulation.Low
                });
            }

            session.EnqueueMessageEncrypted(serverRealmList);
        }