Browse Source

pfBackdoorMsg => plString

Michael Hansen 11 years ago
parent
commit
4987b32574
  1. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  2. 29
      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 = "";
if (numParams > 1)
extraParms = params[1];
pfBackdoorMsg *msg = new pfBackdoorMsg( params[0],extraParms );
pfBackdoorMsg *msg = new pfBackdoorMsg((const char *)params[0], extraParms);
// send it off
plgDispatch::MsgSend( msg );
}

29
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
{
protected:
char *fTarget;
char *fString;
plString fTarget;
plString fString;
public:
pfBackdoorMsg() : plMessage( nil, nil, nil ),fTarget(nil),fString(nil) {}
pfBackdoorMsg( const char* target, const char* string) : plMessage( nil, nil, nil )
pfBackdoorMsg() : 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
SetBCastFlag( plMessage::kNetPropagate );
SetBCastFlag( plMessage::kBCastByExactType );
fTarget = hsStrcpy( target );
fString = hsStrcpy( string );
}
~pfBackdoorMsg()
{
delete [] fTarget;
delete [] fString;
}
CLASSNAME_REGISTER( pfBackdoorMsg );
@ -81,19 +74,19 @@ class pfBackdoorMsg : public plMessage
virtual void Read(hsStream* s, hsResMgr* mgr)
{
plMessage::IMsgRead( s, mgr );
fTarget = s->ReadSafeString();
fString = s->ReadSafeString();
fTarget = s->ReadSafeString_TEMP();
fString = s->ReadSafeString_TEMP();
}
virtual void Write(hsStream* s, hsResMgr* mgr)
{
plMessage::IMsgWrite( s, mgr );
s->WriteSafeString( fTarget );
s->WriteSafeString( fString );
s->WriteSafeString(fTarget);
s->WriteSafeString(fString);
}
const char *GetTarget( void ) { return fTarget; }
const char *GetString( void ) { return fString; }
plString GetTarget() const { return fTarget; }
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(
fPyFunctionInstances[kfunc_OnBackdoorMsg],
(char*)fFunctionNames[kfunc_OnBackdoorMsg],
"ss", dt->GetTarget(), dt->GetString());
"ss", dt->GetTarget().c_str(), dt->GetString().c_str());
if ( retVal == nil )
{
// if there was an error make sure that the stderr gets flushed so it can be seen

Loading…
Cancel
Save