|
|
@ -65,8 +65,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com |
|
|
|
|
|
|
|
|
|
|
|
#include "pnNetBase/pnNetBase.h" |
|
|
|
#include "pnNetBase/pnNetBase.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <sstream> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class plMessage; |
|
|
|
class plMessage; |
|
|
|
class plUUID; |
|
|
|
class plUUID; |
|
|
|
|
|
|
|
|
|
|
@ -246,11 +244,11 @@ public: |
|
|
|
void InitReplyFieldsFrom(plNetMessage * msg); |
|
|
|
void InitReplyFieldsFrom(plNetMessage * msg); |
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
virtual std::string AsStdString() const |
|
|
|
virtual plString AsString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char* delim = ""; |
|
|
|
const char* delim = ""; |
|
|
|
|
|
|
|
|
|
|
|
std::stringstream ss; |
|
|
|
plStringStream ss; |
|
|
|
if ( GetHasPlayerID() ) |
|
|
|
if ( GetHasPlayerID() ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ss << delim << "p:" << GetPlayerID(); |
|
|
|
ss << delim << "p:" << GetPlayerID(); |
|
|
@ -263,7 +261,7 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
if ( GetHasAcctUUID() ) |
|
|
|
if ( GetHasAcctUUID() ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ss << delim << "a:" << GetAcctUUID()->AsStdString(); |
|
|
|
ss << delim << "a:" << GetAcctUUID()->AsString(); |
|
|
|
delim = ","; |
|
|
|
delim = ","; |
|
|
|
} |
|
|
|
} |
|
|
|
if ( IsBitSet(kHasVersion) ) |
|
|
|
if ( IsBitSet(kHasVersion) ) |
|
|
@ -272,7 +270,7 @@ public: |
|
|
|
delim = ","; |
|
|
|
delim = ","; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ss.str().c_str(); |
|
|
|
return ss.GetString(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -331,12 +329,10 @@ public: |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
std::string AsStdString() const |
|
|
|
plString AsString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string s; |
|
|
|
|
|
|
|
char tmp[256]; |
|
|
|
char tmp[256]; |
|
|
|
xtl::format(s,"object=%s, %s",fObjectHelper.GetUoid().StringIze(tmp), plNetMessage::AsStdString().c_str()); |
|
|
|
return plString::Format("object=%s, %s",fObjectHelper.GetUoid().StringIze(tmp), plNetMessage::AsString().c_str()); |
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
@ -409,7 +405,7 @@ public: |
|
|
|
void SetIsAvatarState(bool b) { fIsAvatarState = b; } |
|
|
|
void SetIsAvatarState(bool b) { fIsAvatarState = b; } |
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
std::string AsStdString() const; |
|
|
|
plString AsString() const; |
|
|
|
bool IsInitialState() const {return fIsInitialState!=0; } |
|
|
|
bool IsInitialState() const {return fIsInitialState!=0; } |
|
|
|
void SetIsInitialState( bool v ) { fIsInitialState=v; } |
|
|
|
void SetIsInitialState( bool v ) { fIsInitialState=v; } |
|
|
|
|
|
|
|
|
|
|
@ -509,12 +505,10 @@ public: |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
std::string AsStdString() const |
|
|
|
plString AsString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string s; |
|
|
|
|
|
|
|
const char* noc=plFactory::GetTheFactory()->GetNameOfClass(StreamInfo()->GetStreamType()); |
|
|
|
const char* noc=plFactory::GetTheFactory()->GetNameOfClass(StreamInfo()->GetStreamType()); |
|
|
|
xtl::format(s,"%s %s",plNetMsgStream::AsStdString().c_str(), noc ? noc : "?"); |
|
|
|
return plString::Format("%s %s",plNetMsgStream::AsString().c_str(), noc ? noc : "?"); |
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -562,13 +556,11 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
std::string AsStdString() const |
|
|
|
plString AsString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string s; |
|
|
|
|
|
|
|
char tmp[256]; |
|
|
|
char tmp[256]; |
|
|
|
xtl::format(s,"object=%s initial=%d, %s",fObjectHelper.GetUoid().StringIze(tmp), fIsInitialState, |
|
|
|
return plString::Format("object=%s initial=%d, %s",fObjectHelper.GetUoid().StringIze(tmp), fIsInitialState, |
|
|
|
plNetMsgGameMessage::AsStdString().c_str()); |
|
|
|
plNetMsgGameMessage::AsString().c_str()); |
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -805,11 +797,9 @@ public: |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
void WriteVersion(hsStream* s, hsResMgr* mgr); |
|
|
|
|
|
|
|
|
|
|
|
// debug
|
|
|
|
// debug
|
|
|
|
std::string AsStdString() const |
|
|
|
plString AsStdString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string s; |
|
|
|
return plString::Format("lockReq=%d, %s",fLockRequest, plNetMsgStreamedObject::AsString().c_str()); |
|
|
|
xtl::format(s,"lockReq=%d, %s",fLockRequest, plNetMsgStreamedObject::AsStdString().c_str()); |
|
|
|
|
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -991,18 +981,16 @@ public: |
|
|
|
const hsBitVector& GetRegionsICareAbout() const { return fRegionsICareAbout; } |
|
|
|
const hsBitVector& GetRegionsICareAbout() const { return fRegionsICareAbout; } |
|
|
|
const hsBitVector& GetRegionsImIn() const { return fRegionsImIn; } |
|
|
|
const hsBitVector& GetRegionsImIn() const { return fRegionsImIn; } |
|
|
|
|
|
|
|
|
|
|
|
std::string AsStdString() const |
|
|
|
plString AsStdString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string s; |
|
|
|
plString b1, b2; |
|
|
|
std::string b1, b2; |
|
|
|
|
|
|
|
int i; |
|
|
|
int i; |
|
|
|
for(i=0;i<fRegionsImIn.GetNumBitVectors(); i++) |
|
|
|
for(i=0;i<fRegionsImIn.GetNumBitVectors(); i++) |
|
|
|
b1 += xtl::format("0x%x ", fRegionsImIn.GetBitVector(i)).c_str(); |
|
|
|
b1 += plString::Format("0x%x ", fRegionsImIn.GetBitVector(i)); |
|
|
|
for(i=0;i<fRegionsICareAbout.GetNumBitVectors(); i++) |
|
|
|
for(i=0;i<fRegionsICareAbout.GetNumBitVectors(); i++) |
|
|
|
b2 += xtl::format("0x%x ", fRegionsICareAbout.GetBitVector(i)).c_str(); |
|
|
|
b2 += plString::Format("0x%x ", fRegionsICareAbout.GetBitVector(i)); |
|
|
|
xtl::format( s, "rgnsImIn:%s, rgnsICareAbout:%s, %s", |
|
|
|
return plString::Format("rgnsImIn:%s, rgnsICareAbout:%s, %s", |
|
|
|
b1.c_str(), b2.c_str(), plNetMessage::AsStdString().c_str() ); |
|
|
|
b1.c_str(), b2.c_str(), plNetMessage::AsString().c_str() ); |
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|