mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Allow passing a clothing file to LoadAvatar and plStringify whatever we encounter on our way
This commit is contained in:
@ -58,44 +58,30 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
// CTOR (default)
|
||||
plLoadAvatarMsg::plLoadAvatarMsg()
|
||||
: fIsPlayer(false),
|
||||
fSpawnPoint(nil),
|
||||
fInitialTask(nil),
|
||||
fUserStr(nil)
|
||||
fSpawnPoint(nullptr),
|
||||
fInitialTask(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR uoidToClone, requestorKey, userData, isPlayer, spawnPOint, initialTask
|
||||
plLoadAvatarMsg::plLoadAvatarMsg(const plUoid &uoidToClone, const plKey &requestorKey, uint32_t userData,
|
||||
bool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const char* userStr /*= nil*/)
|
||||
bool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const plString &userStr)
|
||||
: plLoadCloneMsg(uoidToClone, requestorKey, userData),
|
||||
fIsPlayer(isPlayer),
|
||||
fSpawnPoint(spawnPoint),
|
||||
fInitialTask(initialTask),
|
||||
fUserStr(nil) // setting to nil so SetUserStr doesn't try to nuke garbage
|
||||
fUserStr(userStr)
|
||||
{
|
||||
SetUserStr(userStr);
|
||||
}
|
||||
|
||||
plLoadAvatarMsg::plLoadAvatarMsg(const plKey &existing, const plKey &requestor, uint32_t userData,
|
||||
bool isPlayer, bool isLoading, const char* userStr /*= nil*/)
|
||||
: plLoadCloneMsg(existing, requestor, userData, isLoading),
|
||||
fIsPlayer(isPlayer),
|
||||
fSpawnPoint(nil),
|
||||
fInitialTask(nil),
|
||||
fUserStr(nil) // setting to nil so SetUserStr doesn't try to nuke garbage
|
||||
bool isPlayer, bool isLoading, const plString &userStr)
|
||||
: plLoadCloneMsg(existing, requestor, userData, isLoading),
|
||||
fIsPlayer(isPlayer),
|
||||
fSpawnPoint(nullptr),
|
||||
fInitialTask(nullptr),
|
||||
fUserStr(userStr)
|
||||
{
|
||||
SetUserStr(userStr);
|
||||
}
|
||||
|
||||
|
||||
// DTOR
|
||||
plLoadAvatarMsg::~plLoadAvatarMsg()
|
||||
{
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
@ -107,12 +93,7 @@ void plLoadAvatarMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
fInitialTask = plAvTask::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
}
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
fUserStr = stream->ReadSafeString();
|
||||
fUserStr = stream->ReadSafeString_TEMP();
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
@ -150,13 +131,8 @@ void plLoadAvatarMsg::ReadVersion(hsStream* stream, hsResMgr* mgr)
|
||||
if (contentFlags.IsBitSet(kLoadAvatarMsgSpawnPoint))
|
||||
fSpawnPoint = mgr->ReadKey(stream);
|
||||
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
if (contentFlags.IsBitSet(kLoadAvatarMsgUserStr))
|
||||
fUserStr = stream->ReadSafeString();
|
||||
fUserStr = stream->ReadSafeString_TEMP();
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::WriteVersion(hsStream* stream, hsResMgr* mgr)
|
||||
@ -179,63 +155,5 @@ void plLoadAvatarMsg::WriteVersion(hsStream* stream, hsResMgr* mgr)
|
||||
stream->WriteSafeString(fUserStr);
|
||||
}
|
||||
|
||||
// SETISPLAYER
|
||||
void plLoadAvatarMsg::SetIsPlayer(bool is)
|
||||
{
|
||||
fIsPlayer = is;
|
||||
}
|
||||
|
||||
// GETISPLAYER
|
||||
bool plLoadAvatarMsg::GetIsPlayer()
|
||||
{
|
||||
return fIsPlayer;
|
||||
}
|
||||
|
||||
// SETSPAWNPOINT
|
||||
void plLoadAvatarMsg::SetSpawnPoint(const plKey &spawnPoint)
|
||||
{
|
||||
fSpawnPoint = spawnPoint;
|
||||
}
|
||||
|
||||
// GETSPAWNPOINT
|
||||
plKey plLoadAvatarMsg::GetSpawnPoint()
|
||||
{
|
||||
return fSpawnPoint;
|
||||
}
|
||||
|
||||
// SETINITIALTASK
|
||||
void plLoadAvatarMsg::SetInitialTask(plAvTask *initialTask)
|
||||
{
|
||||
fInitialTask = initialTask;
|
||||
}
|
||||
|
||||
// GETINITIALTASK
|
||||
plAvTask * plLoadAvatarMsg::GetInitialTask()
|
||||
{
|
||||
return fInitialTask;
|
||||
}
|
||||
|
||||
// SETUSERSTR
|
||||
void plLoadAvatarMsg::SetUserStr(const char *userStr)
|
||||
{
|
||||
if (fUserStr)
|
||||
delete [] fUserStr;
|
||||
if (!userStr)
|
||||
{
|
||||
fUserStr = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
fUserStr = new char[strlen(userStr) + 1];
|
||||
strcpy(fUserStr, userStr);
|
||||
fUserStr[strlen(userStr)] = '\0';
|
||||
}
|
||||
|
||||
// GETUSERSTR
|
||||
const char* plLoadAvatarMsg::GetUserStr()
|
||||
{
|
||||
return fUserStr;
|
||||
}
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
\param userStr - a string that the user can set
|
||||
*/
|
||||
plLoadAvatarMsg(const plUoid &uoidToClone, const plKey &requestorKey, uint32_t userData,
|
||||
bool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const char *userStr = nil);
|
||||
bool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const plString &userStr = "");
|
||||
|
||||
/** Use this form if you're sending a message about an existing clone -- either
|
||||
to propagate it to other machines or to tell them to unload it.
|
||||
@ -97,21 +97,19 @@ public:
|
||||
\param userStr - a string that the user can set
|
||||
*/
|
||||
plLoadAvatarMsg(const plKey &existing, const plKey &requestorKey, uint32_t userData,
|
||||
bool isPlayer, bool isLoading, const char *userStr = nil);
|
||||
bool isPlayer, bool isLoading, const plString &userStr = "");
|
||||
|
||||
virtual ~plLoadAvatarMsg();
|
||||
void SetIsPlayer(bool is) { fIsPlayer = is; }
|
||||
bool GetIsPlayer() { return fIsPlayer; }
|
||||
|
||||
void SetIsPlayer(bool is);
|
||||
bool GetIsPlayer();
|
||||
void SetSpawnPoint(const plKey &spawnPoint) { fSpawnPoint = spawnPoint; }
|
||||
plKey GetSpawnPoint() { return fSpawnPoint; }
|
||||
|
||||
void SetSpawnPoint(const plKey &spawnSceneObjectKey);
|
||||
plKey GetSpawnPoint();
|
||||
void SetInitialTask(plAvTask *task) { fInitialTask = task; }
|
||||
plAvTask * GetInitialTask() { return fInitialTask; }
|
||||
|
||||
void SetInitialTask(plAvTask *task);
|
||||
plAvTask * GetInitialTask();
|
||||
|
||||
void SetUserStr(const char *userStr);
|
||||
const char* GetUserStr();
|
||||
void SetUserStr(const plString &userStr) { fUserStr = userStr; }
|
||||
plString GetUserStr() { return fUserStr; }
|
||||
|
||||
CLASSNAME_REGISTER(plLoadAvatarMsg);
|
||||
GETINTERFACE_ANY(plLoadAvatarMsg, plLoadCloneMsg);
|
||||
@ -126,7 +124,7 @@ protected:
|
||||
bool fIsPlayer;
|
||||
plKey fSpawnPoint;
|
||||
plAvTask *fInitialTask;
|
||||
char *fUserStr;
|
||||
plString fUserStr;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user