I've been working for several days on trying to build a way to backport hairs (and in future potentially other fashion etc) from current PWI into 1.5.5. Very roughly I:
1) Wrote a pgm to scan through 1.5.5 elements.data, finding the hairs, removing them from the main elements.data (FashionEssence + FaceHairEssence + FaceTextureEssence records), putting each in its own folder and extracting the necessary SKI and DDS files from facedata.pck and icons from surfaces.pck
2) Ran same pgm over current PWI elements.data (which is now compressed and in a completely different format, so some challenges there, see https://forum.ragezone.com/f452/new-pwi-compressed-elements-data-1207197)
3) Wrote a pgm to reconsistute the complete elements.data from what's left in the main file, plus the fragments stored in separate folders, inserting the SKI and DDS files into facedata.pck and rebuilding the big images of all the item icons in surfaces.pck
4) Upload new elements.data to the server.... and hope it starts....
And well, sometimes that works, and sometimes gs won't start. Luckily I was only really doing this to get 2 hairs I especially wanted (58525 + 60269) and if I kept elements.data exactly as 1.5.5 and added only those (+ associated FaceHairEssence + FaceTextureEssence records) then it worked, I'm able to use those hairs now, the models and icons all look correct.
But others I've tried to import, the server won't start up. Even just copies of existing hairs (where they release event-gold-untradeable versions of the same hairs) stop it working. Clearly my build process works, as it worked with the other 2 hairs (and the correctness of the PCKs makes no odds to whether the server will start anyway). So what's the problem?
I've failed to get any useful logs. Only error msg I've seen said worldmanager.cpp line 1449, which (if the source I've got is in sync with this build..) is just calling GDB::get_serverdata, so that tells me nothing useful. If I run gs interactively, all the chinese chars just display diamonds so its unreadeable. If I look in /PWServer/155/logs/gs_all.log or I do "./gs >gslog.txt", it gets truncated because it isn't fully flushed when gs falls over. So I can get nothing useful in terms of error messages, just a "yes it starts" or "no it doesn't start" and guess why.
One theory (and this is my real question, if anyone knows) - does 1.5.5 have a limit on itemIDs must be < 65535 because they're held in 2 bytes somewhere? I ask because I tested adding 1 hair and it worked perfect, then I changed its item ID (changed nothing else!) and then the server did start, but the client behaved oddly. It had wrong name and icon on the ground. It did look correct in my bag. It didn't work when worn, just showed default hair.
Or any other ideas? Or suggestions how I can get useful logs? Much appreciated, thanks.
1) Wrote a pgm to scan through 1.5.5 elements.data, finding the hairs, removing them from the main elements.data (FashionEssence + FaceHairEssence + FaceTextureEssence records), putting each in its own folder and extracting the necessary SKI and DDS files from facedata.pck and icons from surfaces.pck
2) Ran same pgm over current PWI elements.data (which is now compressed and in a completely different format, so some challenges there, see https://forum.ragezone.com/f452/new-pwi-compressed-elements-data-1207197)
3) Wrote a pgm to reconsistute the complete elements.data from what's left in the main file, plus the fragments stored in separate folders, inserting the SKI and DDS files into facedata.pck and rebuilding the big images of all the item icons in surfaces.pck
4) Upload new elements.data to the server.... and hope it starts....
And well, sometimes that works, and sometimes gs won't start. Luckily I was only really doing this to get 2 hairs I especially wanted (58525 + 60269) and if I kept elements.data exactly as 1.5.5 and added only those (+ associated FaceHairEssence + FaceTextureEssence records) then it worked, I'm able to use those hairs now, the models and icons all look correct.
But others I've tried to import, the server won't start up. Even just copies of existing hairs (where they release event-gold-untradeable versions of the same hairs) stop it working. Clearly my build process works, as it worked with the other 2 hairs (and the correctness of the PCKs makes no odds to whether the server will start anyway). So what's the problem?
I've failed to get any useful logs. Only error msg I've seen said worldmanager.cpp line 1449, which (if the source I've got is in sync with this build..) is just calling GDB::get_serverdata, so that tells me nothing useful. If I run gs interactively, all the chinese chars just display diamonds so its unreadeable. If I look in /PWServer/155/logs/gs_all.log or I do "./gs >gslog.txt", it gets truncated because it isn't fully flushed when gs falls over. So I can get nothing useful in terms of error messages, just a "yes it starts" or "no it doesn't start" and guess why.
One theory (and this is my real question, if anyone knows) - does 1.5.5 have a limit on itemIDs must be < 65535 because they're held in 2 bytes somewhere? I ask because I tested adding 1 hair and it worked perfect, then I changed its item ID (changed nothing else!) and then the server did start, but the client behaved oddly. It had wrong name and icon on the ground. It did look correct in my bag. It didn't work when worn, just showed default hair.
Or any other ideas? Or suggestions how I can get useful logs? Much appreciated, thanks.