//----------------------------------------------------------------------------- void CGmTpPendingCommand::saveMap() { CMemStream stream; string fileName = toString("gm_pending_tp.bin"); stream.serialCont( _CharacterTpPending ); CBackupMsgSaveFile msg( fileName, CBackupMsgSaveFile::SaveFile, Bsi ); msg.DataMsg.serialBuffer((uint8*)stream.buffer(), stream.size()); Bsi.sendFile( msg ); }
template <class T> bool check (T value) { T result; CMemStream msgout; msgout.serial (value); CMemStream msgin (true); msgin.fill (msgout.buffer(), msgout.size()); msgin.serial (result); if (value != result) { nlwarning ("CHECK FAILED: %s != %s", toString (value).c_str(), toString (result).c_str()); } if (toString(value) != toString(result)) { nlwarning ("toString() CHECK FAILED: %s != %s", toString (value).c_str(), toString (result).c_str()); } return value == result; }