Exemple #1
0
        internal static ServerMessage ComposePage(CatalogPage Page)
        {
            ServerMessage Message = new ServerMessage(Outgoing.CataloguePageMessageComposer);

            Message.AppendInt32(Page.PageId);
            Message.AppendString("NORMAL");

            switch (Page.Layout)
            {
            case "frontpage":
                Message.AppendString("frontpage4");
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(2);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendInt32(0);
                Message.AppendInt32(-1);
                Message.AppendBoolean(false);
                break;

            case "roomads":
                Message.AppendString("roomads");
                Message.AppendInt32(2);
                Message.AppendString("events_header");
                Message.AppendString("");
                Message.AppendInt32(2);
                Message.AppendString(Page.Text1);
                Message.AppendString("");
                break;

            case "bots":
                Message.AppendString("bots");
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendString(Page.TextDetails);
                break;

            case "badge_display":
                Message.AppendString("badge_display");
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendString(Page.TextDetails);
                break;

            case "info_loyalty":
            case "info_duckets":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(1);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendInt32(1);
                Message.AppendString(Page.Text1);
                break;

            case "sold_ltd_items":
                Message.AppendString("sold_ltd_items");
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendString(Page.TextDetails);
                break;

            case "recycler_info":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendString(Page.TextDetails);
                break;

            case "recycler_prizes":
                Message.AppendString("recycler_prizes");
                Message.AppendInt32(1);
                Message.AppendString("catalog_recycler_headline3");
                Message.AppendInt32(1);
                Message.AppendString(Page.Text1);
                break;

            case "spaces_new":
            case "spaces":
                Message.AppendString("spaces_new");
                Message.AppendInt32(1);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendInt32(1);
                Message.AppendString(Page.Text1);
                break;

            case "recycler":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(1);
                Message.AppendString(Page.Text1);
                Message.AppendInt32(-1);
                Message.AppendBoolean(false);
                break;

            case "trophies":
                Message.AppendString("trophies");
                Message.AppendInt32(1);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendInt32(2);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.TextDetails);
                break;

            case "pets":
            case "pets2":
            case "pets3":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(4);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                Message.AppendString(Page.TextDetails);
                Message.AppendString(Page.TextTeaser);
                break;

            case "soundmachine":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(2);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.TextDetails);
                break;

            case "vip_buy":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(0);
                break;

            case "guild_custom_furni":
                Message.AppendString("guild_custom_furni");
                Message.AppendInt32(3);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString("");
                Message.AppendString("");
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.TextDetails);
                Message.AppendString(Page.Text2);
                break;

            case "guild_frontpage":
                Message.AppendString("guild_frontpage");
                Message.AppendInt32(2);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.TextDetails);
                Message.AppendString(Page.Text2);
                break;

            case "guild_forum":
                Message.AppendString("guild_forum");
                Message.AppendInt32(0);
                Message.AppendInt32(2);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.Text2);
                break;

            case "club_gifts":
                Message.AppendString("club_gifts");
                Message.AppendInt32(1);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendInt32(1);
                Message.AppendString(Page.Text1);
                break;

            default:
            case "default_3x3":
                Message.AppendString(Page.Layout);
                Message.AppendInt32(3);
                Message.AppendString(Page.LayoutHeadline);
                Message.AppendString(Page.LayoutTeaser);
                Message.AppendString(Page.LayoutSpecial);
                Message.AppendInt32(3);
                Message.AppendString(Page.Text1);
                Message.AppendString(Page.TextDetails);
                Message.AppendString(Page.TextTeaser);
                break;
            }

            if (Page.Layout.StartsWith("frontpage") || Page.Layout == "vip_buy")
            {
                Message.AppendInt32(0);
            }
            else
            {
                Message.AppendInt32(Page.Items.Count);
                foreach (CatalogItem Item in Page.Items.Values)
                {
                    ComposeItem(Item, Message);
                }
            }


            Message.AppendInt32(-1);
            Message.AppendBoolean(false);

            return(Message);
        }
        internal static ServerMessage ComposePage(CatalogPage Page)
        {
            ServerMessage Message = new ServerMessage(Outgoing.CataloguePageMessageComposer);
            Message.AppendInt32(Page.PageId);
            Message.AppendString("NORMAL");

            switch (Page.Layout)
            {
                case "frontpage":
                    Message.AppendString("frontpage4");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendInt32(0);
                    Message.AppendInt32(-1);
                    Message.AppendBoolean(false);
                    break;

                case "roomads":
                    Message.AppendString("roomads");
                    Message.AppendInt32(2);
                    Message.AppendString("events_header");
                    Message.AppendString("");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.Text1);
                    Message.AppendString("");
                    break;

                case "bots":
                    Message.AppendString("bots");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendString(Page.TextDetails);
                    break;

                case "badge_display":
                    Message.AppendString("badge_display");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendString(Page.TextDetails);
                    break;

                case "info_loyalty":
                case "info_duckets":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(1);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendInt32(1);
                    Message.AppendString(Page.Text1);
                    break;
                case "sold_ltd_items":
                    Message.AppendString("sold_ltd_items");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendString(Page.TextDetails);
                    break;
                case "recycler_info":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendString(Page.TextDetails);
                    break;
                case "recycler_prizes":
                    Message.AppendString("recycler_prizes");
                    Message.AppendInt32(1);
                    Message.AppendString("catalog_recycler_headline3");
                    Message.AppendInt32(1);
                    Message.AppendString(Page.Text1);
                    break;
                case "spaces_new":
                case "spaces":
                    Message.AppendString("spaces_new");
                    Message.AppendInt32(1);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendInt32(1);
                    Message.AppendString(Page.Text1);
                    break;
                case "recycler":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(1);
                    Message.AppendString(Page.Text1);
                    Message.AppendInt32(-1);
                    Message.AppendBoolean(false);
                    break;

                case "trophies":
                    Message.AppendString("trophies");
                    Message.AppendInt32(1);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.TextDetails);
                    break;

                case "pets":
                case "pets2":
                case "pets3":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(4);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    Message.AppendString(Page.TextDetails);
                    Message.AppendString(Page.TextTeaser);
                    break;

                case "soundmachine":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.TextDetails);
                    break;
                case "vip_buy":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(0);
                    break;

                case "guild_custom_furni":
                    Message.AppendString("guild_custom_furni");
                    Message.AppendInt32(3);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString("");
                    Message.AppendString("");
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.TextDetails);
                    Message.AppendString(Page.Text2);
                    break;

                case "guild_frontpage":
                    Message.AppendString("guild_frontpage");
                    Message.AppendInt32(2);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.TextDetails);
                    Message.AppendString(Page.Text2);
                    break;

                case "guild_forum":
                    Message.AppendString("guild_forum");
                    Message.AppendInt32(0);
                    Message.AppendInt32(2);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.Text2);
                    break;

                case "club_gifts":
                    Message.AppendString("club_gifts");
                    Message.AppendInt32(1);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendInt32(1);
                    Message.AppendString(Page.Text1);
                    break;

                default:
                case "default_3x3":
                    Message.AppendString(Page.Layout);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.LayoutHeadline);
                    Message.AppendString(Page.LayoutTeaser);
                    Message.AppendString(Page.LayoutSpecial);
                    Message.AppendInt32(3);
                    Message.AppendString(Page.Text1);
                    Message.AppendString(Page.TextDetails);
                    Message.AppendString(Page.TextTeaser);
                    break;
            }

            if (Page.Layout.StartsWith("frontpage") || Page.Layout == "vip_buy")
            {
                Message.AppendInt32(0);
            }
            else
            {
                Message.AppendInt32(Page.Items.Count);
                foreach (CatalogItem Item in Page.Items.Values)
                {
                    ComposeItem(Item, Message);
                }
            }
                

            Message.AppendInt32(-1);
            Message.AppendBoolean(false);

            return Message;
        }