Example #1
0
    public void ConvertToByteData()
    {
        try
        {
            string xmlData = FileUtils.ReadStringFile(m_strDataOutputPath + "/" + m_strXmlName);

            if (string.IsNullOrEmpty(xmlData))
            {
                Tip("xml 文件为空");
                return;
            }

            TrunkConfigTable table = new TrunkConfigTable();
            table.TrunkConfigXml = xmlData;

            byte[] data = ThriftSerialize.Serialize(table);
            FileUtils.WriteByteFile(m_strDataOutputPath + "/" + m_strByteName, data);
        }
        catch (Exception e)
        {
            Debug.LogException(e);
            Tip(e.Message);
            throw;
        }
    }
Example #2
0
    public RunnerTrunkTableConfig GetTrunkConfigTable()
    {
        TrunkConfigTable config = TryGetConfig <TrunkConfigTable>(ConfigPath_LimitFuncSceneConfig);

        if (null == config || string.IsNullOrEmpty(config.TrunkConfigXml))
        {
            return(null);
        }
        RunnerTrunkTableConfig res = XmlConfigBase.DeSerialize <RunnerTrunkTableConfig>(config.TrunkConfigXml);

        return(res);
    }