Exemple #1
0
        public static void ReceivedKey(RealmLink link, Protocol.ForwardPacket packet)
        {
            string key = packet.Reader.ReadString();

            if (key == Utilities.ConfigurationManager.GetStringValue("SecureKey"))
            {
                Utilities.ConsoleStyle.Realm("Key match, MainRealm connected !");
                link.IsMain      = true;
                Server.MainRealm = link;
                foreach (World.Network.WorldClient client in World.Helper.WorldHelper.GetClientsArray)
                {
                    if (client.Account != null)
                    {
                        Communication.Realm.Communicator.Server.MainRealm.SendMessage
                            (new Communication.Realm.Packet.PlayerConnectedMessage(client.Account.Username));
                    }
                }
            }
            else
            {
                Utilities.ConsoleStyle.Realm("Key '" + key + "' is not valid !");
                link.Close();
            }
        }