Browse Source

pfBackdoorMsg => plString

Michael Hansen 11 years ago
parent
commit
4987b32574
  1. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  2. 25
      Sources/Plasma/FeatureLib/pfMessage/pfBackdoorMsg.h
  3. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -6846,7 +6846,7 @@ PF_CONSOLE_CMD( Python,
const char* extraParms = ""; const char* extraParms = "";
if (numParams > 1) if (numParams > 1)
extraParms = params[1]; extraParms = params[1];
pfBackdoorMsg *msg = new pfBackdoorMsg( params[0],extraParms ); pfBackdoorMsg *msg = new pfBackdoorMsg((const char *)params[0], extraParms);
// send it off // send it off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }

25
Sources/Plasma/FeatureLib/pfMessage/pfBackdoorMsg.h

@ -55,24 +55,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class pfBackdoorMsg : public plMessage class pfBackdoorMsg : public plMessage
{ {
protected: protected:
char *fTarget; plString fTarget;
char *fString; plString fString;
public: public:
pfBackdoorMsg() : plMessage( nil, nil, nil ),fTarget(nil),fString(nil) {} pfBackdoorMsg() : plMessage(nil, nil, nil) {}
pfBackdoorMsg( const char* target, const char* string) : plMessage( nil, nil, nil ) pfBackdoorMsg(const plString& target, const plString& string)
: plMessage(nil, nil, nil), fTarget(target), fString(string)
{ {
// across the net and just to those listening // across the net and just to those listening
SetBCastFlag( plMessage::kNetPropagate ); SetBCastFlag( plMessage::kNetPropagate );
SetBCastFlag( plMessage::kBCastByExactType ); SetBCastFlag( plMessage::kBCastByExactType );
fTarget = hsStrcpy( target );
fString = hsStrcpy( string );
}
~pfBackdoorMsg()
{
delete [] fTarget;
delete [] fString;
} }
CLASSNAME_REGISTER( pfBackdoorMsg ); CLASSNAME_REGISTER( pfBackdoorMsg );
@ -81,8 +74,8 @@ class pfBackdoorMsg : public plMessage
virtual void Read(hsStream* s, hsResMgr* mgr) virtual void Read(hsStream* s, hsResMgr* mgr)
{ {
plMessage::IMsgRead( s, mgr ); plMessage::IMsgRead( s, mgr );
fTarget = s->ReadSafeString(); fTarget = s->ReadSafeString_TEMP();
fString = s->ReadSafeString(); fString = s->ReadSafeString_TEMP();
} }
virtual void Write(hsStream* s, hsResMgr* mgr) virtual void Write(hsStream* s, hsResMgr* mgr)
@ -92,8 +85,8 @@ class pfBackdoorMsg : public plMessage
s->WriteSafeString(fString); s->WriteSafeString(fString);
} }
const char *GetTarget( void ) { return fTarget; } plString GetTarget() const { return fTarget; }
const char *GetString( void ) { return fString; } plString GetString() const { return fString; }
}; };

2
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -2410,7 +2410,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
PyObject* retVal = PyObject_CallMethod( PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnBackdoorMsg], fPyFunctionInstances[kfunc_OnBackdoorMsg],
(char*)fFunctionNames[kfunc_OnBackdoorMsg], (char*)fFunctionNames[kfunc_OnBackdoorMsg],
"ss", dt->GetTarget(), dt->GetString()); "ss", dt->GetTarget().c_str(), dt->GetString().c_str());
if ( retVal == nil ) if ( retVal == nil )
{ {
// if there was an error make sure that the stderr gets flushed so it can be seen // if there was an error make sure that the stderr gets flushed so it can be seen

Loading…
Cancel
Save