Beispiel #1
0
        private static void JoinExistingMessenger(int messengerID, Character chr)
        {
            Messenger messenger = Messengers.First(m => m.ID == messengerID);

            if (messenger == null) // This should already be confirmed when joining, but just to make sure.
            {
                return;
            }
            if (messenger.AddPlayer(chr)) // No action if messenger is full afaik.
            {
                chr.Messenger = messenger;
                foreach (Character mChr in messenger.Users)
                {
                    if (mChr == null)
                    {
                        continue;
                    }

                    if (mChr.ID == chr.ID)
                    {
                        chr.SendPacket(MessengerPacket.Enter(chr.MessengerSlot));
                    }
                    else
                    {
                        chr.SendPacket(MessengerPacket.SelfEnter(mChr)); // Announce existing players to joinee
                        mChr.SendPacket(MessengerPacket.SelfEnter(chr)); // Announce joinee to existing players
                    }
                }
            }
        }
Beispiel #2
0
        private static void CreateMessenger(Character pOwner)
        {
            Messenger messenger = new Messenger(pOwner);

            pOwner.SendPacket(MessengerPacket.Enter(pOwner.MessengerSlot));
        }