public static void SendCloseCharacterTradeShopToOwnerResponse(IRealmClient client, Asda2PrivateShopClosedToOwnerResult status) { using (RealmPacketOut shopToOwnerResponse = Asda2PrivateShopHandler.CreateCloseCharacterTradeShopToOwnerResponse(status)) client.Send(shopToOwnerResponse, false); }
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); } }