public static string MxDBuildSaveString(bool inncludeAltEnh, bool forumMode)
    {
        MidsCharacterFileFormat.CompressionData cData = default(MidsCharacterFileFormat.CompressionData);
        string str = MidsCharacterFileFormat.MxDBuildSaveStringShared(ref cData, inncludeAltEnh, true);
        string str2;

        if (string.IsNullOrEmpty(str))
        {
            str2 = string.Empty;
        }
        else
        {
            string str3 = "\n";
            string str4;
            if (forumMode)
            {
                bool flag  = MidsContext.Config.Export.FormatCode[MidsContext.Config.ExportTarget].Notes.IndexOf("HTML", StringComparison.Ordinal) > -1;
                bool flag2 = MidsContext.Config.Export.FormatCode[MidsContext.Config.ExportTarget].Notes.IndexOf("no <br /> tags", StringComparison.OrdinalIgnoreCase) > -1;
                if (flag && !flag2)
                {
                    str  = str.Replace("\n", "<br />");
                    str3 = "<br />";
                }
                str4 = "| Copy & Paste this data into Mids' Hero Designer to view the build |" + str3;
                if (flag)
                {
                    str4 = str4.Replace(" ", "&nbsp;");
                }
                str4 = str4 + "|-------------------------------------------------------------------|" + str3;
            }
            else
            {
                str4 = "|              Do not modify anything below this line!              |" + str3 + "|-------------------------------------------------------------------|" + str3;
            }
            string str5 = ";HEX";
            object obj  = str4;
            str4 = string.Concat(new object[]
            {
                obj,
                "|MxDz;",
                cData.SzUncompressed,
                ";",
                cData.SzCompressed,
                ";",
                cData.SzEncoded,
                str5,
                ";|",
                str3
            });
            str4 = str4 + str + str3;
            str2 = str4 + "|-------------------------------------------------------------------|";
        }
        return(str2);
    }
    public static string MxDBuildSaveHyperlink(bool useBbCode, bool justLink = false)
    {
        MidsCharacterFileFormat.CompressionData cData = default(MidsCharacterFileFormat.CompressionData);
        string str = MidsCharacterFileFormat.MxDBuildSaveStringShared(ref cData, false, false);
        string str2;

        if (string.IsNullOrEmpty(str))
        {
            str2 = string.Empty;
        }
        else
        {
            string str4 = string.Concat(new object[]
            {
                "?uc=",
                cData.SzUncompressed,
                "&c=",
                cData.SzCompressed,
                "&a=",
                cData.SzEncoded,
                "&f=HEX&dc="
            });
            string str3 = "http://www.cohplanner.com/mids/download.php" + str4 + str;
            if (str3.Length > 2048)
            {
                str2 = "";
            }
            else if (justLink)
            {
                str2 = str3;
            }
            else
            {
                if (useBbCode)
                {
                    str3 = "[url=" + str3 + "]Click this DataLink to open the build![/url]";
                }
                else
                {
                    str3 = "<a href=\"" + str3 + "\">Click this DataLink to open the build!</a>";
                }
                str2 = str3;
            }
        }
        return(str2);
    }
    static string MxDBuildSaveStringShared(ref MidsCharacterFileFormat.CompressionData cData, bool inncludeAltEnh, bool @break)
    {
        byte[] numArray = new byte[0];
        string str;

        if (!MidsCharacterFileFormat.MxDBuildSaveBuffer(ref numArray, inncludeAltEnh))
        {
            str = string.Empty;
        }
        else
        {
            ASCIIEncoding asciiEncoding = new ASCIIEncoding();
            cData.SzUncompressed = numArray.Length;
            byte[] bytes = Zlib.CompressChunk(ref numArray);
            cData.SzCompressed = bytes.Length;
            bytes           = Zlib.HexEncodeBytes(bytes);
            cData.SzEncoded = bytes.Length;
            str             = (@break ? Zlib.BreakString(asciiEncoding.GetString(bytes), 67, true) : asciiEncoding.GetString(bytes));
        }
        return(str);
    }