Beispiel #1
0
        private void BurnTower(Character character)
        {
            Warmaster.Delete();
            // Notify the BG, remove this warmaster from the AIGroup.
            ChatMgr.SendSystemMessage(Instance.Characters, Name + " has been destroyed by the " + BaseOwner);

            // Check this: (the flag/tower should burn and become unusable)
            FlagStand.FirstSpawnEntry.AnimProgress = 255;
        }
Beispiel #2
0
        public void TestSimpleChat()
        {
            var chr1 = Setup.AllianceCharacterPool.Create();
            var chr2 = Setup.AllianceCharacterPool.Create();

            DebugUtil.Dumps = true;

            chr1.EnsureInWorldAndLiving();
            chr2.EnsureLiving();

            chr2.EnsureXDistance(chr1, 1, true);

            Thread.Sleep(1000);

            chr1.Map.AddMessageAndWait(new Message1 <Map>(
                                           chr1.Map, (rgn) => ChatMgr.SendSystemMessage(rgn.Characters, "huhu")
                                           ));
        }
        public static void PlayerLoginRequest(RealmClient client, RealmPacketIn packet)
        {
            if (client.Account == null)
            {
                return;
            }

            try
            {
                EntityId charGUID = packet.ReadEntityId();

                if (charGUID != EntityId.Zero)
                {
                    if (s_characters.ContainsKey(charGUID) && !s_characters[charGUID].IsLoggingOut)
                    {
                        s_log.Error(string.Format(Resources.CharacterAlreadyConnected, charGUID, client.Account.Username));

                        Character.SendCharacterLoginFail(client, LoginErrorCodes.CHAR_LOGIN_DUPLICATE_CHARACTER);
                    }
                    else
                    {
                        if (!client.Account.Characters.ContainsKey(charGUID))
                        {
                            s_log.Error(string.Format(Resources.CharacterNotFound, charGUID, client.Account.Username));

                            Character.SendCharacterLoginFail(client, LoginErrorCodes.CHAR_LOGIN_NO_CHARACTER);

                            client.Server.DisconnectClient(client);
                        }
                        else
                        {
                            Character existingChar = null;

                            // this handles character reconnection cases, which relinks a character
                            // in the process of being logged out.
                            if (s_characters.TryGetValue(charGUID, out existingChar))
                            {
                                existingChar.ReconnectCharacter(client);
                            }
                            else
                            {
                                // Set and register the current character.
                                client.ActiveCharacter = new Character(client.Account, client.Account.Characters[charGUID], client);
                                RegisterCharacter(client.ActiveCharacter);

                                // Start character login process
                                client.ActiveCharacter.FirstLogin();
                            }

                            // Give them our version. (as if they care :p)
                            Version ver     = Assembly.GetCallingAssembly().GetName().Version;
                            string  message = string.Format("Welcome to WCell {0}.{1}.{2}.{3}",
                                                            ver.Major, ver.Minor, ver.Revision, ver.Build);

                            ChatMgr.SendSystemMessage(client, message);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                s_log.Error(e);
                Character.SendCharacterLoginFail(client, LoginErrorCodes.CHAR_LOGIN_FAILED);
            }
        }