|
|
@ -49,16 +49,16 @@ void plLoadAgeMsg::Read(hsStream* stream, hsResMgr* mgr) |
|
|
|
{
|
|
|
|
{
|
|
|
|
plMessage::IMsgRead(stream, mgr);
|
|
|
|
plMessage::IMsgRead(stream, mgr);
|
|
|
|
|
|
|
|
|
|
|
|
delete [] fAgeFilename; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read agename
|
|
|
|
// read agename
|
|
|
|
uint8_t len; |
|
|
|
uint8_t len; |
|
|
|
stream->ReadLE(&len); |
|
|
|
stream->ReadLE(&len); |
|
|
|
if (len) |
|
|
|
if (len) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fAgeFilename=new char[len+1]; |
|
|
|
plStringBuffer<char> filename; |
|
|
|
stream->Read(len, fAgeFilename); |
|
|
|
char* buffer = filename.CreateWritableBuffer(len); |
|
|
|
fAgeFilename[len]=0; |
|
|
|
stream->Read(len, buffer); |
|
|
|
|
|
|
|
buffer[len] = 0; |
|
|
|
|
|
|
|
fAgeFilename = filename; |
|
|
|
} |
|
|
|
} |
|
|
|
fUnload = stream->ReadBool(); |
|
|
|
fUnload = stream->ReadBool(); |
|
|
|
stream->ReadLE(&fPlayerID); |
|
|
|
stream->ReadLE(&fPlayerID); |
|
|
@ -70,11 +70,11 @@ void plLoadAgeMsg::Write(hsStream* stream, hsResMgr* mgr) |
|
|
|
plMessage::IMsgWrite(stream, mgr);
|
|
|
|
plMessage::IMsgWrite(stream, mgr);
|
|
|
|
|
|
|
|
|
|
|
|
// write agename
|
|
|
|
// write agename
|
|
|
|
uint8_t len = fAgeFilename ? strlen(fAgeFilename) : 0; |
|
|
|
uint8_t len = static_cast<uint8_t>(fAgeFilename.GetSize()); |
|
|
|
stream->WriteLE(len); |
|
|
|
stream->WriteLE(len); |
|
|
|
if (len) |
|
|
|
if (len) |
|
|
|
{ |
|
|
|
{ |
|
|
|
stream->Write(len, fAgeFilename); |
|
|
|
stream->Write(len, fAgeFilename.c_str()); |
|
|
|
} |
|
|
|
} |
|
|
|
stream->WriteBool(fUnload); |
|
|
|
stream->WriteBool(fUnload); |
|
|
|
stream->WriteLE(fPlayerID); |
|
|
|
stream->WriteLE(fPlayerID); |
|
|
@ -99,8 +99,7 @@ void plLoadAgeMsg::ReadVersion(hsStream* s, hsResMgr* mgr) |
|
|
|
if (contentFlags.IsBitSet(kLoadAgeAgeName)) |
|
|
|
if (contentFlags.IsBitSet(kLoadAgeAgeName)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// read agename
|
|
|
|
// read agename
|
|
|
|
delete [] fAgeFilename; |
|
|
|
fAgeFilename = s->ReadSafeString_TEMP(); |
|
|
|
fAgeFilename = s->ReadSafeString(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (contentFlags.IsBitSet(kLoadAgeUnload)) |
|
|
|
if (contentFlags.IsBitSet(kLoadAgeUnload)) |
|
|
|