Convert Minecraft server world files into MCserver world files.
#69
I'm cleaning up the code now and making it compatible with windows. I'm applying the new bits of information I've learned about c++ lately.

memcpy is so much faster than a for loop. lol.
The program is now 20 times faster. It only takes about 1 second per region as opposed to a little over 20 before and over 300 for the PHP converter.


C++ works much better when you use it correctly. Big Grin


There's still a memory leak. I think it's because I can't delete the NBTData object in between regions. Every time I try I either get a segfault or this:


Any ideas?
[/code]
Code:
*** glibc detected *** ./denotch: double free or corruption (!prev): 0x0000000000c5d580 ***
======= Backtrace: =========
/lib/libc.so.6(+0x775b6)[0x7fc6902d25b6]
/lib/libc.so.6(cfree+0x73)[0x7fc6902d8e83]
./denotch[0x409f07]
./denotch[0x405e3e]
./denotch[0x403669]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fc690279c4d]
./denotch[0x401fc9]
======= Memory map: ========
00400000-00421000 r-xp 00000000 08:11 14                                 /media/ssd/mc-server/mc-server/converter/denotch
00620000-00621000 r--p 00020000 08:11 14                                 /media/ssd/mc-server/mc-server/converter/denotch
00621000-00622000 rw-p 00021000 08:11 14                                 /media/ssd/mc-server/mc-server/converter/denotch
00c54000-00cb2000 rw-p 00000000 00:00 0                                  [heap]
7fc688000000-7fc688021000 rw-p 00000000 00:00 0
7fc688021000-7fc68c000000 ---p 00000000 00:00 0
7fc68fd5a000-7fc69025b000 rw-p 00000000 00:00 0
7fc69025b000-7fc6903d5000 r-xp 00000000 fb:00 44433761                   /lib/libc-2.11.1.so
7fc6903d5000-7fc6905d4000 ---p 0017a000 fb:00 44433761                   /lib/libc-2.11.1.so
7fc6905d4000-7fc6905d8000 r--p 00179000 fb:00 44433761                   /lib/libc-2.11.1.so
7fc6905d8000-7fc6905d9000 rw-p 0017d000 fb:00 44433761                   /lib/libc-2.11.1.so
7fc6905d9000-7fc6905de000 rw-p 00000000 00:00 0
7fc6905de000-7fc6905f4000 r-xp 00000000 fb:00 44433463                   /lib/libgcc_s.so.1
7fc6905f4000-7fc6907f3000 ---p 00016000 fb:00 44433463                   /lib/libgcc_s.so.1
7fc6907f3000-7fc6907f4000 r--p 00015000 fb:00 44433463                   /lib/libgcc_s.so.1
7fc6907f4000-7fc6907f5000 rw-p 00016000 fb:00 44433463                   /lib/libgcc_s.so.1
7fc6907f5000-7fc690877000 r-xp 00000000 fb:00 44433768                   /lib/libm-2.11.1.so
7fc690877000-7fc690a76000 ---p 00082000 fb:00 44433768                   /lib/libm-2.11.1.so
7fc690a76000-7fc690a77000 r--p 00081000 fb:00 44433768                   /lib/libm-2.11.1.so
7fc690a77000-7fc690a78000 rw-p 00082000 fb:00 44433768                   /lib/libm-2.11.1.so
7fc690a78000-7fc690b6e000 r-xp 00000000 fb:00 45745677                   /usr/lib/libstdc++.so.6.0.13
7fc690b6e000-7fc690d6e000 ---p 000f6000 fb:00 45745677                   /usr/lib/libstdc++.so.6.0.13
7fc690d6e000-7fc690d75000 r--p 000f6000 fb:00 45745677                   /usr/lib/libstdc++.so.6.0.13
7fc690d75000-7fc690d77000 rw-p 000fd000 fb:00 45745677                   /usr/lib/libstdc++.so.6.0.13
7fc690d77000-7fc690d8c000 rw-p 00000000 00:00 0
7fc690d8c000-7fc690da2000 r-xp 00000000 fb:00 44433644                   /lib/libz.so.1.2.3.3
7fc690da2000-7fc690fa1000 ---p 00016000 fb:00 44433644                   /lib/libz.so.1.2.3.3
7fc690fa1000-7fc690fa2000 r--p 00015000 fb:00 44433644                   /lib/libz.so.1.2.3.3
7fc690fa2000-7fc690fa3000 rw-p 00016000 fb:00 44433644                   /lib/libz.so.1.2.3.3
7fc690fa3000-7fc690fc3000 r-xp 00000000 fb:00 44433481                   /lib/ld-2.11.1.so
7fc6910b4000-7fc6911b9000 rw-p 00000000 00:00 0
7fc6911be000-7fc6911c2000 rw-p 00000000 00:00 0
7fc6911c2000-7fc6911c3000 r--p 0001f000 fb:00 44433481                   /lib/ld-2.11.1.so
7fc6911c3000-7fc6911c4000 rw-p 00020000 fb:00 44433481                   /lib/ld-2.11.1.so
7fc6911c4000-7fc6911c5000 rw-p 00000000 00:00 0
7fff9fc2d000-7fff9fc42000 rw-p 00000000 00:00 0                          [stack]
7fff9fde0000-7fff9fde1000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted
Reply
Thanks given by:


Messages In This Thread
RE: Convert Minecraft server world files into MCserver world files. - by rs2k - 11-05-2011, 02:13 AM



Users browsing this thread: 5 Guest(s)