Ejemplo n.º 1
0
        public void Exit(Character activeCharacter)
        {
            if (activeCharacter == Owner)
            {
                using (RealmPacketOut shopToOwnerResponse =
                           Asda2PrivateShopHandler.CreateCloseCharacterTradeShopToOwnerResponse(
                               Asda2PrivateShopClosedToOwnerResult.HostClosedShop))
                {
                    foreach (Character joinedCharacter in JoinedCharacters)
                    {
                        joinedCharacter.Send(shopToOwnerResponse, false);
                        joinedCharacter.PrivateShop = null;
                        --joinedCharacter.Stunned;
                    }
                }

                JoinedCharacters.Clear();
                _joinedCharacters           = null;
                _itemsOnTrade               = null;
                activeCharacter.PrivateShop = null;
                activeCharacter.IsAsda2TradeDescriptionEnabled = false;
                activeCharacter.Asda2TradeDescription          = "";
                Asda2PrivateShopHandler.SendCloseCharacterTradeShopToOwnerResponse(activeCharacter.Client,
                                                                                   Asda2PrivateShopClosedToOwnerResult.Ok);
            }
            else
            {
                JoinedCharacters.Remove(activeCharacter);
                List <Character> characterList = new List <Character>
                {
                    Owner
                };
                characterList.AddRange(JoinedCharacters);
                using (RealmPacketOut notificationResponse =
                           Asda2PrivateShopHandler.CreatePrivateShopChatNotificationResponse(activeCharacter.AccId,
                                                                                             Asda2PrivateShopNotificationType.Left))
                {
                    foreach (Character character in characterList)
                    {
                        character.Send(notificationResponse, false);
                    }
                }

                --activeCharacter.Stunned;
                activeCharacter.PrivateShop = null;
                Asda2PrivateShopHandler.SendCloseCharacterTradeShopToOwnerResponse(activeCharacter.Client,
                                                                                   Asda2PrivateShopClosedToOwnerResult.Ok);
            }
        }
Ejemplo n.º 2
0
        public void Join(Character activeCharacter)
        {
            List <Character> characterList = new List <Character>
            {
                Owner
            };

            characterList.AddRange(JoinedCharacters);
            using (RealmPacketOut notificationResponse =
                       Asda2PrivateShopHandler.CreatePrivateShopChatNotificationResponse(activeCharacter.AccId,
                                                                                         Asda2PrivateShopNotificationType.Joined))
            {
                foreach (Character character in characterList)
                {
                    character.Send(notificationResponse, false);
                }
            }

            ++activeCharacter.Stunned;
            JoinedCharacters.Add(activeCharacter);
            Asda2PrivateShopHandler.SendCharacterPrivateShopInfoResponse(activeCharacter.Client,
                                                                         Asda2ViewTradeShopInfoStatus.Ok, this);
            activeCharacter.PrivateShop = this;
        }