mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Convert plUoid's object name to a plString
This commit is contained in:
@ -828,13 +828,6 @@ void plNetMsgSDLStateBCast::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
////////////////////////////////////////////////////////
|
||||
// plNetMsgRoomsList
|
||||
////////////////////////////////////////////////////////
|
||||
plNetMsgRoomsList::~plNetMsgRoomsList()
|
||||
{
|
||||
int i;
|
||||
for(i=0;i<GetNumRooms();i++)
|
||||
delete [] fRoomNames[i];
|
||||
}
|
||||
|
||||
int plNetMsgRoomsList::IPokeBuffer(hsStream* stream, UInt32 peekOptions)
|
||||
{
|
||||
int bytes=plNetMessage::IPokeBuffer(stream, peekOptions);
|
||||
@ -871,7 +864,6 @@ int plNetMsgRoomsList::IPeekBuffer(hsStream* stream, UInt32 peekOptions)
|
||||
loc.Read(stream);
|
||||
fRooms[i]=loc;
|
||||
// read room name for debugging
|
||||
delete [] fRoomNames[i];
|
||||
stream->LogSubStreamPushDesc("RoomList");
|
||||
plMsgCStringHelper::Peek(fRoomNames[i],stream,peekOptions);
|
||||
}
|
||||
@ -884,13 +876,13 @@ int plNetMsgRoomsList::IPeekBuffer(hsStream* stream, UInt32 peekOptions)
|
||||
void plNetMsgRoomsList::AddRoom(plKey rmKey)
|
||||
{
|
||||
fRooms.push_back(rmKey->GetUoid().GetLocation());
|
||||
fRoomNames.push_back(hsStrcpy(rmKey->GetName()));
|
||||
fRoomNames.push_back(rmKey->GetName());
|
||||
}
|
||||
|
||||
void plNetMsgRoomsList::AddRoomLocation(plLocation loc, const char* rmName)
|
||||
void plNetMsgRoomsList::AddRoomLocation(plLocation loc, const plString& rmName)
|
||||
{
|
||||
fRooms.push_back(loc);
|
||||
fRoomNames.push_back(rmName ? hsStrcpy(rmName) : nil);
|
||||
fRoomNames.push_back(rmName);
|
||||
}
|
||||
|
||||
int plNetMsgRoomsList::FindRoomLocation(plLocation loc)
|
||||
|
@ -451,24 +451,24 @@ class plNetMsgRoomsList : public plNetMessage
|
||||
{
|
||||
protected:
|
||||
std::vector<plLocation> fRooms;
|
||||
std::vector<char*> fRoomNames; // for debug usage only
|
||||
std::vector<plString> fRoomNames; // for debug usage only
|
||||
|
||||
int IPokeBuffer(hsStream* stream, UInt32 peekOptions=0);
|
||||
int IPeekBuffer(hsStream* stream, UInt32 peekOptions=0);
|
||||
public:
|
||||
plNetMsgRoomsList() {}
|
||||
~plNetMsgRoomsList();
|
||||
~plNetMsgRoomsList() {};
|
||||
|
||||
CLASSNAME_REGISTER( plNetMsgRoomsList );
|
||||
GETINTERFACE_ANY( plNetMsgRoomsList, plNetMessage );
|
||||
|
||||
void AddRoom(plKey rmKey);
|
||||
void AddRoomLocation(plLocation loc, const char* rmName);
|
||||
void AddRoomLocation(plLocation loc, const plString& rmName);
|
||||
int FindRoomLocation(plLocation loc);
|
||||
|
||||
int GetNumRooms() const { return fRooms.size(); }
|
||||
plLocation GetRoomLoc(int i) const { return fRooms[i]; }
|
||||
const char* GetRoomName(int i) const { return fRoomNames[i]; } // debug
|
||||
plString GetRoomName(int i) const { return fRoomNames[i]; } // debug
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -364,7 +364,7 @@ int plNetMsgObjectHelper::Peek(hsStream* stream, const UInt32 peekOptions)
|
||||
|
||||
hsBool plNetMsgObjectHelper::SetFromKey(const plKey &key)
|
||||
{
|
||||
if (!key || !key->GetName())
|
||||
if (!key || key->GetName().IsNull())
|
||||
return false;
|
||||
|
||||
fUoid = key->GetUoid();
|
||||
|
@ -213,7 +213,7 @@ public:
|
||||
void SetUoid(const plUoid &u) { fUoid=u; }
|
||||
|
||||
// getters
|
||||
const char* GetObjectName() const { return fUoid.GetObjectName(); }
|
||||
const plString& GetObjectName() const { return fUoid.GetObjectName(); }
|
||||
UInt32 GetPageID() const { return fUoid.GetLocation().GetSequenceNumber(); }
|
||||
const plUoid& GetUoid() const { return fUoid; }
|
||||
|
||||
|
Reference in New Issue
Block a user