示例#1
0
        void HandleRealmList()
        {
            BinaryReader reader = new BinaryReader(connection.GetStream());

            uint            size      = reader.ReadUInt16();
            WorldServerList realmList = new WorldServerList(reader);

            Exchange.AuthMessage = "Connected";

            if (LoginHelpers.LAST_KNOWN_REALM_LIST.Length > 2)
            {
                foreach (WorldServerInfo rl in Exchange.gameClient.RealmServerList)
                {
                    if (rl.Name == LoginHelpers.LAST_KNOWN_REALM_LIST)
                    {
                        LoginHelpers.ConnectToWorld = true;
                        Exchange.CurrentRealm       = rl;
                        Exchange.gameClient.ConnectTo(Exchange.CurrentRealm);
                    }
                }
            }
            else
            {
                AuthFrame.ShowRealms = true;
            }
        }
示例#2
0
        void HandleRealmList()
        {
            BinaryReader reader = new BinaryReader(connection.GetStream());

            uint            size      = reader.ReadUInt16();
            WorldServerList realmList = new WorldServerList(reader);

            Game.UI.LogDebug("Received realm list");

            Game.UI.PresentRealmList(realmList);
        }
示例#3
0
        public override void PresentRealmList(WorldServerList realmList)
        {
            if (RealmID >= realmList.Count)
            {
                LogException("Invalid RealmID '" + RealmID + "' specified in the configs");
                Environment.Exit(1);
            }

            LogLine("Connecting to realm " + realmList[RealmID].Name);
            ConnectTo(realmList[RealmID]);
        }
示例#4
0
        public void PresentRealmList(WorldServerList worldServerList)
        {
            WorldServerInfo selectedServer = null;

            if (worldServerList.Count == 1)
            {
                selectedServer = worldServerList[0];
            }
            else
            {
                LogLine("\n\tName\tType\tPopulation");

                int index = 0;
                foreach (WorldServerInfo server in worldServerList)
                {
                    LogLine
                    (
                        string.Format("{0}\t{1}\t{2}\t{3}",
                                      index++,
                                      server.Name,
                                      server.Type,
                                      server.Population
                                      )
                    );
                }


                index = Settings.Default.RealmID;

                if (index == -1) // select a realm - default to the first realm if there is only one
                {
                    index = worldServerList.Count == 1 ? 0 : -1;
                }

                while (index > worldServerList.Count || index < 0)
                {
                    Log("Choose a realm:  ");
                    if (!int.TryParse(Console.ReadLine(), out index))
                    {
                        LogLine();
                    }
                }
                selectedServer = worldServerList[index];
            }

            Game.ConnectTo(selectedServer);
        }
示例#5
0
        public void PresentRealmList(WorldServerList worldServerList)
        {
            WorldServerInfo selectedServer = null;

            if (worldServerList.Count == 1)
                selectedServer = worldServerList[0];
            else
            {
                LogLine("\n\tName\tType\tPopulation");

                int index = 0;
                foreach (WorldServerInfo server in worldServerList)
                    LogLine
                    (
                        string.Format("{0}\t{1}\t{2}\t{3}",
                        index++,
                        server.Name,
                        server.Type,
                        server.Population
                        )
                    );

                index = Settings.Default.RealmID;

                if (index == -1) // select a realm - default to the first realm if there is only one
                    index = worldServerList.Count == 1 ? 0 : -1;

                while (index > worldServerList.Count || index < 0)
                {
                    Log("Choose a realm:  ");
                    if (!int.TryParse(Console.ReadLine(), out index))
                        LogLine();
                }
                selectedServer = worldServerList[index];
            }

            Game.ConnectTo(selectedServer);
        }
示例#6
0
 public abstract void PresentRealmList(WorldServerList realmList);
示例#7
0
        public override void PresentRealmList(WorldServerList realmList)
        {
            if (RealmID >= realmList.Count)
            {
                LogException("Invalid RealmID '" + RealmID + "' specified in the configs");
                Environment.Exit(1);
            }

            LogLine("Connecting to realm " + realmList[RealmID].Name);
            ConnectTo(realmList[RealmID]);
        }
示例#8
0
        void HandleRealmList()
        {
            BinaryReader reader = new BinaryReader(connection.GetStream());

            uint size = reader.ReadUInt16();
            WorldServerList realmList = new WorldServerList(reader);
            Game.UI.LogLine("Received realm list", LogLevel.Debug);

            Game.UI.PresentRealmList(realmList);
        }
示例#9
0
 public override void PresentRealmList(WorldServerList realmList)
 {
     ConnectTo(realmList[RealmID]);
 }
示例#10
0
 public abstract void PresentRealmList(WorldServerList realmList);
示例#11
0
 public override void PresentRealmList(WorldServerList realmList)
 {
     LogLine("Connecting to realm " + realmList[RealmID].Name);
     ConnectTo(realmList[RealmID]);
 }
示例#12
0
 public override void PresentRealmList(WorldServerList realmList)
 {
     LogLine("Connecting to realm " + realmList[RealmID].Name);
     ConnectTo(realmList[RealmID]);
 }