Exemple #1
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            uint Id = Event.PopWiredUInt();

            CatalogItem Item = PhoenixEnvironment.GetGame().GetCatalog().FindItem(Id);

            if (Item != null)
            {
                ServerMessage Message = new ServerMessage(622);
                Message.AppendUInt(Item.Id);
                Message.AppendBoolean(Item.GetBaseItem().AllowGift);
                Session.SendMessage(Message);
            }
        }
Exemple #2
0
        internal void CanGift()
        {
            uint Id = Request.PopWiredUInt();

            CatalogItem Item = ButterflyEnvironment.GetGame().GetCatalog().FindItem(Id);

            if (Item == null)
            {
                return;
            }

            GetResponse().Init(622);
            GetResponse().AppendUInt(Item.Id);
            GetResponse().AppendBoolean(Item.GetBaseItem().AllowGift);
            SendResponse();
        }
Exemple #3
0
        internal static void ComposeItem(CatalogItem Item, ServerMessage Message)
        {
            Message.AppendUInt(Item.Id);
            Message.AppendString(Item.Name);
            Message.AppendBoolean(false);
            Message.AppendInt32(Item.CreditsCost);
            if (Item.BelCreditsCost > 0)
            {
                Message.AppendInt32(Item.BelCreditsCost);
                Message.AppendInt32(105);
            }
            else
            {
                if (Item.LoyaltyCost > 0)
                {
                    Message.AppendInt32(Item.LoyaltyCost);
                    Message.AppendInt32(105);
                }
                else
                {
                    Message.AppendInt32(Item.DucketsCost);
                    Message.AppendInt32(0);
                }
            }
            Message.AppendBoolean(Item.GetFirstBaseItem().AllowGift);
            checked
            {
                if (Item.Name == "g0 group_product")
                {
                    Message.AppendInt32(0);
                }
                else
                {
                    if (Item.Badge == "")
                    {
                        Message.AppendInt32(Item.Items.Count);
                    }
                    else
                    {
                        if (Item.Name == "room_ad_plus_badge")
                        {
                            Message.AppendInt32(1);
                        }
                        else
                        {
                            Message.AppendInt32(Item.Items.Count + 1);
                        }
                        Message.AppendString("b");
                        Message.AppendString(Item.Badge);
                    }
                }
                foreach (uint current in Item.Items.Keys)
                {
                    if (Item.Name == "g0 group_product")
                    {
                        break;
                    }
                    if (Item.Name != "room_ad_plus_badge")
                    {
                        Message.AppendString(Item.GetBaseItem(current).Type.ToString());
                        Message.AppendInt32(Item.GetBaseItem(current).SpriteId);

                        if (Item.Name.Contains("wallpaper_single") || Item.Name.Contains("floor_single") || Item.Name.Contains("landscape_single"))
                        {
                            string[] array = Item.Name.Split('_');
                            Message.AppendString(array[2]);
                        }
                        else
                        {
                            if (Item.Name.StartsWith("bot_") || Item.GetBaseItem(current).InteractionType == InteractionType.musicdisc)
                            {
                                Message.AppendString(Item.ExtraData);
                            }
                            else
                            {
                                if (Item.Name.StartsWith("poster_"))
                                {
                                    string[] array2 = Item.Name.Split('_');
                                    Message.AppendString(array2[1]);
                                }
                                else
                                {
                                    if (Item.Name.StartsWith("poster "))
                                    {
                                        string[] array3 = Item.Name.Split(' ');
                                        Message.AppendString(array3[1]);
                                    }
                                    else
                                    {
                                        if (Item.songID > 0u && Item.GetBaseItem(current).InteractionType == InteractionType.musicdisc)
                                        {
                                            Message.AppendString(Item.ExtraData);
                                        }
                                        else
                                        {
                                            Message.AppendString(string.Empty);
                                        }
                                    }
                                }
                            }
                        }
                        Message.AppendInt32(Item.Items[current]);
                        Message.AppendBoolean(Item.IsLimited);
                        if (Item.IsLimited)
                        {
                            Message.AppendInt32(Item.LimitedStack);
                            Message.AppendInt32(Item.LimitedStack - Item.LimitedSelled);
                        }
                    }
                    else
                    {
                        Message.AppendString("");
                        Message.AppendInt32(0);
                    }
                }
                Message.AppendInt32(Item.ClubOnly ? 1 : 0);
                if (Item.IsLimited || Item.FirstAmount != 1)
                {
                    Message.AppendBoolean(false);
                    return;
                }
                Message.AppendBoolean(Item.HaveOffer && !Item.IsLimited);
            }
        }