Beispiel #1
0
    public bool Load(string packName, string tabName)
    {
        CSVDoc doc = new CSVDoc();
        // doc.LoadCsvFile(packName, tabName);


        //对数据的有效性进行验证
        PacketRouting pack = PacketManage.Single.GetPacket(packName);

        if (pack == null)
        {
            Debug.LogError("LoadCsvFile 包不存在" + packName);
            return(false);
        }

        string csvcontent = pack.LoadString(tabName);

        if (csvcontent == null)
        {
            Debug.LogError(string.Format("LoadCsvFile 文件不存在 {0}/{1}", packName, tabName));
            return(false);
        }
        doc.LoadCsvFromMem(csvcontent);



        m_reader = new CSVReader(doc);
        return(true);
    }
Beispiel #2
0
 static int LoadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         PacketRouting           obj  = (PacketRouting)ToLua.CheckObject(L, 1, typeof(PacketRouting));
         string                  arg0 = ToLua.CheckString(L, 2);
         FileSystem.RES_LOCATION arg1 = (FileSystem.RES_LOCATION)ToLua.CheckObject(L, 3, typeof(FileSystem.RES_LOCATION));
         string                  o    = obj.LoadString(arg0, arg1);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }