Example #1
0
		public void loadOneTable(TableID tableID)
		{			
			TableBase table = m_dicTable[tableID];
            byte[] bytes = Ctx.m_instance.m_localFileSys.LoadFileByte(Ctx.m_instance.m_cfg.m_path, table.m_resName + ".txt");
            ByteArray byteArray = new ByteArray();
            byteArray.writeBytes(bytes, 0, (uint)bytes.Length);
            byteArray.position = 0;
            readTable(TableID.TABLE_OBJECT, byteArray);
		}
Example #2
0
        private void readTable(TableID tableID, ByteArray bytes)
        {
            TableBase table = m_dicTable[tableID];
            bytes.endian = Endian.LITTLE_ENDIAN;
            uint len = bytes.readUnsignedInt();
            uint i = 0;
            ItemBase item = new ItemBase();

            for (i = 0; i < len; i++)
            {
                if (TableID.TABLE_OBJECT == tableID)
                {
                    item = new ObjectItem();
                }
                item.parseHeaderByteArray(bytes);
                //item.parseByteArrayTestServer(bytes);
                table.m_List.Add(item);
            }
        }