mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
CWE Directory Reorganization
Rearrange directory structure of CWE to be loosely equivalent to the H'uru Plasma repository. Part 1: Movement of directories and files.
This commit is contained in:
99
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.cpp
Normal file
99
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef SERVER // we use stuff the server doesn't link with
|
||||
#ifndef NO_AV_MSGS
|
||||
|
||||
#include "plAIMsg.h"
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
#include "..\plAvatar\plArmatureMod.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plAIMsg::plAIMsg(): plMessage(nil, nil, nil), fBrainUserStr("")
|
||||
{}
|
||||
|
||||
plAIMsg::plAIMsg(const plKey& sender, const plKey& receiver): plMessage(sender, receiver, nil)
|
||||
{
|
||||
// set up our user string from the sender, if it is the right type
|
||||
plArmatureMod* armMod = plArmatureMod::ConvertNoRef(sender->ObjectIsLoaded());
|
||||
if (armMod)
|
||||
fBrainUserStr = armMod->GetUserStr();
|
||||
else
|
||||
fBrainUserStr = "";
|
||||
}
|
||||
|
||||
void plAIMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
char* temp = stream->ReadSafeString();
|
||||
if (temp)
|
||||
fBrainUserStr = temp;
|
||||
delete [] temp;
|
||||
}
|
||||
|
||||
void plAIMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
stream->WriteSafeString(fBrainUserStr.c_str());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void plAIArrivedAtGoalMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plAIMsg::Read(stream, mgr);
|
||||
fGoal.Read(stream);
|
||||
}
|
||||
|
||||
void plAIArrivedAtGoalMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plAIMsg::Write(stream, mgr);
|
||||
fGoal.Write(stream);
|
||||
}
|
||||
|
||||
#endif // NO_AV_MSGS
|
||||
#endif // SERVER
|
120
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.h
Normal file
120
Sources/Plasma/PubUtilLib/plMessage/plAIMsg.h
Normal file
@ -0,0 +1,120 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plAIMsg_inc
|
||||
#define plAIMsg_inc
|
||||
|
||||
#ifndef SERVER // we use stuff the server doesn't link with
|
||||
#ifndef NO_AV_MSGS
|
||||
|
||||
#include "hsGeometry3.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plAvBrainCritter;
|
||||
|
||||
// abstract base class for all AI-related messages
|
||||
class plAIMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plAIMsg();
|
||||
plAIMsg(const plKey& sender, const plKey& receiver);
|
||||
|
||||
CLASSNAME_REGISTER(plAIMsg);
|
||||
GETINTERFACE_ANY(plAIMsg, plMessage);
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void BrainUserString(const std::string& userStr) {fBrainUserStr = userStr;}
|
||||
std::string BrainUserString() const {return fBrainUserStr;}
|
||||
|
||||
// enum for all messages to make things easier for people that use us
|
||||
enum
|
||||
{
|
||||
kAIMsg_Unknown,
|
||||
kAIMsg_BrainCreated,
|
||||
kAIMsg_ArrivedAtGoal,
|
||||
};
|
||||
|
||||
private:
|
||||
std::string fBrainUserStr;
|
||||
};
|
||||
|
||||
// message spammed to anyone listening so they can grab the brain's key and talk to it
|
||||
// does NOT get net-propped
|
||||
class plAIBrainCreatedMsg : public plAIMsg
|
||||
{
|
||||
public:
|
||||
plAIBrainCreatedMsg(): plAIMsg() {SetBCastFlag(plMessage::kBCastByExactType);}
|
||||
plAIBrainCreatedMsg(const plKey& sender): plAIMsg(sender, nil) {SetBCastFlag(plMessage::kBCastByExactType);}
|
||||
|
||||
CLASSNAME_REGISTER(plAIBrainCreatedMsg);
|
||||
GETINTERFACE_ANY(plAIBrainCreatedMsg, plAIMsg);
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr) {plAIMsg::Read(stream, mgr);}
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr) {plAIMsg::Write(stream, mgr);}
|
||||
};
|
||||
|
||||
// message sent when the brain arrives at it's specified goal
|
||||
// does NOT get net-propped
|
||||
class plAIArrivedAtGoalMsg : public plAIMsg
|
||||
{
|
||||
public:
|
||||
plAIArrivedAtGoalMsg(): plAIMsg(), fGoal(0, 0, 0) {}
|
||||
plAIArrivedAtGoalMsg(const plKey& sender, const plKey& receiver): plAIMsg(sender, receiver), fGoal(0, 0, 0) {}
|
||||
|
||||
CLASSNAME_REGISTER(plAIArrivedAtGoalMsg);
|
||||
GETINTERFACE_ANY(plAIArrivedAtGoalMsg, plAIMsg);
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void Goal(hsPoint3 goal) {fGoal = goal;}
|
||||
hsPoint3 Goal() const {return fGoal;}
|
||||
|
||||
private:
|
||||
hsPoint3 fGoal;
|
||||
};
|
||||
|
||||
#endif // NO_AV_MSGS
|
||||
#endif // SERVER
|
||||
|
||||
#endif // plAIMsg_inc
|
100
Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp
Normal file
100
Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp
Normal file
@ -0,0 +1,100 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plAccountUpdateMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plAccountUpdateMsg::plAccountUpdateMsg()
|
||||
{
|
||||
fUpdateType = 0;
|
||||
}
|
||||
|
||||
plAccountUpdateMsg::plAccountUpdateMsg(unsigned updateType)
|
||||
{
|
||||
fUpdateType = updateType;
|
||||
}
|
||||
|
||||
void plAccountUpdateMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fUpdateType = stream->ReadSwap32();
|
||||
fResult = stream->ReadSwap32();
|
||||
fPlayerInt = stream->ReadSwap32();
|
||||
}
|
||||
|
||||
void plAccountUpdateMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwap32(fUpdateType);
|
||||
stream->WriteSwap32(fResult);
|
||||
stream->WriteSwap32(fPlayerInt);
|
||||
}
|
||||
|
||||
unsigned plAccountUpdateMsg::GetUpdateType()
|
||||
{
|
||||
return fUpdateType;
|
||||
}
|
||||
|
||||
void plAccountUpdateMsg::SetUpdateType(unsigned type)
|
||||
{
|
||||
fUpdateType = type;
|
||||
}
|
||||
|
||||
unsigned plAccountUpdateMsg::GetResult()
|
||||
{
|
||||
return fResult;
|
||||
}
|
||||
|
||||
void plAccountUpdateMsg::SetResult(unsigned result)
|
||||
{
|
||||
fResult = result;
|
||||
}
|
||||
|
||||
unsigned plAccountUpdateMsg::GetPlayerInt()
|
||||
{
|
||||
return fPlayerInt;
|
||||
}
|
||||
|
||||
void plAccountUpdateMsg::SetPlayerInt(unsigned playerInt)
|
||||
{
|
||||
fPlayerInt = playerInt;
|
||||
}
|
||||
|
88
Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.h
Normal file
88
Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plAccountUpdateMsg_inc
|
||||
#define plAccountUpdateMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plAccountUpdateMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
// If you update this enum, please update the python enum
|
||||
// located at the bottom of cyAccountManagementGlue.cpp
|
||||
enum
|
||||
{
|
||||
kCreatePlayer = 1,
|
||||
kDeletePlayer,
|
||||
kUpgradePlayer,
|
||||
kActivePlayer,
|
||||
kChangePassword,
|
||||
};
|
||||
|
||||
plAccountUpdateMsg();
|
||||
plAccountUpdateMsg(unsigned updateType);
|
||||
|
||||
CLASSNAME_REGISTER( plAccountUpdateMsg );
|
||||
GETINTERFACE_ANY( plAccountUpdateMsg, plMessage );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
unsigned GetUpdateType();
|
||||
void SetUpdateType(unsigned type);
|
||||
|
||||
unsigned GetResult();
|
||||
void SetResult(unsigned result);
|
||||
|
||||
unsigned GetPlayerInt();
|
||||
void SetPlayerInt(unsigned playerInt);
|
||||
|
||||
private:
|
||||
unsigned fUpdateType;
|
||||
unsigned fResult;
|
||||
unsigned fPlayerInt;
|
||||
};
|
||||
|
||||
#endif // plAccountUpdateMsg_inc
|
112
Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h
Normal file
112
Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h
Normal file
@ -0,0 +1,112 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plActivatorMsg_inc
|
||||
#define plActivatorMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
|
||||
class plActivatorMsg : public plMessage
|
||||
{
|
||||
|
||||
void IReset() { fPickedObj=fHiteeObj=fHitterObj=nil; fTriggerType=0; fHitPoint.Set(0,0,0); }
|
||||
public:
|
||||
plActivatorMsg() { IReset(); }
|
||||
plActivatorMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) { IReset(); }
|
||||
~plActivatorMsg() { }
|
||||
|
||||
CLASSNAME_REGISTER( plActivatorMsg );
|
||||
GETINTERFACE_ANY( plActivatorMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fTriggerType = stream->ReadSwap32();
|
||||
fHitPoint.Read(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwap32( fTriggerType );
|
||||
fHitPoint.Write(stream);
|
||||
}
|
||||
|
||||
hsBool TriggerType() { return fTriggerType; }
|
||||
void SetTriggerType(int n) { fTriggerType = n; }
|
||||
|
||||
enum
|
||||
{
|
||||
kUndefined = 0,
|
||||
kPickedTrigger,
|
||||
kUnPickedTrigger,
|
||||
kCollideEnter,
|
||||
kCollideExit,
|
||||
kCollideContact,
|
||||
kCollideUnTrigger,
|
||||
kRoomEntryTrigger,
|
||||
kLogicMod,
|
||||
kVolumeEnter,
|
||||
kVolumeExit,
|
||||
kEnterUnTrigger,
|
||||
kExitUnTrigger,
|
||||
};
|
||||
|
||||
UInt32 fTriggerType;
|
||||
plKey fPickedObj;
|
||||
plKey fHiteeObj;
|
||||
plKey fHitterObj;
|
||||
|
||||
hsPoint3 fHitPoint; // currently only useful for Picked events
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // plActivatorMsg_inc
|
118
Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h
Normal file
118
Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plAgeLoadedMsg_INC
|
||||
#define plAgeLoadedMsg_INC
|
||||
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
//
|
||||
// A msg sent locally when pending pages are done loading or unloading.
|
||||
//
|
||||
class hsResMgr;
|
||||
class hsStream;
|
||||
class plAgeLoadedMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plAgeLoadedMsg );
|
||||
GETINTERFACE_ANY( plAgeLoadedMsg, plMessage );
|
||||
|
||||
plAgeLoadedMsg() : fLoaded(true) { SetBCastFlag(kBCastByType); }
|
||||
|
||||
// True if the pages finished loading, false if they finished unloading
|
||||
bool fLoaded;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); fLoaded = stream->Readbool(); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); stream->Writebool(fLoaded); }
|
||||
};
|
||||
|
||||
// A msg sent locally when panding pages are done loaded and it's now ok to join the game
|
||||
class plAgeLoaded2Msg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plAgeLoaded2Msg );
|
||||
GETINTERFACE_ANY( plAgeLoaded2Msg, plMessage );
|
||||
|
||||
plAgeLoaded2Msg() { SetBCastFlag(kBCastByType); }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
//
|
||||
// A msg sent locally when pending pages are beginning to load or unload.
|
||||
//
|
||||
class plAgeBeginLoadingMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER(plAgeBeginLoadingMsg);
|
||||
GETINTERFACE_ANY(plAgeBeginLoadingMsg, plMessage);
|
||||
|
||||
plAgeBeginLoadingMsg() : fLoading(true) { SetBCastFlag(kBCastByType); }
|
||||
|
||||
// True if the pages are starting to load, false if they are starting to unload
|
||||
bool fLoading;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); fLoading = stream->Readbool(); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); stream->Writebool(fLoading); }
|
||||
};
|
||||
|
||||
//
|
||||
// A msg sent locally when initial age state has been loaded
|
||||
//
|
||||
class plInitialAgeStateLoadedMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plInitialAgeStateLoadedMsg );
|
||||
GETINTERFACE_ANY( plInitialAgeStateLoadedMsg, plMessage );
|
||||
|
||||
plInitialAgeStateLoadedMsg() { SetBCastFlag(kBCastByType); }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
#endif // plAgeLoadedMsg
|
58
Sources/Plasma/PubUtilLib/plMessage/plAngularVelocityMsg.h
Normal file
58
Sources/Plasma/PubUtilLib/plMessage/plAngularVelocityMsg.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../../NucleusLib/pnMessage/plSimulationMsg.h"
|
||||
#include "../../CoreLib/hsGeometry3.h"
|
||||
class plAngularVelocityMsg : public plSimulationMsg
|
||||
{
|
||||
public:
|
||||
// pass-through constructors
|
||||
plAngularVelocityMsg() : plSimulationMsg() {};
|
||||
plAngularVelocityMsg (const plKey &sender, const plKey &receiver, const double *time)
|
||||
: plSimulationMsg(sender,receiver, time), fAngularVelocity(0.0f,0.0f,0.0f){};
|
||||
CLASSNAME_REGISTER( plAngularVelocityMsg );
|
||||
GETINTERFACE_ANY( plAngularVelocityMsg , plSimulationMsg);
|
||||
void AngularVelocity(hsVector3& vel){fAngularVelocity=vel;}
|
||||
const hsVector3& AngularVelocity(){return fAngularVelocity;}
|
||||
protected:
|
||||
hsVector3 fAngularVelocity;
|
||||
|
||||
};
|
194
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp
Normal file
194
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp
Normal file
@ -0,0 +1,194 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plAnimCmdMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plAnimCmdMsg::~plAnimCmdMsg()
|
||||
{
|
||||
ClearCmd();
|
||||
delete [] fAnimName;
|
||||
delete [] fLoopName;
|
||||
}
|
||||
|
||||
|
||||
void plAnimCmdMsg::ClearCmd()
|
||||
{
|
||||
plMessageWithCallbacks::Clear();
|
||||
fCmd.Clear();
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::SetAnimName(const char *name)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
const char *plAnimCmdMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::SetLoopName(const char *name)
|
||||
{
|
||||
delete [] fLoopName;
|
||||
fLoopName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
const char *plAnimCmdMsg::GetLoopName()
|
||||
{
|
||||
return fLoopName;
|
||||
}
|
||||
|
||||
hsBool plAnimCmdMsg::CmdChangesAnimTime()
|
||||
{
|
||||
return (Cmd(kContinue) ||
|
||||
Cmd(kStop) ||
|
||||
Cmd(kGoToTime) ||
|
||||
Cmd(kToggleState) ||
|
||||
Cmd(kGoToBegin) ||
|
||||
Cmd(kGoToEnd) ||
|
||||
Cmd(kGoToLoopBegin) ||
|
||||
Cmd(kGoToLoopEnd) ||
|
||||
Cmd(kIncrementForward) ||
|
||||
Cmd(kIncrementBackward) ||
|
||||
Cmd(kFastForward) ||
|
||||
Cmd(kPlayToTime) ||
|
||||
Cmd(kPlayToPercentage));
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessageWithCallbacks::Read(stream, mgr);
|
||||
|
||||
fCmd.Read(stream);
|
||||
stream->ReadSwap(&fBegin);
|
||||
stream->ReadSwap(&fEnd);
|
||||
stream->ReadSwap(&fLoopEnd);
|
||||
stream->ReadSwap(&fLoopBegin);
|
||||
stream->ReadSwap(&fSpeed);
|
||||
stream->ReadSwap(&fSpeedChangeRate);
|
||||
stream->ReadSwap(&fTime);
|
||||
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fLoopName = stream->ReadSafeString();
|
||||
}
|
||||
|
||||
void plAnimCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessageWithCallbacks::Write(stream, mgr);
|
||||
|
||||
fCmd.Write(stream);
|
||||
stream->WriteSwap(fBegin);
|
||||
stream->WriteSwap(fEnd);
|
||||
stream->WriteSwap(fLoopEnd);
|
||||
stream->WriteSwap(fLoopBegin);
|
||||
stream->WriteSwap(fSpeed);
|
||||
stream->WriteSwap(fSpeedChangeRate);
|
||||
stream->WriteSwap(fTime);
|
||||
|
||||
stream->WriteSafeString(fAnimName);
|
||||
stream->WriteSafeString(fLoopName);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plAGCmdMsg::~plAGCmdMsg()
|
||||
{
|
||||
ClearCmd();
|
||||
delete [] fAnimName;
|
||||
}
|
||||
|
||||
void plAGCmdMsg::SetAnimName(const char *name)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
const char *plAGCmdMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
||||
|
||||
void plAGCmdMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fCmd.Read(stream);
|
||||
stream->ReadSwap(&fBlend);
|
||||
stream->ReadSwap(&fBlendRate);
|
||||
stream->ReadSwap(&fAmp);
|
||||
stream->ReadSwap(&fAmpRate);
|
||||
|
||||
fAnimName = stream->ReadSafeString();
|
||||
}
|
||||
|
||||
void plAGCmdMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
fCmd.Write(stream);
|
||||
stream->WriteSwap(fBlend);
|
||||
stream->WriteSwap(fBlendRate);
|
||||
stream->WriteSwap(fAmp);
|
||||
stream->WriteSwap(fAmpRate);
|
||||
|
||||
stream->WriteSafeString(fAnimName);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plAGDetachCallbackMsg::~plAGDetachCallbackMsg()
|
||||
{
|
||||
delete [] fAnimName;
|
||||
}
|
||||
|
||||
void plAGDetachCallbackMsg::SetAnimName(const char *name)
|
||||
{
|
||||
fAnimName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
char *plAGDetachCallbackMsg::GetAnimName()
|
||||
{
|
||||
return fAnimName;
|
||||
}
|
222
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h
Normal file
222
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h
Normal file
@ -0,0 +1,222 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plAnimCmdMsg_inc
|
||||
#define plAnimCmdMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessageWithCallbacks.h"
|
||||
#include "hsBitVector.h"
|
||||
#include "hsTemplates.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include "../plInterp/plAnimEaseTypes.h"
|
||||
#include "../plInterp/plAnimTimeConvert.h"
|
||||
|
||||
class plAGAnimInstance;
|
||||
|
||||
class plAnimCmdMsg : public plMessageWithCallbacks
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
char *fLoopName;
|
||||
|
||||
private:
|
||||
void IInit() { fBegin=fEnd=fLoopBegin=fLoopEnd=fSpeed=fSpeedChangeRate=fTime=0; fAnimName=fLoopName=nil;}
|
||||
public:
|
||||
plAnimCmdMsg()
|
||||
: plMessageWithCallbacks(nil, nil, nil) { IInit(); }
|
||||
plAnimCmdMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
: plMessageWithCallbacks(s, r, t) { IInit(); }
|
||||
virtual ~plAnimCmdMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plAnimCmdMsg );
|
||||
GETINTERFACE_ANY( plAnimCmdMsg, plMessageWithCallbacks );
|
||||
|
||||
// When adding a command, add a check for it in CmdChangesAnimTime if appropriate
|
||||
enum ModCmds
|
||||
{
|
||||
kContinue=0,
|
||||
kStop,
|
||||
kSetLooping,
|
||||
kUnSetLooping,
|
||||
kSetBegin,
|
||||
kSetEnd,
|
||||
kSetLoopEnd,
|
||||
kSetLoopBegin,
|
||||
kSetSpeed,
|
||||
kGoToTime,
|
||||
kSetBackwards,
|
||||
kSetForewards,
|
||||
kToggleState,
|
||||
kAddCallbacks,
|
||||
kRemoveCallbacks,
|
||||
kGoToBegin,
|
||||
kGoToEnd,
|
||||
kGoToLoopBegin,
|
||||
kGoToLoopEnd,
|
||||
kIncrementForward,
|
||||
kIncrementBackward,
|
||||
kRunForward,
|
||||
kRunBackward,
|
||||
kPlayToTime,
|
||||
kPlayToPercentage,
|
||||
kFastForward,
|
||||
kGoToPercent,
|
||||
kNumCmds,
|
||||
};
|
||||
|
||||
hsBitVector fCmd;
|
||||
|
||||
hsBool Cmd(int n) const { return fCmd.IsBitSet(n); }
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd();
|
||||
void SetAnimName(const char *name);
|
||||
const char *GetAnimName();
|
||||
hsBool CmdChangesAnimTime(); // Will this command cause an update to the current anim time?
|
||||
|
||||
void SetLoopName(const char *name);
|
||||
const char *GetLoopName();
|
||||
|
||||
hsScalar fBegin;
|
||||
hsScalar fEnd;
|
||||
hsScalar fLoopEnd;
|
||||
hsScalar fLoopBegin;
|
||||
hsScalar fSpeed;
|
||||
hsScalar fSpeedChangeRate;
|
||||
hsScalar fTime;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
// plAnimCmdMsg is intented for animation commands sent to a plAnimTimeConvert. Commands that only apply to the
|
||||
// AG (Animation Graph) system go here.
|
||||
|
||||
class plAGCmdMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
|
||||
private:
|
||||
void IInit() { fBlend = fAmp = 0;
|
||||
fAnimName=nil;}
|
||||
public:
|
||||
plAGCmdMsg()
|
||||
: plMessage(nil, nil, nil) { IInit(); }
|
||||
plAGCmdMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
: plMessage(s, r, t) { IInit(); }
|
||||
virtual ~plAGCmdMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plAGCmdMsg );
|
||||
GETINTERFACE_ANY( plAGCmdMsg, plMessage );
|
||||
|
||||
enum ModCmds
|
||||
{
|
||||
kSetBlend,
|
||||
kSetAmp,
|
||||
kSetAnimTime,
|
||||
};
|
||||
|
||||
hsBitVector fCmd;
|
||||
|
||||
hsBool Cmd(int n) const { return fCmd.IsBitSet(n); }
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd() { fCmd.Clear(); }
|
||||
void SetAnimName(const char *name);
|
||||
const char *GetAnimName();
|
||||
|
||||
hsScalar fBlend;
|
||||
hsScalar fBlendRate;
|
||||
hsScalar fAmp;
|
||||
hsScalar fAmpRate;
|
||||
hsScalar fAnimTime;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
class plAGInstanceCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
public:
|
||||
plAGInstanceCallbackMsg() : plEventCallbackMsg(), fInstance(nil) {}
|
||||
plAGInstanceCallbackMsg(plKey receiver, CallbackEvent e, int idx=0, hsScalar t=0, Int16 repeats=-1, UInt16 user=0) :
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user), fInstance(nil) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAGInstanceCallbackMsg );
|
||||
GETINTERFACE_ANY( plAGInstanceCallbackMsg, plEventCallbackMsg );
|
||||
|
||||
// These aren't meant to go across the net, so no IO necessary.
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
|
||||
plAGAnimInstance *fInstance;
|
||||
};
|
||||
|
||||
class plAGDetachCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
protected:
|
||||
char *fAnimName;
|
||||
|
||||
public:
|
||||
plAGDetachCallbackMsg() : plEventCallbackMsg(), fAnimName(nil) {}
|
||||
plAGDetachCallbackMsg(plKey receiver, CallbackEvent e, int idx=0, hsScalar t=0, Int16 repeats=-1, UInt16 user=0) :
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user), fAnimName(nil) {}
|
||||
virtual ~plAGDetachCallbackMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plAGDetachCallbackMsg );
|
||||
GETINTERFACE_ANY( plAGDetachCallbackMsg, plEventCallbackMsg );
|
||||
|
||||
// These aren't meant to go across the net, so no IO necessary.
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
|
||||
void SetAnimName(const char *name);
|
||||
char *GetAnimName();
|
||||
};
|
||||
|
||||
|
||||
#endif // plAnimCmdMsg_inc
|
@ -0,0 +1,80 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plAnimationEventCallbackMsg_inc
|
||||
#define plAnimationEventCallbackMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
enum AnimationEvent
|
||||
{
|
||||
kAnimStart = 0,
|
||||
kAnimStop,
|
||||
kAnimReverse,
|
||||
kAnimTime,
|
||||
kAnimEventEnd
|
||||
};
|
||||
|
||||
class plAnimationEventCallbackMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
AnimationEvent fEvent;
|
||||
hsScalar fEventTime;
|
||||
|
||||
plAnimationEventCallbackMsg(){;}
|
||||
plAnimationEventCallbackMsg(const plKey* s,
|
||||
const plKey* r,
|
||||
const double* t){;}
|
||||
~plAnimationEventCallbackMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plAnimationEventCallbackMsg );
|
||||
GETINTERFACE_ANY( plAnimationEventCallbackMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
|
||||
#endif // plAnimationEventCallbackMsg_inc
|
@ -0,0 +1,82 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plApplyAvatarCustomizationsMsg_h
|
||||
#define plApplyAvatarCustomizationsMsg_h
|
||||
|
||||
#error
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plNetCommon/plNetAvatarVault.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
|
||||
class plApplyAvatarCustomizationsMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plApplyAvatarCustomizationsMsg );
|
||||
GETINTERFACE_ANY( plApplyAvatarCustomizationsMsg, plMessage );
|
||||
|
||||
void SetCustomizations(const plPlayerCustomizations * value) { fCustomizations=*value;}
|
||||
const plPlayerCustomizations * GetCustomizations() const { return &fCustomizations;}
|
||||
void SetAvatarKey(plKey * key) { fAvatarKey=key;}
|
||||
const plKey * GetAvatarKey() const { return fAvatarKey;}
|
||||
|
||||
void Read(hsStream * stream, hsResMgr * mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fCustomizations.Read(stream);
|
||||
fAvatarKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream * stream, hsResMgr * mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
fCustomizations.Write(stream);
|
||||
mgr->WriteKey(stream,fAvatarKey);
|
||||
}
|
||||
private:
|
||||
plPlayerCustomizations fCustomizations;
|
||||
plKey * fAvatarKey;
|
||||
};
|
||||
|
||||
|
||||
#endif //plApplyAvatarCustomizationsMsg_h
|
@ -0,0 +1,80 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plApplyStoredAvatarSettingsMsg_h
|
||||
#define plApplyStoredAvatarSettingsMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plNetCommon/plNetAvatarVault.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
|
||||
class plApplyStoredAvatarSettingsMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plApplyStoredAvatarSettingsMsg );
|
||||
GETINTERFACE_ANY( plApplyStoredAvatarSettingsMsg, plMessage );
|
||||
|
||||
void SetSettings(const plStoredAvatarSettings & settings) { fSettings=settings;}
|
||||
const plStoredAvatarSettings & GetSettings() const { return fSettings;}
|
||||
const plKey * GetAvatarKey() const { return fAvatarKey;}
|
||||
void SetAvatarKey(plKey * key) { fAvatarKey=key;}
|
||||
|
||||
void Read(hsStream * stream, hsResMgr * mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fSettings.Read(stream);
|
||||
fAvatarKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream * stream, hsResMgr * mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
fSettings.Write(stream);
|
||||
mgr->WriteKey(stream,fAvatarKey);
|
||||
}
|
||||
private:
|
||||
plStoredAvatarSettings fSettings;
|
||||
plKey * fAvatarKey;
|
||||
};
|
||||
|
||||
|
||||
#endif //plApplyStoredAvatarSettingsMsg_h
|
128
Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp
Normal file
128
Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef SERVER
|
||||
#ifndef NO_AV_MSGS
|
||||
|
||||
// singular
|
||||
#include "plAvCoopMsg.h"
|
||||
|
||||
// global
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
// other
|
||||
#include "../plAvatar/plAvatarMgr.h"
|
||||
#include "../plAvatar/plCoopCoordinator.h"
|
||||
|
||||
// plAvCoopMsg -----------
|
||||
// ------------
|
||||
plAvCoopMsg::plAvCoopMsg()
|
||||
: plMessage(nil, nil, nil),
|
||||
fInitiatorID(0),
|
||||
fInitiatorSerial(0),
|
||||
fCommand(kNone),
|
||||
fCoordinator(nil)
|
||||
{
|
||||
}
|
||||
|
||||
// plAvCoopMsg ------------
|
||||
// ------------
|
||||
plAvCoopMsg::~plAvCoopMsg()
|
||||
{
|
||||
}
|
||||
|
||||
// plAvCoopMsg -----------------------------------
|
||||
// ------------
|
||||
plAvCoopMsg::plAvCoopMsg(Command cmd, UInt32 id, UInt16 serial)
|
||||
: plMessage(nil, plAvatarMgr::GetInstance()->GetKey(), nil),
|
||||
fInitiatorID(id),
|
||||
fInitiatorSerial(serial),
|
||||
fCommand(cmd),
|
||||
fCoordinator(nil)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// plAvCoopMsg ----------------------------------
|
||||
// ------------
|
||||
plAvCoopMsg::plAvCoopMsg(plKey sender, plCoopCoordinator *coordinator)
|
||||
: plMessage(sender, plAvatarMgr::GetInstance()->GetKey(), nil),
|
||||
fInitiatorID(coordinator->GetInitiatorID()),
|
||||
fInitiatorSerial(coordinator->GetInitiatorSerial()),
|
||||
fCommand(kStartNew),
|
||||
fCoordinator(coordinator)
|
||||
{
|
||||
}
|
||||
|
||||
// Read -----------------------------------------------
|
||||
// -----
|
||||
void plAvCoopMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
if(stream->Readbool())
|
||||
fCoordinator = reinterpret_cast<plCoopCoordinator *>(mgr->ReadCreatable(stream));
|
||||
|
||||
fInitiatorID = stream->ReadSwap32();
|
||||
fInitiatorSerial = stream->ReadSwap16();
|
||||
|
||||
fCommand = static_cast<Command>(stream->ReadSwap16());
|
||||
}
|
||||
|
||||
// Write -----------------------------------------------
|
||||
// ------
|
||||
void plAvCoopMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
stream->Writebool(fCoordinator != nil);
|
||||
if(fCoordinator)
|
||||
mgr->WriteCreatable(stream, fCoordinator);
|
||||
|
||||
stream->WriteSwap32(fInitiatorID);
|
||||
stream->WriteSwap16(fInitiatorSerial);
|
||||
|
||||
stream->WriteSwap16(fCommand);
|
||||
}
|
||||
|
||||
#endif // ndef NO_AV_MSGS
|
||||
#endif // ndef SERVER
|
131
Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.h
Normal file
131
Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.h
Normal file
@ -0,0 +1,131 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
|
||||
#ifndef plAvCoopMsg_inc
|
||||
#define plAvCoopMsg_inc
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// INCLUDES
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FORWARDS
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plCoopCoordinator;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DEFINITIONS
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** plAvCoopMsg -------------------------------------------------------------------------
|
||||
These are always sent to the avatar manager, which sends the appropriate things to
|
||||
the other avatar.
|
||||
A possible future optimization would be to send them only to the involved players.
|
||||
*/
|
||||
class plAvCoopMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TYPES
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum Command {
|
||||
kNone,
|
||||
kStartNew,
|
||||
kGuestAccepted,
|
||||
kGuestSeeked,
|
||||
kGuestSeekAbort,
|
||||
kCommandSize = 0xffff
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// INTERFACE
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// constructors
|
||||
plAvCoopMsg();
|
||||
plAvCoopMsg(Command cmd, UInt32 id, UInt16 serial);
|
||||
plAvCoopMsg(plKey sender, plCoopCoordinator *coordinateur);
|
||||
~plAvCoopMsg();
|
||||
|
||||
// rtti
|
||||
CLASSNAME_REGISTER( plAvCoopMsg );
|
||||
GETINTERFACE_ANY( plAvCoopMsg, plMessage);
|
||||
|
||||
// i/o
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PUBLIC DATA MEMBERS
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 fInitiatorID;
|
||||
UInt16 fInitiatorSerial;
|
||||
|
||||
Command fCommand;
|
||||
|
||||
plCoopCoordinator *fCoordinator; // optional
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
69
Sources/Plasma/PubUtilLib/plMessage/plAvatarFootMsg.cpp
Normal file
69
Sources/Plasma/PubUtilLib/plMessage/plAvatarFootMsg.cpp
Normal file
@ -0,0 +1,69 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plAvatarFootMsg.h"
|
||||
|
||||
#include "hsStream.h"
|
||||
|
||||
plAvatarFootMsg::plAvatarFootMsg()
|
||||
: fArmature(nil),
|
||||
fIsLeft(false);
|
||||
{
|
||||
}
|
||||
|
||||
plAvatarFootMsg::plAvatarFootMsg(const plKey& s, plArmatureMod *armature, plAvBrain *brain, hsBool isLocal, hsBool isLeft)
|
||||
: plArmatureUpdateMsg(s, isLocal, true, armature, brain),
|
||||
fIsLeft(isLeft)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
void plAvatarFootMsg::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
void plAvatarFootMsg::Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
90
Sources/Plasma/PubUtilLib/plMessage/plAvatarFootMsg.h
Normal file
90
Sources/Plasma/PubUtilLib/plMessage/plAvatarFootMsg.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plAvatarFootMsg_inc
|
||||
#define plAvatarFootMsg_inc
|
||||
|
||||
#include "../pnMessage/plEventCallbackMsg.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
class plArmatureMod;
|
||||
class plAvBrain;
|
||||
|
||||
class plAvatarFootMsg : public plEventCallbackMsg
|
||||
{
|
||||
protected:
|
||||
hsBool fIsLeft;
|
||||
plArmatureMod* fArmature;
|
||||
public:
|
||||
plAvatarFootMsg()
|
||||
{
|
||||
fEvent = kTime;
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
plAvatarFootMsg(const plKey& s, plArmatureMod *armature, hsBool isLeft) : plEventCallbackMsg(s, nil, nil), fArmature(armature), fIsLeft(isLeft)
|
||||
{
|
||||
fEvent = kTime;
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarFootMsg );
|
||||
GETINTERFACE_ANY( plAvatarFootMsg, plEventCallbackMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
hsBool IsLeft() const { return fIsLeft; }
|
||||
void SetIsLeft(hsBool on) { fIsLeft = (0 != on); }
|
||||
|
||||
plArmatureMod* GetArmature() const { return fArmature; }
|
||||
void SetArmature(plArmatureMod* a) { fArmature = a; }
|
||||
|
||||
};
|
||||
|
||||
#endif // plAvatarFootMsg_inc
|
674
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp
Normal file
674
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp
Normal file
@ -0,0 +1,674 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
|
||||
#include "plAvatarMsg.h"
|
||||
|
||||
#include "hsResMgr.h"
|
||||
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
#include "../pnSceneObject/plSceneObject.h"
|
||||
|
||||
#ifndef SERVER
|
||||
#include "../plAvatar/plAvBrain.h"
|
||||
#endif
|
||||
|
||||
|
||||
//////////////
|
||||
// PLAVATARMSG
|
||||
//////////////
|
||||
|
||||
// CTOR()
|
||||
plAvatarMsg::plAvatarMsg()
|
||||
: plMessage()
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR(sender, receiver, time)
|
||||
plAvatarMsg::plAvatarMsg(const plKey &sender, const plKey &receiver)
|
||||
: plMessage(sender, receiver, nil)
|
||||
{
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvatarMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvatarMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
// PLARMATUREUPDATEMSG
|
||||
//////////////////////
|
||||
|
||||
// CTOR()
|
||||
plArmatureUpdateMsg::plArmatureUpdateMsg()
|
||||
: fIsInvis(false)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
// CTOR sender receiver islocal isplayercontrolled
|
||||
plArmatureUpdateMsg::plArmatureUpdateMsg(const plKey &sender,
|
||||
hsBool isLocal, hsBool isPlayerControlled,
|
||||
plArmatureMod *armature)
|
||||
: plAvatarMsg(sender, nil),
|
||||
fIsLocal(isLocal),
|
||||
fIsPlayerControlled(isPlayerControlled),
|
||||
fArmature(armature),
|
||||
fIsInvis(false)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
// READ stream mgr
|
||||
void plArmatureUpdateMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
// WRITE stream mgr
|
||||
void plArmatureUpdateMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
// ISLOCAL
|
||||
hsBool plArmatureUpdateMsg::IsLocal() const
|
||||
{
|
||||
return fIsLocal;
|
||||
}
|
||||
|
||||
// ISPLAYERCONTROLLED
|
||||
hsBool plArmatureUpdateMsg::IsPlayerControlled() const
|
||||
{
|
||||
return fIsPlayerControlled;
|
||||
}
|
||||
|
||||
hsBool plArmatureUpdateMsg::IsInvis() const
|
||||
{
|
||||
return fIsInvis;
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
// PLAVATARSETTYPEMSG
|
||||
/////////////////////
|
||||
|
||||
// ctor
|
||||
plAvatarSetTypeMsg::plAvatarSetTypeMsg()
|
||||
: fIsPlayer(false)
|
||||
{
|
||||
}
|
||||
|
||||
plAvatarSetTypeMsg::plAvatarSetTypeMsg(const plKey &sender, const plKey &receiver)
|
||||
: plAvatarMsg(sender, receiver),
|
||||
fIsPlayer(false)
|
||||
{
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvatarSetTypeMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
fIsPlayer = stream->Readbool();
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvatarSetTypeMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
stream->Writebool(fIsPlayer);
|
||||
}
|
||||
|
||||
// SETISPLAYER
|
||||
void plAvatarSetTypeMsg::SetIsPlayer(bool is)
|
||||
{
|
||||
fIsPlayer = is;
|
||||
}
|
||||
|
||||
// ISPLAYER
|
||||
bool plAvatarSetTypeMsg::IsPlayer()
|
||||
{
|
||||
return fIsPlayer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////
|
||||
// PLAVTASKMSG
|
||||
//////////////
|
||||
|
||||
plAvTaskMsg::plAvTaskMsg()
|
||||
: plAvatarMsg(), fTask(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plAvTaskMsg::plAvTaskMsg(const plKey &sender, const plKey &receiver)
|
||||
: plAvatarMsg(sender, receiver), fTask(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plAvTaskMsg::plAvTaskMsg(const plKey &sender, const plKey &receiver, plAvTask *task)
|
||||
: plAvatarMsg(sender, receiver),
|
||||
fTask(task)
|
||||
{
|
||||
}
|
||||
|
||||
plAvTask *plAvTaskMsg::GetTask()
|
||||
{
|
||||
return fTask;
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvTaskMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Read(stream, mgr);
|
||||
if(stream->ReadBool())
|
||||
fTask = (plAvTask *)mgr->ReadCreatable(stream);
|
||||
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvTaskMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Write(stream, mgr);
|
||||
if(fTask)
|
||||
{
|
||||
stream->WriteBool(true);
|
||||
mgr->WriteCreatable(stream, (plCreatable *)fTask);
|
||||
} else {
|
||||
stream->WriteBool(false);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////
|
||||
//
|
||||
// PLAVSEEKMSG
|
||||
//
|
||||
//////////////
|
||||
// Tell the avatar to go to a specific seekpoint.
|
||||
// The given key (seekKey) must be to a plSeekPointMod
|
||||
|
||||
// CTOR()
|
||||
plAvSeekMsg::plAvSeekMsg()
|
||||
: plAvTaskMsg(),
|
||||
fSeekPoint(nil),
|
||||
fDuration(0),
|
||||
fSmartSeek(true),
|
||||
fAlignType(kAlignHandle),
|
||||
fAnimName(nil),
|
||||
fNoSeek(false),
|
||||
fFlags(kSeekFlagForce3rdPersonOnStart)
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR(sender, receiver, seekKey, time)
|
||||
plAvSeekMsg::plAvSeekMsg(const plKey& sender, const plKey& receiver,
|
||||
const plKey &seekKey, float duration, hsBool smartSeek,
|
||||
plAvAlignment alignType, char *animName, hsBool noSeek,
|
||||
UInt8 flags, plKey finishKey)
|
||||
: plAvTaskMsg(sender, receiver),
|
||||
fSeekPoint(seekKey),
|
||||
fTargetPos(0, 0, 0),
|
||||
fTargetLookAt(0, 0, 0),
|
||||
fDuration(duration),
|
||||
fSmartSeek(smartSeek),
|
||||
fAnimName(animName),
|
||||
fAlignType(alignType),
|
||||
fNoSeek(noSeek),
|
||||
fFlags(flags),
|
||||
fFinishKey(finishKey)
|
||||
{
|
||||
}
|
||||
|
||||
hsBool plAvSeekMsg::Force3rdPersonOnStart()
|
||||
{
|
||||
return fFlags & kSeekFlagForce3rdPersonOnStart;
|
||||
}
|
||||
|
||||
hsBool plAvSeekMsg::UnForce3rdPersonOnFinish()
|
||||
{
|
||||
return fFlags & kSeekFlagUnForce3rdPersonOnFinish;
|
||||
}
|
||||
|
||||
hsBool plAvSeekMsg::NoWarpOnTimeout()
|
||||
{
|
||||
return fFlags & kSeekFlagNoWarpOnTimeout;
|
||||
}
|
||||
|
||||
hsBool plAvSeekMsg::RotationOnly()
|
||||
{
|
||||
return fFlags & kSeekFlagRotationOnly;
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvSeekMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvTaskMsg::Read(stream, mgr);
|
||||
|
||||
fSeekPoint = mgr->ReadKey(stream);
|
||||
if (!fSeekPoint)
|
||||
{
|
||||
fTargetPos.Read(stream);
|
||||
fTargetLookAt.Read(stream);
|
||||
}
|
||||
|
||||
fDuration = stream->ReadSwapScalar();
|
||||
fSmartSeek = stream->ReadBool();
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fAlignType = static_cast<plAvAlignment>(stream->ReadSwap16());
|
||||
fNoSeek = stream->ReadBool();
|
||||
fFlags = stream->ReadByte();
|
||||
fFinishKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvSeekMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvTaskMsg::Write(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fSeekPoint);
|
||||
if (!fSeekPoint)
|
||||
{
|
||||
fTargetPos.Write(stream);
|
||||
fTargetLookAt.Write(stream);
|
||||
}
|
||||
|
||||
stream->WriteSwapScalar(fDuration);
|
||||
stream->WriteBool(fSmartSeek);
|
||||
stream->WriteSafeString(fAnimName);
|
||||
stream->WriteSwap16(static_cast<UInt16>(fAlignType));
|
||||
stream->WriteBool(fNoSeek);
|
||||
stream->WriteByte(fFlags);
|
||||
mgr->WriteKey(stream, fFinishKey);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void plAvTaskSeekDoneMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Read(stream, mgr);
|
||||
|
||||
fAborted = stream->ReadBool();
|
||||
}
|
||||
|
||||
void plAvTaskSeekDoneMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Write(stream, mgr);
|
||||
|
||||
stream->WriteBool(fAborted);
|
||||
}
|
||||
|
||||
/////////////////
|
||||
//
|
||||
// PLAVONESHOTMSG
|
||||
//
|
||||
/////////////////
|
||||
|
||||
#include "../plMessage/plOneShotCallbacks.h"
|
||||
|
||||
// CTOR()
|
||||
plAvOneShotMsg::plAvOneShotMsg()
|
||||
: plAvSeekMsg(), fAnimName(nil), fDrivable(false), fReversible(false), fCallbacks(nil)
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR(sender, receiver, seekKey, time)
|
||||
plAvOneShotMsg::plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
||||
const plKey& seekKey, float duration, hsBool smartSeek,
|
||||
const char *animName, hsBool drivable, hsBool reversible)
|
||||
: plAvSeekMsg(sender, receiver, seekKey, duration, smartSeek),
|
||||
fDrivable(drivable), fReversible(reversible), fCallbacks(nil)
|
||||
{
|
||||
fAnimName = hsStrcpy(animName);
|
||||
}
|
||||
|
||||
// DTOR
|
||||
plAvOneShotMsg::~plAvOneShotMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fCallbacks);
|
||||
fCallbacks = nil;
|
||||
|
||||
delete[] fAnimName;
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvOneShotMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvSeekMsg::Read(stream, mgr);
|
||||
|
||||
delete [] fAnimName;
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fDrivable = stream->ReadBool();
|
||||
fReversible = stream->ReadBool();
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvOneShotMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvSeekMsg::Write(stream, mgr);
|
||||
|
||||
stream->WriteSafeString(fAnimName);
|
||||
stream->WriteBool(fDrivable);
|
||||
stream->WriteBool(fReversible);
|
||||
}
|
||||
|
||||
|
||||
////////////////
|
||||
//
|
||||
// plAvBrainGenericMsg
|
||||
//
|
||||
////////////////
|
||||
|
||||
// default CTOR
|
||||
plAvBrainGenericMsg::plAvBrainGenericMsg()
|
||||
: fType(kNextStage), // default verb is goto next stage
|
||||
fWhichStage(0), // default stage is 0
|
||||
fSetTime(false), // don't set the time of the target stage
|
||||
fNewTime(0.0f), // if we do set, set it to zero
|
||||
fSetDirection(false), // don't set the direction of the brain
|
||||
fNewDirection(true), // if we do set the direction, set it to forward
|
||||
fNewLoopCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
// canonical CTOR sender receiver type stage rewind transitionTime
|
||||
plAvBrainGenericMsg::plAvBrainGenericMsg(const plKey& sender, const plKey &receiver,
|
||||
plAvBrainGenericMsg::Type type, int stage, hsBool rewind, hsScalar transitionTime)
|
||||
: plAvatarMsg(sender, receiver),
|
||||
fType(type),
|
||||
fWhichStage(stage),
|
||||
fSetTime(rewind),
|
||||
fNewTime(0.0f),
|
||||
fSetDirection(false),
|
||||
fNewDirection(true),
|
||||
fNewLoopCount(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
plAvBrainGenericMsg::plAvBrainGenericMsg(const plKey& sender, const plKey &receiver,
|
||||
Type type, int stage, hsBool setTime, hsScalar newTime,
|
||||
hsBool setDirection, bool isForward, hsScalar transitiontime)
|
||||
: plAvatarMsg(sender, receiver),
|
||||
fType(type),
|
||||
fWhichStage(stage),
|
||||
fSetTime(setTime),
|
||||
fNewTime(newTime),
|
||||
fSetDirection(setDirection),
|
||||
fNewDirection(isForward),
|
||||
fNewLoopCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
plAvBrainGenericMsg::plAvBrainGenericMsg(plKey sender, plKey receiver,
|
||||
Type type, int stage, int newLoopCount)
|
||||
: plAvatarMsg(sender, receiver),
|
||||
fType(type),
|
||||
fWhichStage(stage),
|
||||
fSetTime(false), // unused
|
||||
fNewTime(0), // unused
|
||||
fSetDirection(false), // unused
|
||||
fNewDirection(false), // unused
|
||||
fNewLoopCount(newLoopCount)
|
||||
{
|
||||
hsAssert(type == kSetLoopCount, "This constructor form is only for the kSetLoopCount command.");
|
||||
}
|
||||
|
||||
|
||||
void plAvBrainGenericMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Write(stream, mgr);
|
||||
stream->WriteSwap32(fType);
|
||||
stream->WriteSwap32(fWhichStage);
|
||||
stream->WriteBool(fSetTime);
|
||||
stream->WriteSwapScalar(fNewTime);
|
||||
stream->WriteBool(fSetDirection);
|
||||
stream->WriteBool(fNewDirection);
|
||||
stream->WriteSwapScalar(fTransitionTime);
|
||||
}
|
||||
|
||||
void plAvBrainGenericMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvatarMsg::Read(stream, mgr);
|
||||
fType = static_cast<plAvBrainGenericMsg::Type>(stream->ReadSwap32());
|
||||
fWhichStage = stream->ReadSwap32();
|
||||
fSetTime = stream->ReadBool();
|
||||
fNewTime = stream->ReadSwapScalar();
|
||||
fSetDirection = stream->ReadBool();
|
||||
fNewDirection = stream->ReadBool();
|
||||
fTransitionTime = stream->ReadSwapScalar();
|
||||
}
|
||||
|
||||
enum AvBrainGenericFlags
|
||||
{
|
||||
kAvBrainGenericType,
|
||||
kAvBrainGenericWhich,
|
||||
kAvBrainGenericSetTime,
|
||||
kAvBrainGenericNewTime,
|
||||
kAvBrainGenericSetDir,
|
||||
kAvBrainGenericNewDir,
|
||||
kAvBrainGenericTransTime,
|
||||
};
|
||||
|
||||
void plAvBrainGenericMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kAvBrainGenericType);
|
||||
contentFlags.SetBit(kAvBrainGenericWhich);
|
||||
contentFlags.SetBit(kAvBrainGenericSetTime);
|
||||
contentFlags.SetBit(kAvBrainGenericNewTime);
|
||||
contentFlags.SetBit(kAvBrainGenericSetDir);
|
||||
contentFlags.SetBit(kAvBrainGenericNewDir);
|
||||
contentFlags.SetBit(kAvBrainGenericTransTime);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kAvBrainGenericType
|
||||
s->WriteSwap32(fType);
|
||||
// kAvBrainGenericWhich
|
||||
s->WriteSwap32(fWhichStage);
|
||||
// kAvBrainGenericSetTime
|
||||
s->WriteBool(fSetTime);
|
||||
// kAvBrainGenericNewTime
|
||||
s->WriteSwapScalar(fNewTime);
|
||||
// kAvBrainGenericSetDir
|
||||
s->WriteBool(fSetDirection);
|
||||
// kAvBrainGenericNewDir
|
||||
s->WriteBool(fNewDirection);
|
||||
// kAvBrainGenericTransTime
|
||||
s->WriteSwapScalar(fTransitionTime);
|
||||
}
|
||||
|
||||
void plAvBrainGenericMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericType))
|
||||
fType = static_cast<plAvBrainGenericMsg::Type>(s->ReadSwap32());
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericWhich))
|
||||
fWhichStage = s->ReadSwap32();
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericSetTime))
|
||||
fSetTime = s->ReadBool();
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericNewTime))
|
||||
fNewTime = s->ReadSwapScalar();
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericSetDir))
|
||||
fSetDirection = s->ReadBool();
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericNewDir))
|
||||
fNewDirection = s->ReadBool();
|
||||
if (contentFlags.IsBitSet(kAvBrainGenericTransTime))
|
||||
fTransitionTime = s->ReadSwapScalar();
|
||||
}
|
||||
|
||||
///////////////////
|
||||
//
|
||||
// PLAVPUSHBRAINMSG
|
||||
//
|
||||
///////////////////
|
||||
|
||||
#ifndef SERVER
|
||||
|
||||
// default ctor
|
||||
plAvPushBrainMsg::plAvPushBrainMsg()
|
||||
: fBrain(nil)
|
||||
{
|
||||
}
|
||||
|
||||
// canonical ctor
|
||||
plAvPushBrainMsg::plAvPushBrainMsg(const plKey& sender, const plKey &receiver, plArmatureBrain *brain)
|
||||
: plAvTaskMsg(sender, receiver)
|
||||
{
|
||||
fBrain = brain;
|
||||
}
|
||||
|
||||
// dtor
|
||||
plAvPushBrainMsg::~plAvPushBrainMsg()
|
||||
{
|
||||
}
|
||||
|
||||
// READ
|
||||
void plAvPushBrainMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvTaskMsg::Read(stream, mgr);
|
||||
|
||||
fBrain = plArmatureBrain::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
hsAssert(fBrain, "PLAVPUSHBRAINMSG: Problem reading brain from stream.");
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plAvPushBrainMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plAvTaskMsg::Write(stream, mgr);
|
||||
mgr->WriteCreatable(stream, fBrain);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
//
|
||||
// PLAVPOPBRAINMSG
|
||||
//
|
||||
//////////////////
|
||||
|
||||
// default ctor
|
||||
plAvPopBrainMsg::plAvPopBrainMsg()
|
||||
{
|
||||
}
|
||||
|
||||
// canonical ctor
|
||||
plAvPopBrainMsg::plAvPopBrainMsg(const plKey &sender, const plKey &receiver)
|
||||
: plAvTaskMsg(sender, receiver)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
||||
|
||||
/////////////////
|
||||
////
|
||||
//// PLAVEMOTEMSG
|
||||
////
|
||||
/////////////////
|
||||
//
|
||||
//// default ctor
|
||||
//plAvEmoteMsg::plAvEmoteMsg()
|
||||
//: fAnimName(nil)
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//// canonical ctor
|
||||
//plAvEmoteMsg::plAvEmoteMsg(plKey sender, plKey receiver, char *name)
|
||||
//: plAvTaskMsg(sender, receiver)
|
||||
//{
|
||||
// fAnimName = hsStrcpy(name);
|
||||
//}
|
||||
//
|
||||
//// READ
|
||||
//void plAvEmoteMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
//{
|
||||
// plAvTaskMsg::Read(stream, mgr);
|
||||
// fAnimName = stream->ReadSafeString();
|
||||
//}
|
||||
//
|
||||
//// WRITE
|
||||
//void plAvEmoteMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
//{
|
||||
// plAvTaskMsg::Write(stream, mgr);
|
||||
// stream->WriteSafeString(fAnimName);
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////
|
||||
//
|
||||
// PLAVATARSTEALTHMODEMSG
|
||||
//
|
||||
///////////////////////////
|
||||
|
||||
plAvatarStealthModeMsg::plAvatarStealthModeMsg() : plAvatarMsg(), fMode(kStealthVisible), fLevel(0)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
plAvatarStealthModeMsg::~plAvatarStealthModeMsg() {}
|
||||
|
||||
// READ stream mgr
|
||||
void plAvatarStealthModeMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
// WRITE stream mgr
|
||||
void plAvatarStealthModeMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
hsAssert(false, "This message is not supposed to travel over the network or persist in a file.");
|
||||
}
|
||||
|
||||
|
||||
#endif // ndef NO_AV_MSGS
|
464
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h
Normal file
464
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h
Normal file
@ -0,0 +1,464 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
|
||||
#ifndef plAvatarMsg_inc
|
||||
#define plAvatarMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsBitVector.h"
|
||||
#include "../plAvatar/plArmatureMod.h"
|
||||
#include "../pnMessage/plEventCallbackMsg.h"
|
||||
|
||||
class plSceneObject;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
class plAvTask;
|
||||
class plKey;
|
||||
class plArmatureMod;
|
||||
class plArmatureBrain;
|
||||
|
||||
/** \Class plAvatarMsg
|
||||
Abstract base class for messages to and from the avatar.
|
||||
*/
|
||||
class plAvatarMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
// tors
|
||||
plAvatarMsg();
|
||||
plAvatarMsg(const plKey &sender, const plKey &receiver);
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvatarMsg );
|
||||
GETINTERFACE_ANY( plAvatarMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
};
|
||||
|
||||
|
||||
/** \Class plArmatureUpdateMsg
|
||||
Sent every frame by all armatures. Currently only sent by humans,
|
||||
mainly because currently that's all we have. Non-humans may send
|
||||
less often.
|
||||
*/
|
||||
class plArmatureUpdateMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
plArmatureUpdateMsg();
|
||||
plArmatureUpdateMsg(const plKey &sender,
|
||||
hsBool isLocal, hsBool isPlayerControlled,
|
||||
plArmatureMod *armature);
|
||||
|
||||
/** The avatar that sent this message is the local avatar for this client. */
|
||||
hsBool IsLocal() const;
|
||||
void SetIsLocal(hsBool on) { fIsLocal = on; }
|
||||
/** The avatar that sent this message is controlled by a human being -- although
|
||||
not necessarily a local human being. */
|
||||
hsBool IsPlayerControlled() const;
|
||||
void SetIsPlayerControlled(hsBool on) { fIsPlayerControlled = on; }
|
||||
hsBool IsInvis() const;
|
||||
void SetInvis(hsBool val) { fIsInvis = val; }
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plArmatureUpdateMsg );
|
||||
GETINTERFACE_ANY( plArmatureUpdateMsg, plAvatarMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
plArmatureMod * fArmature; // the armature that sent this message
|
||||
// valid during the message's lifetime
|
||||
|
||||
protected:
|
||||
// these will probably change to enums + bitmasks .. don't count on the representation
|
||||
hsBool fIsLocal;
|
||||
hsBool fIsPlayerControlled;
|
||||
hsBool fIsInvis; // Avatar is invis. Don't update visable effects.
|
||||
};
|
||||
|
||||
// use this to turn an npc into a player and vice-versa
|
||||
class plAvatarSetTypeMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
plAvatarSetTypeMsg();
|
||||
plAvatarSetTypeMsg(const plKey &sender, const plKey &receiver);
|
||||
|
||||
// theoretically we will someday achieve a broader taxonomy
|
||||
void SetIsPlayer(bool is);
|
||||
bool IsPlayer();
|
||||
|
||||
CLASSNAME_REGISTER(plAvatarSetTypeMsg);
|
||||
GETINTERFACE_ANY(plAvatarSetTypeMsg, plAvatarMsg);
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
private:
|
||||
bool fIsPlayer;
|
||||
};
|
||||
|
||||
/** PLAVTASKMSG
|
||||
An abstract message class for Avatar Tasks -- things which may have multiple steps
|
||||
and which may be conducted over an extended period of time.
|
||||
There is currently no provision for tasks which may be executed in parallel.
|
||||
Activities which are parallelizable are handled by Behaviors
|
||||
*/
|
||||
class plAvTaskMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
// tors
|
||||
plAvTaskMsg();
|
||||
plAvTaskMsg(const plKey &sender, const plKey &receiver);
|
||||
plAvTaskMsg(const plKey &sender, const plKey &receiver, plAvTask *task);
|
||||
|
||||
plAvTask *GetTask();
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvTaskMsg );
|
||||
GETINTERFACE_ANY( plAvTaskMsg, plAvatarMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
private:
|
||||
plAvTask *fTask;
|
||||
};
|
||||
|
||||
/** \Class plAvSeekMsg
|
||||
Tell the avatar to go to a specific location and assume
|
||||
a specific orientation.
|
||||
If smartSeek is true, the avatar will walk to the given spot.
|
||||
otherwise they will float magically through all intervening
|
||||
air and geometry.
|
||||
Duration is only meaningful for the latter case, when the avatar
|
||||
is floating - it determines the speed of float (i.e. reach the
|
||||
particular destination in this amount of time, regardless of distance.)
|
||||
Smartseek is definitely the preferred method; dumb seek is there
|
||||
for when the level geometry hasn't been quite worked out.
|
||||
*/
|
||||
class plAvSeekMsg : public plAvTaskMsg
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kSeekFlagUnForce3rdPersonOnFinish = 0x01,
|
||||
kSeekFlagForce3rdPersonOnStart = 0x02,
|
||||
kSeekFlagNoWarpOnTimeout = 0x04,
|
||||
kSeekFlagRotationOnly = 0x08,
|
||||
};
|
||||
|
||||
// tors
|
||||
plAvSeekMsg();
|
||||
plAvSeekMsg(const plKey& sender, const plKey& receiver, const plKey &seekKey, float duration, hsBool smartSeek,
|
||||
plAvAlignment align = kAlignHandle, char *animName = nil, hsBool noSeek = false,
|
||||
UInt8 flags = kSeekFlagForce3rdPersonOnStart, plKey finishKey = nil);
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvSeekMsg );
|
||||
GETINTERFACE_ANY( plAvSeekMsg, plAvTaskMsg );
|
||||
|
||||
hsBool Force3rdPersonOnStart();
|
||||
hsBool UnForce3rdPersonOnFinish();
|
||||
hsBool NoWarpOnTimeout();
|
||||
hsBool RotationOnly();
|
||||
plKey GetFinishCallbackKey() { return fFinishKey; }
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
// public members
|
||||
plKey fSeekPoint; // the key to the seekpoint we are going to find
|
||||
hsPoint3 fTargetPos; // Or we specify the point/lookat explicitly
|
||||
hsPoint3 fTargetLookAt;
|
||||
float fDuration; // take this much time to do the move (only if smartSeek is false)
|
||||
hsBool fSmartSeek; // seek by walking rather than floating
|
||||
hsBool fNoSeek;
|
||||
char *fAnimName;
|
||||
plAvAlignment fAlignType;
|
||||
UInt8 fFlags;
|
||||
plKey fFinishKey;
|
||||
};
|
||||
|
||||
class plAvTaskSeekDoneMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
hsBool fAborted;
|
||||
|
||||
plAvTaskSeekDoneMsg() : plAvatarMsg(), fAborted(false) {}
|
||||
plAvTaskSeekDoneMsg(const plKey &sender, const plKey &receiver) : plAvatarMsg(sender, receiver), fAborted(false) {}
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvTaskSeekDoneMsg );
|
||||
GETINTERFACE_ANY( plAvTaskSeekDoneMsg, plAvatarMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
};
|
||||
|
||||
class plOneShotCallbacks;
|
||||
|
||||
/** \Class plAvOneShotMsg
|
||||
*/
|
||||
class plAvOneShotMsg : public plAvSeekMsg
|
||||
{
|
||||
public:
|
||||
|
||||
// tors
|
||||
plAvOneShotMsg();
|
||||
virtual ~plAvOneShotMsg();
|
||||
plAvOneShotMsg(const plKey &sender, const plKey& receiver,
|
||||
const plKey& seekKey, float duration, hsBool fSmartSeek,
|
||||
const char *animName, hsBool drivable, hsBool reversible);
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvOneShotMsg );
|
||||
GETINTERFACE_ANY( plAvOneShotMsg, plAvSeekMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
// public members
|
||||
char * fAnimName; // the name of the animation we're going to use
|
||||
hsBool fDrivable; // are we animated by time or by mouse movement?
|
||||
hsBool fReversible; // can we play backwards?
|
||||
plOneShotCallbacks *fCallbacks; // Callbacks given to us by a one-shot modifier
|
||||
// we share it, so release with UnRef
|
||||
};
|
||||
|
||||
////////////////
|
||||
//
|
||||
// PLAVBRAINGENERICMSG
|
||||
//
|
||||
////////////////
|
||||
class plAvBrainGenericMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
|
||||
// have to do members first for recursive definition
|
||||
// don't bother with encapsulation
|
||||
enum Type { kNextStage,
|
||||
kPrevStage,
|
||||
kGotoStage,
|
||||
kSetLoopCount
|
||||
}
|
||||
fType;
|
||||
int fWhichStage; // used only by goto stage
|
||||
hsScalar fTransitionTime; // for crossfade between stages
|
||||
hsBool fSetTime;
|
||||
hsScalar fNewTime;
|
||||
hsBool fSetDirection;
|
||||
hsBool fNewDirection;
|
||||
int fNewLoopCount;
|
||||
// tors
|
||||
plAvBrainGenericMsg();
|
||||
|
||||
//! Older constructor version, allowing simple rewinding only
|
||||
plAvBrainGenericMsg(const plKey& sender, const plKey &receiver,
|
||||
Type type, int stage, hsBool rewind, hsScalar transitionTime);
|
||||
|
||||
/** Canonical constructor, allowing full control over time and direction of new stage.
|
||||
\param sender Message sender
|
||||
\param reciever Message receiver
|
||||
\param type The "verb" for the command - next stage, previous stage, goto stage
|
||||
\param stage The stage we're going to, if this is a goto command
|
||||
\param setTime Do we want to manually set the time on the target stage?
|
||||
\param newTime If setTime is true, this is the TRACKED_NEW (local) time used in the target stage
|
||||
\param setDirection Do we want to set the overall brain direction?
|
||||
\param isForward If setDirection is true, then true = forward, false = backward
|
||||
\param transitionTime Time in seconds to transition between stages.
|
||||
*/
|
||||
plAvBrainGenericMsg(const plKey& sender, const plKey &receiver,
|
||||
Type type, int stage, hsBool setTime, hsScalar newTime,
|
||||
hsBool setDirection, bool isForward, hsScalar transitiontime);
|
||||
|
||||
/** Constructor for setting the loop count in a particular stage.
|
||||
\param sender The sender of this message.
|
||||
\param receiver. The (key to the) avatar brain this message is going to.
|
||||
\param type Must be kSetLoopCount
|
||||
\param stage Which stage are we setting the loop count for?
|
||||
\param newLoopCount The loop count we are setting on the stage
|
||||
*/
|
||||
plAvBrainGenericMsg::plAvBrainGenericMsg(plKey sender, plKey receiver,
|
||||
Type type, int stage, int newLoopCount);
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plAvBrainGenericMsg );
|
||||
GETINTERFACE_ANY( plAvBrainGenericMsg, plAvatarMsg );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
// WriteVersion writes the current version of this creatable and ReadVersion will read in
|
||||
// any previous version.
|
||||
virtual void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
virtual void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
///////////////////
|
||||
//
|
||||
// PLAVPUSHBRAINMSG
|
||||
//
|
||||
///////////////////
|
||||
|
||||
#ifndef SERVER
|
||||
class plAvPushBrainMsg : public plAvTaskMsg
|
||||
{
|
||||
public:
|
||||
// tors
|
||||
plAvPushBrainMsg();
|
||||
plAvPushBrainMsg(const plKey& sender, const plKey &receiver, plArmatureBrain *brain);
|
||||
~plAvPushBrainMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plAvPushBrainMsg );
|
||||
GETINTERFACE_ANY( plAvPushBrainMsg, plAvTaskMsg);
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
plArmatureBrain *fBrain;
|
||||
};
|
||||
|
||||
//////////////////
|
||||
//
|
||||
// PLAVPOPBRAINMSG
|
||||
//
|
||||
//////////////////
|
||||
class plAvPopBrainMsg : public plAvTaskMsg
|
||||
{
|
||||
public:
|
||||
// tors
|
||||
plAvPopBrainMsg();
|
||||
plAvPopBrainMsg(const plKey &sender, const plKey &receiver);
|
||||
|
||||
CLASSNAME_REGISTER( plAvPopBrainMsg );
|
||||
GETINTERFACE_ANY( plAvPopBrainMsg, plAvTaskMsg);
|
||||
};
|
||||
|
||||
#endif // SERVER
|
||||
|
||||
|
||||
// For entering/exiting "stealth mode"
|
||||
class plAvatarStealthModeMsg : public plAvatarMsg
|
||||
{
|
||||
public:
|
||||
plAvatarStealthModeMsg();
|
||||
~plAvatarStealthModeMsg();
|
||||
|
||||
// modes
|
||||
enum
|
||||
{
|
||||
kStealthVisible,
|
||||
kStealthCloaked,
|
||||
kStealthCloakedButSeen,
|
||||
};
|
||||
UInt8 fMode;
|
||||
int fLevel; // you are invisible to other players/CCRs of lower level
|
||||
|
||||
CLASSNAME_REGISTER(plAvatarStealthModeMsg);
|
||||
GETINTERFACE_ANY(plAvatarStealthModeMsg, plAvatarMsg);
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
};
|
||||
|
||||
class plAvatarBehaviorNotifyMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
UInt32 fType;
|
||||
hsBool state;
|
||||
|
||||
plAvatarBehaviorNotifyMsg() : fType(0),state(false) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarBehaviorNotifyMsg );
|
||||
GETINTERFACE_ANY( plAvatarBehaviorNotifyMsg, plMessage );
|
||||
|
||||
// Local Only
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr) {}
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr) {}
|
||||
};
|
||||
|
||||
class plAvatarOpacityCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
public:
|
||||
plAvatarOpacityCallbackMsg() : plEventCallbackMsg() {}
|
||||
plAvatarOpacityCallbackMsg(plKey receiver, CallbackEvent e, int idx=0, hsScalar t=0, Int16 repeats=-1, UInt16 user=0) :
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarOpacityCallbackMsg );
|
||||
GETINTERFACE_ANY( plAvatarOpacityCallbackMsg, plEventCallbackMsg );
|
||||
|
||||
// These aren't meant to go across the net, so no IO necessary.
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
};
|
||||
|
||||
class plAvatarSpawnNotifyMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plArmatureMod *fAvMod;
|
||||
|
||||
plAvatarSpawnNotifyMsg() : fAvMod(nil) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarSpawnNotifyMsg );
|
||||
GETINTERFACE_ANY( plAvatarSpawnNotifyMsg, plMessage );
|
||||
|
||||
// Local Only
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr) {}
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr) {}
|
||||
};
|
||||
|
||||
class plAvatarPhysicsEnableCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
public:
|
||||
plAvatarPhysicsEnableCallbackMsg() : plEventCallbackMsg() {}
|
||||
plAvatarPhysicsEnableCallbackMsg(plKey receiver, CallbackEvent e, int idx=0, hsScalar t=0, Int16 repeats=-1, UInt16 user=0) :
|
||||
plEventCallbackMsg(receiver, e, idx, t, repeats, user) {}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarPhysicsEnableCallbackMsg );
|
||||
GETINTERFACE_ANY( plAvatarPhysicsEnableCallbackMsg, plEventCallbackMsg );
|
||||
|
||||
// These aren't meant to go across the net, so no IO necessary.
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
};
|
||||
|
||||
#endif // plAvatarMsg_inc
|
||||
#endif // ndef NO_AV_MSGS
|
97
Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp
Normal file
97
Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
|
||||
#include "hsStream.h"
|
||||
|
||||
#include "plBulletMsg.h"
|
||||
#include "hsFastMath.h"
|
||||
|
||||
void plBulletMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
IMsgRead(stream, mgr);
|
||||
|
||||
fCmd = Cmd(stream->ReadByte());
|
||||
|
||||
fFrom.Read(stream);
|
||||
fDir.Read(stream);
|
||||
fRange = stream->ReadSwapScalar();
|
||||
fRadius = stream->ReadSwapScalar();
|
||||
fPartyTime = stream->ReadSwapScalar();
|
||||
}
|
||||
|
||||
void plBulletMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
IMsgWrite(stream, mgr);
|
||||
|
||||
stream->WriteByte(UInt8(fCmd));
|
||||
|
||||
fFrom.Write(stream);
|
||||
fDir.Write(stream);
|
||||
stream->WriteSwapScalar(fRange);
|
||||
stream->WriteSwapScalar(fRadius);
|
||||
stream->WriteSwapScalar(fPartyTime);
|
||||
}
|
||||
|
||||
void plBulletMsg::FireShot(const hsPoint3& from, const hsVector3& dir, hsScalar radius, hsScalar range, hsScalar psecs)
|
||||
{
|
||||
fFrom = from;
|
||||
fDir = dir;
|
||||
fRange = range;
|
||||
fRadius = radius;
|
||||
fPartyTime = psecs;
|
||||
|
||||
fCmd = kShot;
|
||||
}
|
||||
|
||||
void plBulletMsg::FireShot(const hsPoint3& from, const hsPoint3& at, hsScalar radius, hsScalar psecs)
|
||||
{
|
||||
hsVector3 dir(&at, &from);
|
||||
hsScalar invLen = hsFastMath::InvSqrt(dir.MagnitudeSquared());
|
||||
hsAssert(invLen > 0, "degenerate from and at to fire bullet");
|
||||
dir *= invLen;
|
||||
hsScalar range = 1.f / invLen;
|
||||
|
||||
FireShot(from, dir, radius, range, psecs);
|
||||
}
|
||||
|
97
Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.h
Normal file
97
Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.h
Normal file
@ -0,0 +1,97 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plBulletMsg_inc
|
||||
#define plBulletMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class plBulletMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum Cmd
|
||||
{
|
||||
kStop,
|
||||
kShot,
|
||||
kSpray
|
||||
};
|
||||
protected:
|
||||
Cmd fCmd;
|
||||
|
||||
hsPoint3 fFrom;
|
||||
hsVector3 fDir;
|
||||
hsScalar fRange;
|
||||
hsScalar fRadius;
|
||||
hsScalar fPartyTime;
|
||||
public:
|
||||
plBulletMsg() { SetBCastFlag(kNetPropagate | kBCastByType, true); }
|
||||
plBulletMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) : plMessage(s, r, t) { SetBCastFlag(kNetPropagate | kBCastByType, true); }
|
||||
|
||||
~plBulletMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plBulletMsg );
|
||||
GETINTERFACE_ANY( plBulletMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
hsBool Shot() const { return fCmd == kShot; }
|
||||
hsBool Spray() const { return fCmd == kSpray; }
|
||||
hsBool Stop() const { return fCmd == kStop; }
|
||||
|
||||
void FireShot(const hsPoint3& from, const hsVector3& dir, hsScalar radius, hsScalar range, hsScalar psecs=-1.f);
|
||||
void FireShot(const hsPoint3& from, const hsPoint3& at, hsScalar radius, hsScalar psecs=-1.f);
|
||||
|
||||
Cmd GetCmd() const { return fCmd; }
|
||||
void SetCmd(Cmd c) { fCmd = c; }
|
||||
|
||||
const hsPoint3& From() const { return fFrom; }
|
||||
const hsVector3& Dir() const { return fDir; }
|
||||
hsScalar Range() const { return fRange; }
|
||||
hsScalar Radius() const { return fRadius; }
|
||||
hsScalar PartyTime() const { return fPartyTime; }
|
||||
};
|
||||
|
||||
#endif // plBulletMsg_inc
|
60
Sources/Plasma/PubUtilLib/plMessage/plCCRMessageCreatable.h
Normal file
60
Sources/Plasma/PubUtilLib/plMessage/plCCRMessageCreatable.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plCCRMessageCreatable_inc
|
||||
#define plCCRMessageCreatable_inc
|
||||
|
||||
//
|
||||
// CCR message creatables
|
||||
// Kept separately for selective server include
|
||||
//
|
||||
|
||||
#include "plCCRMsg.h"
|
||||
REGISTER_NONCREATABLE(plCCRMessage);
|
||||
REGISTER_CREATABLE(plCCRPetitionMsg);
|
||||
REGISTER_CREATABLE(plCCRInvisibleMsg);
|
||||
REGISTER_CREATABLE(plCCRCommunicationMsg);
|
||||
REGISTER_CREATABLE(plCCRBanLinkingMsg);
|
||||
REGISTER_CREATABLE(plCCRSilencePlayerMsg);
|
||||
|
||||
#endif // plCCRMessageCreatable_inc
|
||||
|
||||
|
151
Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp
Normal file
151
Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp
Normal file
@ -0,0 +1,151 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsStream.h"
|
||||
#include "plCCRMsg.h"
|
||||
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
#include "../plResMgr/plResManager.h"
|
||||
#include "../plNetCommon/plNetCommon.h"
|
||||
|
||||
void plCCRPetitionMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
plMsgStdStringHelper::Peek(fNote, stream);
|
||||
plMsgStdStringHelper::Peek(fTitle, stream);
|
||||
stream->ReadSwap(&fPetitionType);
|
||||
}
|
||||
|
||||
void plCCRPetitionMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
plMsgStdStringHelper::Poke(fNote, stream);
|
||||
plMsgStdStringHelper::Poke(fTitle, stream);
|
||||
stream->WriteSwap(fPetitionType);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
plCCRInvisibleMsg::plCCRInvisibleMsg() : fInvisLevel(0)
|
||||
{
|
||||
// send only to remote NetClientMgrs
|
||||
SetBCastFlag(kNetPropagate, true);
|
||||
SetBCastFlag(kLocalPropagate, false);
|
||||
AddReceiver(plNetApp::GetInstance()->GetKey());
|
||||
}
|
||||
|
||||
void plCCRInvisibleMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fAvKey=mgr->ReadKey(stream);
|
||||
fInvisLevel = stream->ReadByte();
|
||||
}
|
||||
|
||||
void plCCRInvisibleMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
mgr->WriteKey(stream, fAvKey);
|
||||
stream->WriteByte(fInvisLevel);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
plCCRCommunicationMsg::plCCRCommunicationMsg() : fType(kUnInit), fCCRPlayerID(kInvalidPlayerID)
|
||||
{
|
||||
SetBCastFlag(kBCastByType);
|
||||
}
|
||||
|
||||
void plCCRCommunicationMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
plMsgStdStringHelper::Peek(fString, stream);
|
||||
fType = (Type)stream->ReadSwap32();
|
||||
stream->ReadSwap(&fCCRPlayerID);
|
||||
}
|
||||
|
||||
void plCCRCommunicationMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
plMsgStdStringHelper::Poke(fString, stream);
|
||||
stream->WriteSwap32((int)fType);
|
||||
stream->WriteSwap(fCCRPlayerID);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
plCCRBanLinkingMsg::plCCRBanLinkingMsg() : fBan(true)
|
||||
{
|
||||
AddReceiver(plNetApp::GetInstance()->GetKey());
|
||||
}
|
||||
|
||||
void plCCRBanLinkingMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fBan = stream->ReadBool();
|
||||
}
|
||||
|
||||
void plCCRBanLinkingMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteBool(fBan);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
plCCRSilencePlayerMsg::plCCRSilencePlayerMsg() : fSilence(true)
|
||||
{
|
||||
AddReceiver(plNetApp::GetInstance()->GetKey());
|
||||
}
|
||||
|
||||
void plCCRSilencePlayerMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fSilence = stream->ReadBool();
|
||||
}
|
||||
|
||||
void plCCRSilencePlayerMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteBool(fSilence);
|
||||
}
|
186
Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.h
Normal file
186
Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.h
Normal file
@ -0,0 +1,186 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plCCRMsg_h
|
||||
#define plCCRMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plNetCommon/plNetCommon.h"
|
||||
|
||||
//
|
||||
// Abstract Baseclass for CCR messages.
|
||||
// All CCR messages must derive from this or the server won't be able to tell that's what they are.
|
||||
//
|
||||
class plCCRMessage : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plCCRMessage);
|
||||
GETINTERFACE_ANY( plCCRMessage, plMessage );
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Player wants to petition a CCR
|
||||
//
|
||||
class plCCRPetitionMsg : public plCCRMessage
|
||||
{
|
||||
private:
|
||||
UInt8 fPetitionType;
|
||||
std::string fNote;
|
||||
std::string fTitle;
|
||||
public:
|
||||
plCCRPetitionMsg() : fPetitionType(plNetCommon::PetitionTypes::kGeneralHelp) { fBCastFlags |= kBCastByType; }
|
||||
~plCCRPetitionMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCCRPetitionMsg);
|
||||
GETINTERFACE_ANY( plCCRPetitionMsg, plCCRMessage );
|
||||
|
||||
// petition text
|
||||
void SetNote(const char* n) { fNote=n; }
|
||||
const char* GetNote() const { return fNote.c_str(); }
|
||||
|
||||
// title
|
||||
void SetTitle(const char* n) { fTitle=n; }
|
||||
const char* GetTitle() const { return fTitle.c_str(); }
|
||||
|
||||
// petition type
|
||||
void SetType(const UInt8 t) { fPetitionType=t; }
|
||||
UInt8 GetType() const { return fPetitionType; }
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
//
|
||||
// A CCR has gone invisible
|
||||
//
|
||||
class plCCRInvisibleMsg : public plCCRMessage
|
||||
{
|
||||
public:
|
||||
plKey fAvKey;
|
||||
UInt8 fInvisLevel; // 0 means visible
|
||||
|
||||
plCCRInvisibleMsg();
|
||||
~plCCRInvisibleMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCCRInvisibleMsg);
|
||||
GETINTERFACE_ANY( plCCRInvisibleMsg, plCCRMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
//
|
||||
// For CCR-player communication
|
||||
//
|
||||
class plCCRCommunicationMsg : public plCCRMessage
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
kUnInit = 0,
|
||||
kBeginCommunication,
|
||||
kChat,
|
||||
kEndCommunication,
|
||||
kReturnChatMsg
|
||||
};
|
||||
std::string fString;
|
||||
Type fType;
|
||||
UInt32 fCCRPlayerID;
|
||||
|
||||
plCCRCommunicationMsg();
|
||||
~plCCRCommunicationMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCCRCommunicationMsg);
|
||||
GETINTERFACE_ANY( plCCRCommunicationMsg, plCCRMessage );
|
||||
|
||||
// getters and setters
|
||||
void SetMessage(const char* n) { fString=n; }
|
||||
const char* GetMessage() const { return fString.c_str(); }
|
||||
|
||||
void SetType(Type t) { fType=t; }
|
||||
Type GetType() const { return fType; }
|
||||
|
||||
void SetCCRPlayerID(UInt32 t) { fCCRPlayerID=t; }
|
||||
UInt32 GetCCRPlayerID() const { return fCCRPlayerID; }
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
//
|
||||
// A CCR has banned a player from leaving the age
|
||||
//
|
||||
class plCCRBanLinkingMsg : public plCCRMessage
|
||||
{
|
||||
public:
|
||||
hsBool fBan; // ban or un ban
|
||||
|
||||
plCCRBanLinkingMsg() ;
|
||||
~plCCRBanLinkingMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCCRBanLinkingMsg);
|
||||
GETINTERFACE_ANY( plCCRBanLinkingMsg, plCCRMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
//
|
||||
// A CCR has silenced a player
|
||||
//
|
||||
class plCCRSilencePlayerMsg : public plCCRMessage
|
||||
{
|
||||
public:
|
||||
hsBool fSilence; // ban or un ban
|
||||
|
||||
plCCRSilencePlayerMsg() ;
|
||||
~plCCRSilencePlayerMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCCRSilencePlayerMsg);
|
||||
GETINTERFACE_ANY( plCCRSilencePlayerMsg, plCCRMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
#endif // plCCRMsg_h
|
||||
|
50
Sources/Plasma/PubUtilLib/plMessage/plCaptureRenderMsg.cpp
Normal file
50
Sources/Plasma/PubUtilLib/plMessage/plCaptureRenderMsg.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plCaptureRenderMsg.h"
|
||||
#include "../plGImage/plMipmap.h"
|
||||
|
||||
plCaptureRenderMsg::~plCaptureRenderMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fMipmap);
|
||||
}
|
71
Sources/Plasma/PubUtilLib/plMessage/plCaptureRenderMsg.h
Normal file
71
Sources/Plasma/PubUtilLib/plMessage/plCaptureRenderMsg.h
Normal file
@ -0,0 +1,71 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plCaptureRenderMsg_inc
|
||||
#define plCaptureRenderMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plMipmap;
|
||||
|
||||
class plCaptureRenderMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plCaptureRenderMsg() : plMessage(), fMipmap(nil) {}
|
||||
plCaptureRenderMsg(const plKey &r, plMipmap* mipmap) : plMessage(nil, r, nil), fMipmap(mipmap) {}
|
||||
|
||||
virtual ~plCaptureRenderMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plCaptureRenderMsg );
|
||||
GETINTERFACE_ANY( plCaptureRenderMsg, plMessage );
|
||||
|
||||
// Mipmap will be unref'd on destruction of message. If you plan to
|
||||
// hang onto it, you need to ref it when you receive this message.
|
||||
// You can either use hsRefCnt or use the ResMgr to give it a new key.
|
||||
plMipmap* GetMipmap() const { return fMipmap; }
|
||||
plMipmap* fMipmap;
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr) { hsAssert(false, "Transient message"); }
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr) { hsAssert(false, "Transient message"); }
|
||||
};
|
||||
|
||||
#endif // plCaptureRenderMsg_inc
|
60
Sources/Plasma/PubUtilLib/plMessage/plClimbEventMsg.h
Normal file
60
Sources/Plasma/PubUtilLib/plMessage/plClimbEventMsg.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plClimbEventMsg_h_inc
|
||||
#define plClimbEventMsg_h_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
|
||||
|
||||
class plClimbEventMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plClimbEventMsg(){;}
|
||||
virtual ~plClimbEventMsg(){;}
|
||||
CLASSNAME_REGISTER(plClimbEventMsg);
|
||||
GETINTERFACE_ANY(plClimbEventMsg, plMessage);
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr){plMessage::IMsgRead(stream,mgr);}
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr){plMessage::IMsgWrite(stream,mgr);}
|
||||
};
|
||||
|
||||
#endif // plClimbEventMsg_h_inc
|
84
Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp
Normal file
84
Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp
Normal file
@ -0,0 +1,84 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
// singular
|
||||
#include "plClimbMsg.h"
|
||||
|
||||
// global
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plClimbMsg::plClimbMsg()
|
||||
: fCommand(kNoCommand),
|
||||
fDirection(plClimbMsg::kCenter),
|
||||
fStatus(false),
|
||||
fTarget(nil)
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
||||
plClimbMsg::plClimbMsg(const plKey &sender, const plKey &receiver, Command command, Direction direction, hsBool status, plKey target)
|
||||
: plMessage(sender, receiver, nil),
|
||||
fCommand(command), fDirection(direction),
|
||||
fStatus(status),
|
||||
fTarget(target)
|
||||
{
|
||||
// not here
|
||||
}
|
||||
|
||||
void plClimbMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fCommand = static_cast<Command>(stream->ReadSwap32());
|
||||
fDirection = static_cast<Direction>(stream->ReadSwap32());
|
||||
fStatus = stream->ReadBool();
|
||||
fTarget = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void plClimbMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwap32(static_cast<UInt32>(fCommand));
|
||||
stream->WriteSwap32(static_cast<UInt32>(fDirection));
|
||||
stream->WriteBool(fStatus);
|
||||
mgr->WriteKey(stream, fTarget);
|
||||
}
|
91
Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.h
Normal file
91
Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.h
Normal file
@ -0,0 +1,91 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plClimbMsg_h
|
||||
#define plClimbMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
/** \class plClimbMsg
|
||||
Things you can say with a climb message:
|
||||
"mount the climbing wall with an upward/downward/leftward/rightward mount"
|
||||
"dis-/enable climbing in the up/down/left/right direction"
|
||||
"dis-/enable dismounting in the up/down/left/right direction"
|
||||
*/
|
||||
class plClimbMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum Direction {
|
||||
kUp = 0x01,
|
||||
kDown = 0x02,
|
||||
kLeft = 0x04,
|
||||
kRight = 0x08,
|
||||
kCenter = 0x10
|
||||
};
|
||||
|
||||
enum Command {
|
||||
kNoCommand = 0x0,
|
||||
kEnableClimb = 0x1,
|
||||
kEnableDismount = 0x2,
|
||||
kFallOff = 0x4,
|
||||
kRelease = 0x8,
|
||||
kStartClimbing = 0x8
|
||||
};
|
||||
|
||||
// tors
|
||||
plClimbMsg();
|
||||
plClimbMsg(const plKey &sender, const plKey &receiver, Command command = kNoCommand, Direction direction = kCenter, hsBool status = false, plKey target = nil);
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plClimbMsg );
|
||||
GETINTERFACE_ANY( plClimbMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
Command fCommand;
|
||||
Direction fDirection;
|
||||
hsBool fStatus;
|
||||
plKey fTarget; // used for seeking to mount points
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
41
Sources/Plasma/PubUtilLib/plMessage/plCollideMsg.cpp
Normal file
41
Sources/Plasma/PubUtilLib/plMessage/plCollideMsg.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
66
Sources/Plasma/PubUtilLib/plMessage/plCollideMsg.h
Normal file
66
Sources/Plasma/PubUtilLib/plMessage/plCollideMsg.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef PLCOLLIDEMSG_INC
|
||||
#define PLCOLLIDEMSG_INC
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plCollideMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
public:
|
||||
plKey fOtherKey;
|
||||
hsBool fEntering; // otherwise it's leaving
|
||||
|
||||
plCollideMsg() { SetBCastFlag(plMessage::kPropagateToModifiers); }
|
||||
~plCollideMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plCollideMsg );
|
||||
GETINTERFACE_ANY( plCollideMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
#endif // PLCOLLIDEMSG_INC
|
79
Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h
Normal file
79
Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h
Normal file
@ -0,0 +1,79 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plCondRefMsg_inc
|
||||
#define plCondRefMsg_inc
|
||||
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
class hsResMgr;
|
||||
|
||||
class plCondRefMsg : public plRefMsg
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
plCondRefMsg() { fWhich = -1; }
|
||||
plCondRefMsg::plCondRefMsg(const plKey &s, int which)
|
||||
: plRefMsg(s, plRefMsg::kOnCreate), fWhich(which) {}
|
||||
|
||||
CLASSNAME_REGISTER( plCondRefMsg );
|
||||
GETINTERFACE_ANY( plCondRefMsg, plRefMsg );
|
||||
|
||||
Int8 fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fWhich);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fWhich);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plCondRefMsg_inc
|
65
Sources/Plasma/PubUtilLib/plMessage/plConnectedToVaultMsg.h
Normal file
65
Sources/Plasma/PubUtilLib/plMessage/plConnectedToVaultMsg.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plConnectedToVaultMsg_INC
|
||||
#define plConnectedToVaultMsg_INC
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
//
|
||||
// A msg sent locally (once) when the client has successfully connected to the vault.
|
||||
//
|
||||
class hsResMgr;
|
||||
class hsStream;
|
||||
class plConnectedToVaultMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plConnectedToVaultMsg );
|
||||
GETINTERFACE_ANY( plConnectedToVaultMsg, plMessage );
|
||||
|
||||
plConnectedToVaultMsg() { SetBCastFlag(kBCastByType); }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
#endif // plConnectedToVaultMsg
|
101
Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h
Normal file
101
Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h
Normal file
@ -0,0 +1,101 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
////// TEMP HACK TO GET CONSOLE INIT EXECUTION ON AGE LOAD WORKING
|
||||
|
||||
#ifndef plConsoleMsg_inc
|
||||
#define plConsoleMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plEventCallbackMsg;
|
||||
|
||||
class plConsoleMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
UInt32 fCmd;
|
||||
char *fString;
|
||||
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
kExecuteFile,
|
||||
kAddLine,
|
||||
kExecuteLine
|
||||
};
|
||||
|
||||
plConsoleMsg() : plMessage(nil, nil, nil), fCmd( 0 ), fString( nil ) { SetBCastFlag(kBCastByExactType); }
|
||||
plConsoleMsg( UInt32 cmd, const char *str ) :
|
||||
plMessage(nil, nil, nil), fCmd( cmd ), fString(hsStrcpy(str))
|
||||
{ SetBCastFlag( kBCastByExactType ); }
|
||||
|
||||
~plConsoleMsg() { FREE(fString); }
|
||||
|
||||
CLASSNAME_REGISTER( plConsoleMsg );
|
||||
GETINTERFACE_ANY( plConsoleMsg, plMessage );
|
||||
|
||||
UInt32 GetCmd( void ) const { return fCmd; }
|
||||
const char *GetString( void ) const { return fString; };
|
||||
|
||||
void SetCmd (UInt32 cmd) { fCmd = cmd; }
|
||||
void SetString (const char str[]) { FREE(fString); fString = hsStrcpy(str); }
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
s->ReadSwap(&fCmd);
|
||||
// read string
|
||||
plMsgCStringHelper::Peek(fString, s);
|
||||
}
|
||||
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
s->WriteSwap(fCmd);
|
||||
// write cmd/string
|
||||
plMsgCStringHelper::Poke(fString, s);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plConsole_inc
|
79
Sources/Plasma/PubUtilLib/plMessage/plDeviceRecreateMsg.h
Normal file
79
Sources/Plasma/PubUtilLib/plMessage/plDeviceRecreateMsg.h
Normal file
@ -0,0 +1,79 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plDeviceRecreateMsg Header //
|
||||
// Tiny message to let sceneNodes know that they need to clean up. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _plDeviceRecreateMsg_h
|
||||
#define _plDeviceRecreateMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plPipeline;
|
||||
|
||||
class plDeviceRecreateMsg : public plMessage
|
||||
{
|
||||
plPipeline* fPipe;
|
||||
|
||||
public:
|
||||
plDeviceRecreateMsg(plPipeline* pipe=nil)
|
||||
: plMessage(nil, nil, nil), fPipe(pipe)
|
||||
{
|
||||
SetBCastFlag(kBCastByExactType);
|
||||
}
|
||||
|
||||
~plDeviceRecreateMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plDeviceRecreateMsg );
|
||||
GETINTERFACE_ANY( plDeviceRecreateMsg, plMessage );
|
||||
|
||||
plPipeline* Pipeline() const { return fPipe; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); }
|
||||
};
|
||||
|
||||
#endif // _plDeviceRecreateMsg_h
|
101
Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp
Normal file
101
Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp
Normal file
@ -0,0 +1,101 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plDynaDecalEnableMsg.h"
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plDynaDecalEnableMsg::plDynaDecalEnableMsg()
|
||||
: plMessage(nil, nil, nil),
|
||||
fKey(nil),
|
||||
fFlags(0),
|
||||
fConTime(0),
|
||||
fID(UInt32(-1))
|
||||
{
|
||||
}
|
||||
|
||||
plDynaDecalEnableMsg::plDynaDecalEnableMsg(const plKey& r, const plKey& a, double t, hsScalar w, hsBool end, UInt32 id, hsBool isArm)
|
||||
: plMessage(nil, r, nil),
|
||||
fKey(a),
|
||||
fFlags(0),
|
||||
fConTime(t),
|
||||
fWetLength(w),
|
||||
fID(id)
|
||||
{
|
||||
if( end )
|
||||
fFlags |= kAtEnd;
|
||||
if( isArm )
|
||||
fFlags |= kArmature;
|
||||
}
|
||||
|
||||
plDynaDecalEnableMsg::~plDynaDecalEnableMsg()
|
||||
{
|
||||
}
|
||||
|
||||
void plDynaDecalEnableMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
IMsgRead(stream, mgr);
|
||||
|
||||
fKey = mgr->ReadKey(stream);
|
||||
|
||||
fConTime = stream->ReadSwapDouble();
|
||||
|
||||
fFlags = stream->ReadSwap32();
|
||||
|
||||
fID = stream->ReadSwap32();
|
||||
}
|
||||
|
||||
void plDynaDecalEnableMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
IMsgWrite(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fKey);
|
||||
|
||||
stream->WriteSwapDouble(fConTime);
|
||||
|
||||
stream->WriteSwap32(fFlags);
|
||||
|
||||
stream->WriteSwap32(fID);
|
||||
}
|
||||
|
98
Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.h
Normal file
98
Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.h
Normal file
@ -0,0 +1,98 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plDynaDecalEnableMsg_inc
|
||||
#define plDynaDecalEnableMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plDynaDecalEnableMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
enum {
|
||||
kAtEnd = 0x1,
|
||||
kArmature = 0x2
|
||||
};
|
||||
plKey fKey;
|
||||
double fConTime;
|
||||
hsScalar fWetLength;
|
||||
UInt32 fFlags;
|
||||
UInt32 fID;
|
||||
public:
|
||||
plDynaDecalEnableMsg();
|
||||
plDynaDecalEnableMsg(const plKey& r, const plKey& armOrShapeKey, double conTime, hsScalar wetLength, hsBool end, UInt32 id=UInt32(-1), hsBool isArm=true);
|
||||
~plDynaDecalEnableMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plDynaDecalEnableMsg );
|
||||
GETINTERFACE_ANY( plDynaDecalEnableMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
// ArmKey undefined unless kArmature flag is set. You have to check.
|
||||
const plKey& GetArmKey() const { return fKey; }
|
||||
void SetArmKey(const plKey& k) { fKey = k; SetArmature(true); }
|
||||
|
||||
hsBool IsArmature() const { return 0 != (fFlags & kArmature); }
|
||||
void SetArmature(hsBool b) { if(b)fFlags |= kArmature; else fFlags &= ~kArmature; }
|
||||
|
||||
const plKey& GetShapeKey() const { return fKey; }
|
||||
void SetShapeKey(const plKey& k) { fKey = k; SetArmature(false); }
|
||||
|
||||
double GetContactTime() const { return fConTime; }
|
||||
void SetContactTime(double t) { fConTime = t; }
|
||||
|
||||
hsScalar GetWetLength() const { return fWetLength; }
|
||||
void SetWetLength(hsScalar w) { fWetLength = w; }
|
||||
|
||||
hsBool AtEnd() const { return 0 != (fFlags & kAtEnd); }
|
||||
void SetAtEnd(hsBool b) { if(b)fFlags |= kAtEnd; else fFlags &= ~kAtEnd; }
|
||||
|
||||
UInt32 GetID() const { return fID; }
|
||||
void SetID(UInt32 n) { fID = n; }
|
||||
};
|
||||
|
||||
#endif // plDynaDecalEnableMsg_inc
|
73
Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp
Normal file
73
Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "plDynamicEnvMapMsg.h"
|
||||
|
||||
#include "hsStream.h"
|
||||
|
||||
void plDynamicEnvMapMsg::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
|
||||
fCmd = s->ReadSwap32();
|
||||
|
||||
fPos.Read(s);
|
||||
fHither = s->ReadSwapScalar();
|
||||
fYon = s->ReadSwapScalar();
|
||||
fFogStart = s->ReadSwapScalar();
|
||||
fColor.Read(s);
|
||||
fRefresh = s->ReadSwapScalar();
|
||||
}
|
||||
|
||||
void plDynamicEnvMapMsg::Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
|
||||
s->WriteSwap32(fCmd);
|
||||
|
||||
fPos.Write(s);
|
||||
s->WriteSwapScalar(fHither);
|
||||
s->WriteSwapScalar(fYon);
|
||||
s->WriteSwapScalar(fFogStart);
|
||||
fColor.Write(s);
|
||||
s->WriteSwapScalar(fRefresh);
|
||||
}
|
88
Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.h
Normal file
88
Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plDynamicEnvMapMsg_inc
|
||||
#define plDynamicEnvMapMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
#include "hsGeometry3.h"
|
||||
#include "hsColorRGBA.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plDynamicEnvMapMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
kReRender = 0x1,
|
||||
kSetPosition = 0x2,
|
||||
kSetHither = 0x4,
|
||||
kSetYon = 0x8,
|
||||
kSetColor = 0x10,
|
||||
kSetFogStart = 0x20,
|
||||
kSetRefresh = 0x40
|
||||
};
|
||||
|
||||
UInt32 fCmd;
|
||||
|
||||
hsPoint3 fPos;
|
||||
hsScalar fHither;
|
||||
hsScalar fYon;
|
||||
hsScalar fFogStart;
|
||||
hsColorRGBA fColor;
|
||||
hsScalar fRefresh;
|
||||
|
||||
public:
|
||||
plDynamicEnvMapMsg() : plMessage(nil, nil, nil), fCmd(0) {}
|
||||
plDynamicEnvMapMsg(const plKey& rcv) : plMessage(nil, rcv, nil), fCmd(0) {}
|
||||
virtual ~plDynamicEnvMapMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plDynamicEnvMapMsg );
|
||||
GETINTERFACE_ANY( plDynamicEnvMapMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
#endif // plDynamicEnvMapMsg_inc
|
376
Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp
Normal file
376
Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp
Normal file
@ -0,0 +1,376 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plDynamicTextMsg //
|
||||
// Message wrapper for commands to plDynamicTextMap. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plDynamicTextMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
void plDynamicTextMsg::SetTextColor( hsColorRGBA &c, hsBool blockRGB )
|
||||
{
|
||||
hsAssert( ( fCmd & kColorCmds ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~kColorCmds;
|
||||
fCmd |= kSetTextColor;
|
||||
fColor = c;
|
||||
fBlockRGB = blockRGB;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::SetFont( const char *face, Int16 size, hsBool isBold )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kPosCmds | kStringCmds | kFlagCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kPosCmds | kStringCmds | kFlagCmds );
|
||||
fCmd |= kSetFont;
|
||||
fString = hsStringToWString( face );
|
||||
fX = size;
|
||||
fFlags = (UInt32)isBold;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::SetLineSpacing( Int16 spacing )
|
||||
{
|
||||
fCmd |= kSetLineSpacing;
|
||||
fLineSpacing = spacing;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::SetJustify( UInt8 justifyFlags )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kFlagCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kFlagCmds );
|
||||
fCmd |= kSetJustify;
|
||||
fFlags = (UInt32)justifyFlags;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::FillRect( UInt16 left, UInt16 top, UInt16 right, UInt16 bottom, hsColorRGBA &c )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kRectCmds | kColorCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kRectCmds | kColorCmds );
|
||||
fCmd |= kFillRect;
|
||||
|
||||
fLeft = left;
|
||||
fTop = top;
|
||||
fRight = right;
|
||||
fBottom = bottom;
|
||||
fColor = c;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::FrameRect( UInt16 left, UInt16 top, UInt16 right, UInt16 bottom, hsColorRGBA &c )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kRectCmds | kColorCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kRectCmds | kColorCmds );
|
||||
fCmd |= kFrameRect;
|
||||
|
||||
fLeft = left;
|
||||
fTop = top;
|
||||
fRight = right;
|
||||
fBottom = bottom;
|
||||
fColor = c;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawString( Int16 x, Int16 y, const char *text )
|
||||
{
|
||||
wchar_t *wString = hsStringToWString(text);
|
||||
DrawString(x,y,wString);
|
||||
delete [] wString;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawString( Int16 x, Int16 y, const wchar_t *text )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kStringCmds | kPosCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kStringCmds | kPosCmds );
|
||||
fCmd |= kDrawString;
|
||||
|
||||
fString = TRACKED_NEW wchar_t[wcslen(text)+1];
|
||||
wcscpy( fString, text );
|
||||
fString[wcslen(text)] = L'\0';
|
||||
fX = x;
|
||||
fY = y;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawClippedString( Int16 x, Int16 y, UInt16 clipLeft, UInt16 clipTop, UInt16 clipRight, UInt16 clipBottom, const char *text )
|
||||
{
|
||||
wchar_t *wString = hsStringToWString(text);
|
||||
DrawClippedString(x,y,clipLeft,clipTop,clipRight,clipBottom,wString);
|
||||
delete [] wString;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawClippedString( Int16 x, Int16 y, UInt16 clipLeft, UInt16 clipTop, UInt16 clipRight, UInt16 clipBottom, const wchar_t *text )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kStringCmds | kPosCmds | kRectCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds );
|
||||
fCmd |= kDrawClippedString;
|
||||
|
||||
fString = TRACKED_NEW wchar_t[wcslen(text)+1];
|
||||
wcscpy( fString, text );
|
||||
fString[wcslen(text)] = L'\0';
|
||||
fX = x;
|
||||
fY = y;
|
||||
|
||||
fLeft = clipLeft;
|
||||
fTop = clipTop;
|
||||
fRight = clipRight;
|
||||
fBottom = clipBottom;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawWrappedString( Int16 x, Int16 y, UInt16 wrapWidth, UInt16 wrapHeight, const char *text )
|
||||
{
|
||||
wchar_t *wString = hsStringToWString(text);
|
||||
DrawWrappedString(x,y,wrapWidth,wrapHeight,wString);
|
||||
delete [] wString;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawWrappedString( Int16 x, Int16 y, UInt16 wrapWidth, UInt16 wrapHeight, const wchar_t *text )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kStringCmds | kPosCmds | kRectCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kStringCmds | kPosCmds | kRectCmds );
|
||||
fCmd |= kDrawWrappedString;
|
||||
|
||||
fString = TRACKED_NEW wchar_t[wcslen(text)+1];
|
||||
wcscpy( fString, text );
|
||||
fString[wcslen(text)] = L'\0';
|
||||
fX = x;
|
||||
fY = y;
|
||||
|
||||
fRight = wrapWidth;
|
||||
fBottom = wrapHeight;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawImage( Int16 x, Int16 y, plKey &image, hsBool respectAlpha )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kPosCmds | kFlagCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kPosCmds | kFlagCmds );
|
||||
fCmd |= kDrawImage;
|
||||
|
||||
fImageKey = image;
|
||||
fX = x;
|
||||
fY = y;
|
||||
fFlags = (UInt32)respectAlpha;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::DrawClippedImage( Int16 x, Int16 y, plKey &image, UInt16 clipX, UInt16 clipY, UInt16 clipWidth, UInt16 clipHeight, hsBool respectAlpha )
|
||||
{
|
||||
hsAssert( ( fCmd & ( kPosCmds | kFlagCmds | kRectCmds ) ) == 0, "Attempting to issue conflicting drawText commands" );
|
||||
fCmd &= ~( kPosCmds | kFlagCmds | kRectCmds );
|
||||
fCmd |= kDrawClippedImage;
|
||||
|
||||
fImageKey = image;
|
||||
fX = x;
|
||||
fY = y;
|
||||
fLeft = clipX;
|
||||
fTop = clipY;
|
||||
fRight = clipWidth;
|
||||
fBottom = clipHeight;
|
||||
fFlags = (UInt32)respectAlpha;
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::Read( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
plMessage::IMsgRead( s, mgr );
|
||||
|
||||
s->ReadSwap( &fCmd );
|
||||
s->ReadSwap( &fX );
|
||||
s->ReadSwap( &fY );
|
||||
|
||||
s->ReadSwap( &fLeft );
|
||||
s->ReadSwap( &fTop );
|
||||
s->ReadSwap( &fRight );
|
||||
s->ReadSwap( &fBottom );
|
||||
|
||||
fClearColor.Read( s );
|
||||
fColor.Read( s );
|
||||
|
||||
fString = s->ReadSafeWString();
|
||||
fImageKey = mgr->ReadKey( s );
|
||||
|
||||
s->ReadSwap( &fFlags );
|
||||
|
||||
s->ReadSwap( &fBlockRGB );
|
||||
s->ReadSwap( &fLineSpacing );
|
||||
}
|
||||
void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
plMessage::IMsgWrite( s, mgr );
|
||||
|
||||
#ifdef HS_DEBUGGING
|
||||
if (fCmd & (kDrawImage | kDrawClippedImage))
|
||||
{
|
||||
hsAssert(fImageKey != nil, "plDynamicTextMsg::Write: Must set imageKey for draw operation");
|
||||
}
|
||||
#endif
|
||||
|
||||
s->WriteSwap( fCmd );
|
||||
s->WriteSwap( fX );
|
||||
s->WriteSwap( fY );
|
||||
|
||||
s->WriteSwap( fLeft );
|
||||
s->WriteSwap( fTop );
|
||||
s->WriteSwap( fRight );
|
||||
s->WriteSwap( fBottom );
|
||||
|
||||
fClearColor.Write( s );
|
||||
fColor.Write( s );
|
||||
|
||||
s->WriteSafeWString( fString );
|
||||
mgr->WriteKey( s, fImageKey );
|
||||
|
||||
s->WriteSwap( fFlags );
|
||||
|
||||
s->WriteSwap( fBlockRGB );
|
||||
s->WriteSwap( fLineSpacing );
|
||||
}
|
||||
|
||||
enum DynamicTextMsgFlags
|
||||
{
|
||||
kDynTextMsgCmd,
|
||||
kDynTextMsgX,
|
||||
kDynTextMsgY,
|
||||
kDynTextMsgLeft,
|
||||
kDynTextMsgTop,
|
||||
kDynTextMsgRight,
|
||||
kDynTextMsgBottom,
|
||||
kDynTextMsgClearColor,
|
||||
kDynTextMsgColor,
|
||||
kDynTextMsgString,
|
||||
kDynTextMsgImageKey,
|
||||
kDynTextMsgFlags,
|
||||
kDynTextMsgBlockRGB,
|
||||
kDynTextMsgLineSpacing,
|
||||
};
|
||||
|
||||
void plDynamicTextMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kDynTextMsgCmd))
|
||||
s->ReadSwap( &fCmd );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgX))
|
||||
s->ReadSwap( &fX );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgY))
|
||||
s->ReadSwap( &fY );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgLeft))
|
||||
s->ReadSwap( &fLeft );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgTop))
|
||||
s->ReadSwap( &fTop );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgRight))
|
||||
s->ReadSwap( &fRight );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgBottom))
|
||||
s->ReadSwap( &fBottom );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgClearColor))
|
||||
fClearColor.Read( s );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgColor))
|
||||
fColor.Read( s );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgString))
|
||||
fString = s->ReadSafeWString();
|
||||
if (contentFlags.IsBitSet(kDynTextMsgImageKey))
|
||||
fImageKey = mgr->ReadKey( s );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgFlags))
|
||||
s->ReadSwap( &fFlags );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgBlockRGB))
|
||||
s->ReadSwap( &fBlockRGB );
|
||||
if (contentFlags.IsBitSet(kDynTextMsgLineSpacing))
|
||||
s->ReadSwap( &fLineSpacing );
|
||||
}
|
||||
|
||||
void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kDynTextMsgCmd);
|
||||
contentFlags.SetBit(kDynTextMsgX);
|
||||
contentFlags.SetBit(kDynTextMsgY);
|
||||
contentFlags.SetBit(kDynTextMsgLeft);
|
||||
contentFlags.SetBit(kDynTextMsgTop);
|
||||
contentFlags.SetBit(kDynTextMsgRight);
|
||||
contentFlags.SetBit(kDynTextMsgBottom);
|
||||
contentFlags.SetBit(kDynTextMsgClearColor);
|
||||
contentFlags.SetBit(kDynTextMsgColor);
|
||||
contentFlags.SetBit(kDynTextMsgString);
|
||||
contentFlags.SetBit(kDynTextMsgImageKey);
|
||||
contentFlags.SetBit(kDynTextMsgFlags);
|
||||
contentFlags.SetBit(kDynTextMsgBlockRGB);
|
||||
contentFlags.SetBit(kDynTextMsgLineSpacing);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kDynTextMsgCmd
|
||||
s->WriteSwap( fCmd );
|
||||
// kDynTextMsgX
|
||||
s->WriteSwap( fX );
|
||||
// kDynTextMsgY
|
||||
s->WriteSwap( fY );
|
||||
|
||||
// kDynTextMsgLeft
|
||||
s->WriteSwap( fLeft );
|
||||
// kDynTextMsgTop
|
||||
s->WriteSwap( fTop );
|
||||
// kDynTextMsgRight
|
||||
s->WriteSwap( fRight );
|
||||
// kDynTextMsgBottom
|
||||
s->WriteSwap( fBottom );
|
||||
|
||||
// kDynTextMsgClearColor
|
||||
fClearColor.Write( s );
|
||||
// kDynTextMsgColor
|
||||
fColor.Write( s );
|
||||
|
||||
// kDynTextMsgString
|
||||
s->WriteSafeWString( fString );
|
||||
// kDynTextMsgImageKey
|
||||
mgr->WriteKey( s, fImageKey );
|
||||
|
||||
// kDynTextMsgFlags
|
||||
s->WriteSwap( fFlags );
|
||||
|
||||
// kDynTextMsgBlockRGB
|
||||
s->WriteSwap( fBlockRGB );
|
||||
// kDynTextMsgLineSpacing
|
||||
s->WriteSwap( fLineSpacing );
|
||||
|
||||
}
|
||||
|
148
Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h
Normal file
148
Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h
Normal file
@ -0,0 +1,148 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plDynamicTextMsg Header //
|
||||
// Message wrapper for commands to plDynamicTextMap. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _plDynamicTextMsg_h
|
||||
#define _plDynamicTextMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsColorRGBA.h"
|
||||
|
||||
class plDynamicTextMap;
|
||||
|
||||
class plDynamicTextMsg : public plMessage
|
||||
{
|
||||
friend class plDynamicTextMap;
|
||||
|
||||
protected:
|
||||
UInt16 fCmd;
|
||||
|
||||
// Position (fX is also used for font size)
|
||||
Int16 fX, fY;
|
||||
|
||||
// A rectangle
|
||||
UInt16 fLeft, fTop, fRight, fBottom;
|
||||
|
||||
// Colors
|
||||
hsColorRGBA fClearColor;
|
||||
hsColorRGBA fColor;
|
||||
|
||||
// String
|
||||
wchar_t *fString;
|
||||
|
||||
// Mipmap
|
||||
plKey fImageKey;
|
||||
|
||||
// Misc flags field
|
||||
UInt32 fFlags;
|
||||
|
||||
hsBool fBlockRGB;
|
||||
Int16 fLineSpacing;
|
||||
|
||||
public:
|
||||
plDynamicTextMsg() : plMessage( nil, nil, nil ) { fCmd = 0; fString = nil; fImageKey = nil; fFlags = 0; fBlockRGB = false; }
|
||||
~plDynamicTextMsg() { delete [] fString; }
|
||||
|
||||
CLASSNAME_REGISTER( plDynamicTextMsg );
|
||||
GETINTERFACE_ANY( plDynamicTextMsg, plMessage );
|
||||
|
||||
enum Commands
|
||||
{
|
||||
kClear = 0x0001,
|
||||
kSetTextColor = 0x0002,
|
||||
kSetFont = 0x0004,
|
||||
kFillRect = 0x0008,
|
||||
kFrameRect = 0x0010,
|
||||
kDrawString = 0x0020,
|
||||
kDrawClippedString = 0x0040,
|
||||
kDrawWrappedString = 0x0080,
|
||||
kFlush = 0x0100,
|
||||
kDrawImage = 0x0200,
|
||||
kSetJustify = 0x0400,
|
||||
kDrawClippedImage = 0x0800,
|
||||
kSetLineSpacing = 0x1000,
|
||||
kPurgeImage = 0x2000,
|
||||
|
||||
// Don't use these--just masks for internal use
|
||||
kColorCmds = kSetTextColor | kFillRect | kFrameRect,
|
||||
kStringCmds = kSetFont | kDrawString | kDrawClippedString | kDrawWrappedString,
|
||||
kRectCmds = kFillRect | kFrameRect | kDrawClippedString | kDrawWrappedString | kDrawClippedImage,
|
||||
kPosCmds = kSetFont | kDrawClippedString | kDrawWrappedString | kDrawImage | kDrawClippedImage,
|
||||
kFlagCmds = kSetFont | kDrawImage | kSetJustify | kDrawClippedImage
|
||||
};
|
||||
|
||||
// Commands
|
||||
void ClearToColor( hsColorRGBA &c ) { fCmd |= kClear; fClearColor = c; }
|
||||
void Flush( void ) { fCmd |= kFlush; }
|
||||
void PurgeImage( void ) { fCmd |= kPurgeImage; }
|
||||
|
||||
// The following are mutually exclusive commands 'cause they share some parameters
|
||||
void SetTextColor( hsColorRGBA &c, hsBool blockRGB = false );
|
||||
void SetFont( const char *face, Int16 size, hsBool isBold = false );
|
||||
void SetLineSpacing( Int16 spacing );
|
||||
void FillRect( UInt16 left, UInt16 top, UInt16 right, UInt16 bottom, hsColorRGBA &c );
|
||||
void FrameRect( UInt16 left, UInt16 top, UInt16 right, UInt16 bottom, hsColorRGBA &c );
|
||||
void DrawString( Int16 x, Int16 y, const char *text );
|
||||
void DrawString( Int16 x, Int16 y, const wchar_t *text );
|
||||
void DrawClippedString( Int16 x, Int16 y, UInt16 clipLeft, UInt16 clipTop, UInt16 clipRight, UInt16 clipBottom, const char *text );
|
||||
void DrawClippedString( Int16 x, Int16 y, UInt16 clipLeft, UInt16 clipTop, UInt16 clipRight, UInt16 clipBottom, const wchar_t *text );
|
||||
void DrawWrappedString( Int16 x, Int16 y, UInt16 wrapWidth, UInt16 wrapHeight, const char *text );
|
||||
void DrawWrappedString( Int16 x, Int16 y, UInt16 wrapWidth, UInt16 wrapHeight, const wchar_t *text );
|
||||
void DrawImage( Int16 x, Int16 y, plKey &image, hsBool respectAlpha = false );
|
||||
void DrawClippedImage( Int16 x, Int16 y, plKey &image, UInt16 clipX, UInt16 clipY, UInt16 clipWidth, UInt16 clipHeight, hsBool respectAlpha = false );
|
||||
void SetJustify( UInt8 justifyFlags );
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
// WriteVersion writes the current version of this creatable and ReadVersion will read in
|
||||
// any previous version.
|
||||
virtual void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
virtual void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
#endif // _plDynamicTextMsg_h
|
42
Sources/Plasma/PubUtilLib/plMessage/plElementRefMsg.h
Normal file
42
Sources/Plasma/PubUtilLib/plMessage/plElementRefMsg.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
// Nuked file. Delete from your source file
|
118
Sources/Plasma/PubUtilLib/plMessage/plEnvEffectMsg.h
Normal file
118
Sources/Plasma/PubUtilLib/plMessage/plEnvEffectMsg.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plEnvEffectMsg_inc
|
||||
#define plEnvEffectMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
class hsResMgr;
|
||||
|
||||
|
||||
class plEnvEffectMsg : public plMessage
|
||||
{
|
||||
|
||||
hsBool fEnable;
|
||||
|
||||
public:
|
||||
plEnvEffectMsg(){ SetBCastFlag(plMessage::kPropagateToModifiers); }
|
||||
|
||||
plEnvEffectMsg(const plKey* s,
|
||||
const plKey* r,
|
||||
const double* t){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
|
||||
~plEnvEffectMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plEnvEffectMsg );
|
||||
GETINTERFACE_ANY( plEnvEffectMsg, plMessage );
|
||||
|
||||
hsBool Enabled() { return fEnable; }
|
||||
void Enable(hsBool b) { fEnable = b; }
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
stream->ReadSwap(&fEnable);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwap(fEnable);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class plEnvAudioEffectMsg : public plEnvEffectMsg
|
||||
{
|
||||
UInt32 fPreset;
|
||||
|
||||
public:
|
||||
plEnvAudioEffectMsg(){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
plEnvAudioEffectMsg(const plKey* s,
|
||||
const plKey* r,
|
||||
const double* t){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
|
||||
~plEnvAudioEffectMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plEnvAudioEffectMsg );
|
||||
GETINTERFACE_ANY( plEnvAudioEffectMsg, plEnvEffectMsg );
|
||||
|
||||
UInt32 GetEffect() { return fPreset; }
|
||||
void SetEffect(UInt32 i) { fPreset = i; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plEnvEffectMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fPreset);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plEnvEffectMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fPreset);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plEnvEffectMsg_inc
|
91
Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h
Normal file
91
Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h
Normal file
@ -0,0 +1,91 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plExcludeRegionMsg_inc
|
||||
#define plExcludeRegionMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class hsStream;
|
||||
|
||||
class plExcludeRegionMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum CmdType
|
||||
{
|
||||
kClear, // Moves all avatars from the affected region. Once they are gone, It sends a
|
||||
// callback message and turns the region into a solid object that avatars
|
||||
// cannot penetrate.
|
||||
kRelease // Makes the xRegion not solid anymore
|
||||
};
|
||||
|
||||
protected:
|
||||
UInt8 fCmd;
|
||||
|
||||
public:
|
||||
plExcludeRegionMsg() : fCmd(kClear), fSynchFlags(0) {}
|
||||
plExcludeRegionMsg(const plKey &s, const plKey &r, const double* t) : fCmd(kClear), fSynchFlags(0) {}
|
||||
~plExcludeRegionMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER(plExcludeRegionMsg);
|
||||
GETINTERFACE_ANY(plExcludeRegionMsg, plMessage);
|
||||
|
||||
void SetCmd(CmdType cmd) { fCmd = cmd; }
|
||||
UInt8 GetCmd() { return fCmd; }
|
||||
|
||||
UInt32 fSynchFlags;
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fCmd = stream->ReadByte();
|
||||
fSynchFlags = stream->ReadSwap32();
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteByte(fCmd);
|
||||
stream->WriteSwap32(fSynchFlags);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plExcludeRegionMsg_inc
|
332
Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp
Normal file
332
Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp
Normal file
@ -0,0 +1,332 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plInputEventMsg.h"
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
plInputEventMsg::plInputEventMsg() :
|
||||
fEvent(-1)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByType);
|
||||
}
|
||||
|
||||
plInputEventMsg::plInputEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) :
|
||||
fEvent(-1)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByType);
|
||||
}
|
||||
|
||||
plInputEventMsg::~plInputEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
void plInputEventMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
stream->ReadSwap(&fEvent);
|
||||
}
|
||||
|
||||
void plInputEventMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
stream->WriteSwap(fEvent);
|
||||
}
|
||||
|
||||
enum InputEventMsgFlags
|
||||
{
|
||||
kInputEventMsgEvent,
|
||||
};
|
||||
|
||||
void plInputEventMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kInputEventMsgEvent))
|
||||
s->ReadSwap(&fEvent);
|
||||
}
|
||||
|
||||
void plInputEventMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kInputEventMsgEvent);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kInputEventMsgEvent
|
||||
s->WriteSwap(fEvent);
|
||||
}
|
||||
|
||||
plControlEventMsg::plControlEventMsg() :
|
||||
fCmd(nil)
|
||||
{
|
||||
fTurnToPt.Set(0,0,0);
|
||||
fControlPct = 1.0f;
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
SetBCastFlag(plMessage::kBCastByType, false);
|
||||
}
|
||||
|
||||
plControlEventMsg::plControlEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) :
|
||||
fCmd(nil)
|
||||
{
|
||||
fTurnToPt.Set(0,0,0);
|
||||
fControlPct = 1.0f;
|
||||
SetBCastFlag(plMessage::kBCastByType, false);
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
}
|
||||
|
||||
plControlEventMsg::~plControlEventMsg()
|
||||
{
|
||||
delete [] fCmd;
|
||||
}
|
||||
|
||||
void plControlEventMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap((Int32*)&fControlCode);
|
||||
stream->ReadSwap(&fControlActivated);
|
||||
stream->ReadSwap(&fControlPct);
|
||||
fTurnToPt.Read(stream);
|
||||
|
||||
// read cmd/string
|
||||
plMsgCStringHelper::Peek(fCmd, stream);
|
||||
}
|
||||
|
||||
void plControlEventMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap((Int32)fControlCode);
|
||||
stream->WriteSwap(fControlActivated);
|
||||
stream->WriteSwap(fControlPct);
|
||||
fTurnToPt.Write(stream);
|
||||
|
||||
// write cmd/string
|
||||
plMsgCStringHelper::Poke(fCmd, stream);
|
||||
}
|
||||
|
||||
enum ControlEventMsgFlags
|
||||
{
|
||||
kControlEventMsgCode,
|
||||
kControlEventMsgActivated,
|
||||
kControlEventMsgPct,
|
||||
kControlEventMsgTurnToPt,
|
||||
kControlEventMsgCmd,
|
||||
};
|
||||
|
||||
void plControlEventMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::ReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kControlEventMsgCode))
|
||||
s->ReadSwap((Int32*)&fControlCode);
|
||||
|
||||
if (contentFlags.IsBitSet(kControlEventMsgActivated))
|
||||
s->ReadSwap(&fControlActivated);
|
||||
|
||||
if (contentFlags.IsBitSet(kControlEventMsgPct))
|
||||
s->ReadSwap(&fControlPct);
|
||||
|
||||
if (contentFlags.IsBitSet(kControlEventMsgTurnToPt))
|
||||
fTurnToPt.Read(s);
|
||||
|
||||
// read cmd/string
|
||||
if (contentFlags.IsBitSet(kControlEventMsgCmd))
|
||||
plMsgCStringHelper::Peek(fCmd, s);
|
||||
}
|
||||
|
||||
void plControlEventMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::WriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kControlEventMsgCode);
|
||||
contentFlags.SetBit(kControlEventMsgActivated);
|
||||
contentFlags.SetBit(kControlEventMsgPct);
|
||||
contentFlags.SetBit(kControlEventMsgTurnToPt);
|
||||
contentFlags.SetBit(kControlEventMsgCmd);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kControlEventMsgCode,
|
||||
s->WriteSwap((Int32)fControlCode);
|
||||
|
||||
// kControlEventMsgActivated,
|
||||
s->WriteSwap(fControlActivated);
|
||||
|
||||
// kControlEventMsgPct,
|
||||
s->WriteSwap(fControlPct);
|
||||
|
||||
// kControlEventMsgTurnToPt,
|
||||
fTurnToPt.Write(s);
|
||||
|
||||
// kControlEventMsgCmd,
|
||||
plMsgCStringHelper::Poke(fCmd, s);
|
||||
}
|
||||
|
||||
plKeyEventMsg::plKeyEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
plKeyEventMsg::plKeyEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
{
|
||||
}
|
||||
|
||||
plKeyEventMsg::~plKeyEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
plDebugKeyEventMsg::plDebugKeyEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
plDebugKeyEventMsg::plDebugKeyEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
{
|
||||
}
|
||||
|
||||
plDebugKeyEventMsg::~plDebugKeyEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
plMouseEventMsg::plMouseEventMsg() : fXPos(0.0f),fYPos(0.0f),fDX(0.0f),fDY(0.0f),fButton(0)
|
||||
{
|
||||
}
|
||||
|
||||
plMouseEventMsg::plMouseEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
{
|
||||
}
|
||||
|
||||
plMouseEventMsg::~plMouseEventMsg()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Mapping of bits to the control events we care about
|
||||
const ControlEventCode plAvatarInputStateMsg::fCodeMap[] =
|
||||
{
|
||||
B_CONTROL_MOVE_FORWARD,
|
||||
B_CONTROL_MOVE_BACKWARD,
|
||||
B_CONTROL_ROTATE_LEFT,
|
||||
B_CONTROL_ROTATE_RIGHT,
|
||||
B_CONTROL_STRAFE_LEFT,
|
||||
B_CONTROL_STRAFE_RIGHT,
|
||||
B_CONTROL_ALWAYS_RUN,
|
||||
B_CONTROL_JUMP,
|
||||
B_CONTROL_CONSUMABLE_JUMP,
|
||||
B_CONTROL_MODIFIER_FAST,
|
||||
B_CONTROL_MODIFIER_STRAFE,
|
||||
B_CONTROL_LADDER_INVERTED,
|
||||
};
|
||||
const UInt8 plAvatarInputStateMsg::fMapSize = 12;
|
||||
|
||||
void plAvatarInputStateMsg::Read(hsStream *s, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
fState = s->ReadSwap16();
|
||||
}
|
||||
|
||||
void plAvatarInputStateMsg::Write(hsStream *s, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
s->WriteSwap16(fState);
|
||||
}
|
||||
|
||||
enum AvatarInputStateMsgFlags
|
||||
{
|
||||
kAvatarInputStateMsgState,
|
||||
};
|
||||
|
||||
void plAvatarInputStateMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kAvatarInputStateMsgState))
|
||||
fState = s->ReadSwap16();
|
||||
}
|
||||
|
||||
void plAvatarInputStateMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kAvatarInputStateMsgState);
|
||||
contentFlags.Write(s);
|
||||
|
||||
s->WriteSwap16(fState);
|
||||
}
|
||||
|
||||
hsBool plAvatarInputStateMsg::IsCodeInMap(ControlEventCode code)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < fMapSize; i++)
|
||||
{
|
||||
if (fCodeMap[i] == code)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
423
Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h
Normal file
423
Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h
Normal file
@ -0,0 +1,423 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plInputEventMsg_inc
|
||||
#define plInputEventMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../pnInputCore/plControlDefinition.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
class plKeyEventMsg;
|
||||
class plMouseEventMsg;
|
||||
|
||||
class plInputEventMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kConfigure = 0,
|
||||
};
|
||||
plInputEventMsg();
|
||||
plInputEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
|
||||
~plInputEventMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plInputEventMsg );
|
||||
GETINTERFACE_ANY( plInputEventMsg, plMessage );
|
||||
|
||||
int fEvent;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
class plControlEventMsg : public plInputEventMsg
|
||||
{
|
||||
private:
|
||||
char* fCmd;
|
||||
protected:
|
||||
|
||||
ControlEventCode fControlCode;
|
||||
hsBool fControlActivated;
|
||||
hsPoint3 fTurnToPt;
|
||||
hsScalar fControlPct;
|
||||
public:
|
||||
|
||||
plControlEventMsg();
|
||||
plControlEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
~plControlEventMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plControlEventMsg );
|
||||
GETINTERFACE_ANY( plControlEventMsg, plInputEventMsg );
|
||||
|
||||
void SetCmdString(const char* cs) { delete [] fCmd; fCmd=hsStrcpy(cs); }
|
||||
void SetControlCode(ControlEventCode c) { fControlCode = c; }
|
||||
void SetControlActivated(hsBool b) { fControlActivated = b; }
|
||||
void SetTurnToPt(hsPoint3 pt) { fTurnToPt = pt; }
|
||||
void SetControlPct(hsScalar p) { fControlPct = p; }
|
||||
|
||||
ControlEventCode GetControlCode() const { return fControlCode; }
|
||||
hsBool ControlActivated() { return fControlActivated; }
|
||||
hsPoint3 GetTurnToPt() { return fTurnToPt; }
|
||||
hsScalar GetPct() { return fControlPct; }
|
||||
char* GetCmdString() { return fCmd; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
class plKeyEventMsg : public plInputEventMsg
|
||||
{
|
||||
protected:
|
||||
plKeyDef fKeyCode;
|
||||
hsBool fKeyDown;
|
||||
hsBool fCapsLockKeyDown;
|
||||
hsBool fShiftKeyDown;
|
||||
hsBool fCtrlKeyDown;
|
||||
hsBool fRepeat;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
plKeyEventMsg();
|
||||
plKeyEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
~plKeyEventMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plKeyEventMsg );
|
||||
GETINTERFACE_ANY( plKeyEventMsg, plInputEventMsg );
|
||||
|
||||
void SetKeyCode(plKeyDef w) { fKeyCode = w; }
|
||||
void SetKeyDown(hsBool b) { fKeyDown = b; }
|
||||
void SetShiftKeyDown(hsBool b) { fShiftKeyDown = b; }
|
||||
void SetCtrlKeyDown(hsBool b) { fCtrlKeyDown = b; }
|
||||
void SetCapsLockKeyDown(hsBool b) { fCapsLockKeyDown = b; }
|
||||
void SetRepeat(hsBool b) { fRepeat = b; }
|
||||
|
||||
plKeyDef GetKeyCode() { return fKeyCode; }
|
||||
hsBool GetKeyDown() { return fKeyDown; }
|
||||
hsBool GetShiftKeyDown() { return fShiftKeyDown; }
|
||||
hsBool GetCtrlKeyDown() { return fCtrlKeyDown; }
|
||||
hsBool GetCapsLockKeyDown() { return fCapsLockKeyDown; }
|
||||
hsBool GetRepeat() { return fRepeat; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap((Int32*)&fKeyCode);
|
||||
stream->ReadSwap(&fKeyDown);
|
||||
stream->ReadSwap(&fCapsLockKeyDown);
|
||||
stream->ReadSwap(&fShiftKeyDown);
|
||||
stream->ReadSwap(&fCtrlKeyDown);
|
||||
stream->ReadSwap(&fRepeat);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap((Int32)fKeyCode);
|
||||
stream->WriteSwap(fKeyDown);
|
||||
stream->WriteSwap(fCapsLockKeyDown);
|
||||
stream->WriteSwap(fShiftKeyDown);
|
||||
stream->WriteSwap(fCtrlKeyDown);
|
||||
stream->WriteSwap(fRepeat);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class plDebugKeyEventMsg : public plInputEventMsg
|
||||
{
|
||||
protected:
|
||||
ControlEventCode fKeyCode;
|
||||
hsBool fKeyDown;
|
||||
hsBool fCapsLockKeyDown;
|
||||
hsBool fShiftKeyDown;
|
||||
hsBool fCtrlKeyDown;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
plDebugKeyEventMsg();
|
||||
plDebugKeyEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
~plDebugKeyEventMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plDebugKeyEventMsg );
|
||||
GETINTERFACE_ANY( plDebugKeyEventMsg, plInputEventMsg );
|
||||
|
||||
void SetKeyCode(ControlEventCode w) { fKeyCode = w; }
|
||||
void SetKeyDown(hsBool b) { fKeyDown = b; }
|
||||
void SetShiftKeyDown(hsBool b) { fShiftKeyDown = b; }
|
||||
void SetCtrlKeyDown(hsBool b) { fCtrlKeyDown = b; }
|
||||
void SetCapsLockKeyDown(hsBool b) { fCapsLockKeyDown = b; }
|
||||
|
||||
ControlEventCode GetKeyCode() { return fKeyCode; }
|
||||
hsBool GetKeyDown() { return fKeyDown; }
|
||||
hsBool GetShiftKeyDown() { return fShiftKeyDown; }
|
||||
hsBool GetCtrlKeyDown() { return fCtrlKeyDown; }
|
||||
hsBool GetCapsLockKeyDown() { return fCapsLockKeyDown; }
|
||||
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap((Int32*)&fKeyCode);
|
||||
stream->ReadSwap(&fKeyDown);
|
||||
stream->ReadSwap(&fCapsLockKeyDown);
|
||||
stream->ReadSwap(&fShiftKeyDown);
|
||||
stream->ReadSwap(&fCtrlKeyDown);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap((Int32)fKeyCode);
|
||||
stream->WriteSwap(fKeyDown);
|
||||
stream->WriteSwap(fCapsLockKeyDown);
|
||||
stream->WriteSwap(fShiftKeyDown);
|
||||
stream->WriteSwap(fCtrlKeyDown);
|
||||
}
|
||||
};
|
||||
|
||||
class plIMouseXEventMsg : public plInputEventMsg
|
||||
{
|
||||
public:
|
||||
float fX;
|
||||
int fWx;
|
||||
|
||||
plIMouseXEventMsg() :
|
||||
fX(0),fWx(0) {}
|
||||
plIMouseXEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) :
|
||||
fX(0),fWx(0) {}
|
||||
~plIMouseXEventMsg(){}
|
||||
|
||||
CLASSNAME_REGISTER( plIMouseXEventMsg );
|
||||
GETINTERFACE_ANY( plIMouseXEventMsg, plInputEventMsg );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fX);
|
||||
stream->ReadSwap(&fWx);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fX);
|
||||
stream->WriteSwap(fWx);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class plIMouseYEventMsg : public plInputEventMsg
|
||||
{
|
||||
public:
|
||||
float fY;
|
||||
int fWy;
|
||||
|
||||
plIMouseYEventMsg() :
|
||||
fY(0),fWy(0) {}
|
||||
plIMouseYEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) :
|
||||
fY(0),fWy(0) {}
|
||||
~plIMouseYEventMsg(){}
|
||||
|
||||
CLASSNAME_REGISTER( plIMouseYEventMsg );
|
||||
GETINTERFACE_ANY( plIMouseYEventMsg, plInputEventMsg );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fY);
|
||||
stream->ReadSwap(&fWy);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fY);
|
||||
stream->WriteSwap(fWy);
|
||||
}
|
||||
|
||||
};
|
||||
class plIMouseBEventMsg : public plInputEventMsg
|
||||
{
|
||||
public:
|
||||
short fButton;
|
||||
|
||||
plIMouseBEventMsg() :
|
||||
fButton(0) {}
|
||||
plIMouseBEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) :
|
||||
fButton(0) {}
|
||||
~plIMouseBEventMsg(){}
|
||||
|
||||
CLASSNAME_REGISTER( plIMouseBEventMsg );
|
||||
GETINTERFACE_ANY( plIMouseBEventMsg, plInputEventMsg );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fButton);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fButton);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class plMouseEventMsg : public plInputEventMsg
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
float fXPos;
|
||||
float fYPos;
|
||||
float fDX;
|
||||
float fDY;
|
||||
float fWheelDelta;
|
||||
|
||||
short fButton;
|
||||
|
||||
|
||||
public:
|
||||
plMouseEventMsg();
|
||||
plMouseEventMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
~plMouseEventMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plMouseEventMsg );
|
||||
GETINTERFACE_ANY( plMouseEventMsg, plInputEventMsg );
|
||||
|
||||
void SetXPos(float Xpos) { fXPos = Xpos; };
|
||||
void SetYPos(float Ypos) { fYPos = Ypos; };
|
||||
void SetDX(float dX) { fDX = dX; }
|
||||
void SetDY(float dY) { fDY = dY; }
|
||||
void SetButton(short _button) { fButton = _button; }
|
||||
void SetWheelDelta(float d) { fWheelDelta = d; }
|
||||
|
||||
float GetXPos() { return fXPos; }
|
||||
float GetYPos() { return fYPos; }
|
||||
float GetDX() { return fDX; }
|
||||
float GetDY() { return fDY; }
|
||||
float GetWheelDelta() { return fWheelDelta; }
|
||||
short GetButton() { return fButton; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fXPos);
|
||||
stream->ReadSwap(&fYPos);
|
||||
stream->ReadSwap(&fDX);
|
||||
stream->ReadSwap(&fDY);
|
||||
stream->ReadSwap(&fButton);
|
||||
stream->ReadSwap(&fWheelDelta);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plInputEventMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fXPos);
|
||||
stream->WriteSwap(fYPos);
|
||||
stream->WriteSwap(fDX);
|
||||
stream->WriteSwap(fDY);
|
||||
stream->WriteSwap(fButton);
|
||||
stream->WriteSwap(fWheelDelta);
|
||||
}
|
||||
};
|
||||
|
||||
class plAvatarInputStateMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
UInt16 fState;
|
||||
|
||||
plAvatarInputStateMsg() : plMessage(), fState(0) {}
|
||||
~plAvatarInputStateMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plAvatarInputStateMsg );
|
||||
GETINTERFACE_ANY( plAvatarInputStateMsg, plMessage );
|
||||
|
||||
void Read(hsStream *s, hsResMgr *mgr);
|
||||
void Write(hsStream *s, hsResMgr *mgr);
|
||||
|
||||
void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
// Mapping of bits to the control events we care about
|
||||
static const ControlEventCode fCodeMap[];
|
||||
static const UInt8 fMapSize;
|
||||
|
||||
static hsBool IsCodeInMap(ControlEventCode code);
|
||||
};
|
||||
|
||||
#endif // plInputEventMsg_inc
|
66
Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.cpp
Normal file
66
Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plInputIfaceMgrMsg //
|
||||
// Message wrapper for commands to plDynamicTextMap. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plInputIfaceMgrMsg.h"
|
||||
#include "../plInputCore/plInputInterface.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsRefCnt.h"
|
||||
|
||||
|
||||
plInputIfaceMgrMsg::~plInputIfaceMgrMsg()
|
||||
{
|
||||
if( fInterface != nil )
|
||||
hsRefCnt_SafeUnRef( fInterface );
|
||||
}
|
||||
|
||||
void plInputIfaceMgrMsg::SetIFace( plInputInterface *iface )
|
||||
{
|
||||
fInterface = iface;
|
||||
hsRefCnt_SafeRef( fInterface );
|
||||
}
|
139
Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h
Normal file
139
Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h
Normal file
@ -0,0 +1,139 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plInputIfaceMgrMsg Header //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _plInputIfaceMgrMsg_h
|
||||
#define _plInputIfaceMgrMsg_h
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
|
||||
class plInputInterface;
|
||||
class plInputIfaceMgrMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
UInt8 fCommand;
|
||||
plInputInterface *fInterface;
|
||||
UInt32 fPageID;
|
||||
const char* ageName;
|
||||
const char* ageFileName;
|
||||
const char* spawnPoint;
|
||||
Uuid ageInstanceGuid;
|
||||
plKey fAvKey;
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
kAddInterface,
|
||||
kRemoveInterface,
|
||||
kEnableClickables, /// YEEEEEECH!!!!
|
||||
kDisableClickables,
|
||||
kSetOfferBookMode,
|
||||
kClearOfferBookMode,
|
||||
kNotifyOfferAccepted,
|
||||
kNotifyOfferRejected,
|
||||
kNotifyOfferCompleted,
|
||||
kDisableAvatarClickable,
|
||||
kEnableAvatarClickable,
|
||||
kGUIDisableAvatarClickable,
|
||||
kGUIEnableAvatarClickable,
|
||||
kSetShareSpawnPoint,
|
||||
kSetShareAgeInstanceGuid,
|
||||
};
|
||||
|
||||
plInputIfaceMgrMsg() : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fInterface = nil; ageName = ageFileName = spawnPoint = 0; fAvKey = nil; }
|
||||
plInputIfaceMgrMsg( plKey &receiver, UInt8 command ) : plMessage( nil, nil, nil ) { AddReceiver( receiver ); fCommand = command; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;}
|
||||
plInputIfaceMgrMsg( UInt8 command ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;}
|
||||
plInputIfaceMgrMsg( UInt8 command, UInt32 pageID ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fPageID = pageID; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;}
|
||||
~plInputIfaceMgrMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plInputIfaceMgrMsg );
|
||||
GETINTERFACE_ANY( plInputIfaceMgrMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead( s, mgr );
|
||||
s->ReadSwap( &fCommand );
|
||||
s->ReadSwap( &fPageID );
|
||||
ageName = s->ReadSafeString();
|
||||
ageFileName = s->ReadSafeString();
|
||||
spawnPoint = s->ReadSafeString();
|
||||
fAvKey = mgr->ReadKey(s);
|
||||
}
|
||||
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite( s, mgr );
|
||||
s->WriteSwap( fCommand );
|
||||
s->WriteSwap( fPageID );
|
||||
s->WriteSafeString(ageName);
|
||||
s->WriteSafeString(ageFileName);
|
||||
s->WriteSafeString(spawnPoint);
|
||||
mgr->WriteKey(s,fAvKey);
|
||||
}
|
||||
|
||||
void SetAgeName(const char* s) { ageName = s; }
|
||||
const char* GetAgeName() { return ageName; }
|
||||
void SetAgeFileName(const char* s) { ageFileName = s; }
|
||||
const char* GetAgeFileName() { return ageFileName; }
|
||||
void SetSpawnPoint(const char* s) { spawnPoint = s; }
|
||||
const char* GetSpawnPoint() { return spawnPoint; }
|
||||
void SetAgeInstanceGuid(const Uuid& guid) { ageInstanceGuid = guid; }
|
||||
const Uuid& GetAgeInstanceGuid() { return ageInstanceGuid; }
|
||||
UInt8 GetCommand( void ) { return fCommand; }
|
||||
UInt32 GetPageID( void ) { return fPageID; }
|
||||
void SetIFace( plInputInterface *iface );
|
||||
plInputInterface *GetIFace( void ) const { return fInterface; }
|
||||
plKey& GetAvKey( void ) { return fAvKey; }
|
||||
const plKey& GetAvKey( void ) const { return fAvKey; }
|
||||
void SetAvKey( plKey& k ) { fAvKey = k; }
|
||||
};
|
||||
|
||||
#endif // _plInputIfaceMgrMsg_h
|
118
Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h
Normal file
118
Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plInterestingPing_inc
|
||||
#define plInterestingPing_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
class plInterestingModMsg : public plMessage
|
||||
{
|
||||
|
||||
public:
|
||||
plInterestingModMsg(){}
|
||||
plInterestingModMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t){}
|
||||
~plInterestingModMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plInterestingModMsg );
|
||||
GETINTERFACE_ANY( plInterestingModMsg, plMessage );
|
||||
|
||||
hsScalar fWeight;
|
||||
hsScalar fRadius;
|
||||
hsScalar fSize;
|
||||
hsPoint3 fPos;
|
||||
plKey fObj;
|
||||
UInt8 fType;
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
stream->ReadSwap(&fWeight);
|
||||
stream->ReadSwap(&fRadius);
|
||||
stream->ReadSwap(&fSize);
|
||||
fPos.Read(stream);
|
||||
fObj = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwap(fWeight);
|
||||
stream->WriteSwap(fRadius);
|
||||
stream->WriteSwap(fSize);
|
||||
fPos.Write(stream);
|
||||
mgr->WriteKey(stream, fObj);
|
||||
}
|
||||
};
|
||||
|
||||
class plInterestingPing : public plMessage
|
||||
{
|
||||
|
||||
public:
|
||||
plInterestingPing(){SetBCastFlag(plMessage::kBCastByExactType);}
|
||||
plInterestingPing(const plKey &s) {SetBCastFlag(plMessage::kBCastByExactType);SetSender(s);}
|
||||
plInterestingPing(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t){SetBCastFlag(plMessage::kBCastByExactType);}
|
||||
~plInterestingPing(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plInterestingPing );
|
||||
GETINTERFACE_ANY( plInterestingPing, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plInterestingPing
|
58
Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.cpp
Normal file
58
Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plLOSHitMsg.h"
|
||||
|
||||
plLOSHitMsg::plLOSHitMsg()
|
||||
{
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
fHitFlags = 0;
|
||||
}
|
||||
plLOSHitMsg::plLOSHitMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t)
|
||||
: plMessage(s, r, t)
|
||||
{
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
fHitFlags = 0;
|
||||
}
|
98
Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h
Normal file
98
Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h
Normal file
@ -0,0 +1,98 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plLOSHitMsg_inc
|
||||
#define plLOSHitMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
|
||||
class plLOSHitMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
plKey fObj;
|
||||
hsPoint3 fHitPoint;
|
||||
hsBool fNoHit;
|
||||
UInt32 fRequestID;
|
||||
UInt32 fHitFlags;
|
||||
hsVector3 fNormal;
|
||||
float fDistance;
|
||||
|
||||
plLOSHitMsg();
|
||||
plLOSHitMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t);
|
||||
~plLOSHitMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plLOSHitMsg );
|
||||
GETINTERFACE_ANY( plLOSHitMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fObj = mgr->ReadKey(stream);
|
||||
fHitPoint.Read(stream);
|
||||
fNoHit = stream->ReadBool();
|
||||
stream->ReadSwap(&fRequestID);
|
||||
stream->ReadSwap(&fHitFlags);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
mgr->WriteKey(stream, fObj);
|
||||
fHitPoint.Write(stream);
|
||||
stream->WriteBool(fNoHit);
|
||||
stream->WriteSwap(fRequestID);
|
||||
stream->WriteSwap(fHitFlags);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // plLOSHitMsg_inc
|
70
Sources/Plasma/PubUtilLib/plMessage/plLOSRequestMsg.cpp
Normal file
70
Sources/Plasma/PubUtilLib/plMessage/plLOSRequestMsg.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plLOSRequestMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
|
||||
plLOSRequestMsg::plLOSRequestMsg()
|
||||
: fRequestID(0),
|
||||
fRequestType(plSimDefs::kLOSDBNone),
|
||||
fTestType(kTestAny),
|
||||
fReportType(kReportHit),
|
||||
fCullDB(plSimDefs::kLOSDBNone),
|
||||
fWorldKey(nil)
|
||||
{
|
||||
AddReceiver(hsgResMgr::ResMgr()->FindKey(kLOSObject_KEY));
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
}
|
||||
|
||||
plLOSRequestMsg::plLOSRequestMsg(const plKey& sender, hsPoint3& fromPoint, hsPoint3& toPoint, plSimDefs::plLOSDB db, TestType test, ReportType report)
|
||||
: plMessage(sender, hsgResMgr::ResMgr()->FindKey(kLOSObject_KEY), nil),
|
||||
fFrom(fromPoint),
|
||||
fTo(toPoint),
|
||||
fRequestID(0),
|
||||
fRequestType(db),
|
||||
fTestType(test),
|
||||
fReportType(report),
|
||||
fCullDB(plSimDefs::kLOSDBNone),
|
||||
fWorldKey(nil)
|
||||
{
|
||||
SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
}
|
117
Sources/Plasma/PubUtilLib/plMessage/plLOSRequestMsg.h
Normal file
117
Sources/Plasma/PubUtilLib/plMessage/plLOSRequestMsg.h
Normal file
@ -0,0 +1,117 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plLOSRequestMsg_inc
|
||||
#define plLOSRequestMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plPhysical/plSimDefs.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class plLOSRequestMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum TestType {
|
||||
kTestClosest, // this test has to keep going after finding a hit until it's ruled out others
|
||||
kTestAny // this is faster because it will stop as soon as it finds any hit
|
||||
};
|
||||
|
||||
enum ReportType
|
||||
{
|
||||
kReportHit,
|
||||
kReportMiss,
|
||||
kReportHitOrMiss
|
||||
};
|
||||
|
||||
plLOSRequestMsg();
|
||||
plLOSRequestMsg(const plKey& sender, hsPoint3& fromPoint, hsPoint3& toPoint, plSimDefs::plLOSDB db,
|
||||
TestType test = kTestAny, ReportType report = kReportHit);
|
||||
|
||||
void SetFrom(const hsPoint3& from) { fFrom = from; }
|
||||
void SetTo(const hsPoint3& to) { fTo = to; }
|
||||
|
||||
void SetWorldKey(plKey world) { fWorldKey = world; }
|
||||
|
||||
/** Determines which database we're testing against.
|
||||
See plSimDefs::plLOSDB for a list of valid databases. */
|
||||
void SetRequestType(plSimDefs::plLOSDB type) { fRequestType = type; }
|
||||
plSimDefs::plLOSDB GetRequestType() const { return fRequestType; }
|
||||
|
||||
/** Determine whether we'll return on the first hit we get (kTestAny)
|
||||
or keep looking until we're sure we've found the closest hit (kTestClosest)
|
||||
The latter is slower because it has to look at all possible hits. */
|
||||
void SetTestType(TestType type) { fTestType = type; }
|
||||
TestType GetTestType() const { return fTestType; }
|
||||
|
||||
/** Do we report when we find a hit, when we don't find a hit, or both? */
|
||||
void SetReportType(ReportType type) { fReportType = type; }
|
||||
ReportType GetReportType() const { return fReportType; }
|
||||
|
||||
/** An ID invented by the caller for their own bookkeeping. */
|
||||
void SetRequestID(UInt32 id) { fRequestID = id; }
|
||||
UInt32 GetRequestID() { return fRequestID; }
|
||||
|
||||
/** If we get a hit on the first pass, we'll then double-check the remaining
|
||||
segment (start->first hit) against the "cull db". If *any* hit is found,
|
||||
the entire test fails. */
|
||||
void SetCullDB(plSimDefs::plLOSDB db) { fCullDB = db; }
|
||||
plSimDefs::plLOSDB GetCullDB() { return fCullDB; }
|
||||
|
||||
CLASSNAME_REGISTER( plLOSRequestMsg );
|
||||
GETINTERFACE_ANY( plLOSRequestMsg, plMessage );
|
||||
|
||||
// Local only, runtime, no IO necessary
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr) {}
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr) {}
|
||||
|
||||
private:
|
||||
friend class plLOSDispatch;
|
||||
hsPoint3 fFrom;
|
||||
hsPoint3 fTo;
|
||||
plKey fWorldKey; // Force the query to happen in a particular subworld.
|
||||
plSimDefs::plLOSDB fRequestType; // which database are we probing?
|
||||
plSimDefs::plLOSDB fCullDB; // if we find a hit, see if anything in this DB blocks it.
|
||||
TestType fTestType; // testing closest hit or just any?
|
||||
ReportType fReportType; // reporting hits, misses, or both?
|
||||
UInt32 fRequestID;
|
||||
};
|
||||
|
||||
#endif // plLOSRequestMsg_inc
|
59
Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp
Normal file
59
Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plLayRefMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
void plLayRefMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fType);
|
||||
stream->ReadSwap(&fWhich);
|
||||
}
|
||||
|
||||
void plLayRefMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fType);
|
||||
stream->WriteSwap(fWhich);
|
||||
}
|
75
Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.h
Normal file
75
Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.h
Normal file
@ -0,0 +1,75 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plLayRefMsg_inc
|
||||
#define plLayRefMsg_inc
|
||||
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plLayRefMsg : public plRefMsg
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
kTexture = 1,
|
||||
kUnderLay = 2,
|
||||
kVertexShader = 3,
|
||||
kPixelShader = 4
|
||||
};
|
||||
|
||||
plLayRefMsg() : fType(-1), fWhich(-1) {}
|
||||
plLayRefMsg(const plKey &r, UInt8 f, Int8 which, Int8 type) : plRefMsg(r, f), fWhich(which), fType(type) {}
|
||||
|
||||
CLASSNAME_REGISTER( plLayRefMsg );
|
||||
GETINTERFACE_ANY( plLayRefMsg, plRefMsg );
|
||||
|
||||
Int8 fType;
|
||||
Int8 fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
#endif // plLayRefMsg_inc
|
63
Sources/Plasma/PubUtilLib/plMessage/plLightRefMsg.h
Normal file
63
Sources/Plasma/PubUtilLib/plMessage/plLightRefMsg.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plLightRefMsg_inc
|
||||
#define plLightRefMsg_inc
|
||||
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
|
||||
class hsKeyedObject;
|
||||
|
||||
class plLightRefMsg : public plRefMsg
|
||||
{
|
||||
public:
|
||||
plLightRefMsg() {}
|
||||
plLightRefMsg(const plKey& s, const plKey &r, hsKeyedObject* l, UInt8 c) : plRefMsg(r, c) { SetRef(l); SetSender(s); }
|
||||
|
||||
CLASSNAME_REGISTER( plLightRefMsg );
|
||||
GETINTERFACE_ANY( plLightRefMsg, plRefMsg );
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr) { plRefMsg::Read(s, mgr); }
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr) { plRefMsg::Write(s, mgr); }
|
||||
};
|
||||
|
||||
#endif // plLightRefMsg_inc
|
58
Sources/Plasma/PubUtilLib/plMessage/plLinearVelocityMsg.h
Normal file
58
Sources/Plasma/PubUtilLib/plMessage/plLinearVelocityMsg.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../../NucleusLib/pnMessage/plSimulationMsg.h"
|
||||
#include "../../CoreLib/hsGeometry3.h"
|
||||
class plLinearVelocityMsg : public plSimulationMsg
|
||||
{
|
||||
public:
|
||||
// pass-through constructors
|
||||
plLinearVelocityMsg() : plSimulationMsg() {};
|
||||
plLinearVelocityMsg(const plKey &sender, const plKey &receiver, const double *time)
|
||||
: plSimulationMsg(sender,receiver, time), fVelocity(0.0f,0.0f,0.0f) {};
|
||||
CLASSNAME_REGISTER( plLinearVelocityMsg );
|
||||
GETINTERFACE_ANY( plLinearVelocityMsg, plSimulationMsg);
|
||||
void Velocity(hsVector3& vel){fVelocity=vel;}
|
||||
const hsVector3& Velocity(){return fVelocity;}
|
||||
protected:
|
||||
hsVector3 fVelocity;
|
||||
|
||||
};
|
424
Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp
Normal file
424
Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp
Normal file
@ -0,0 +1,424 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsStream.h"
|
||||
#include "plLinkToAgeMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsUtils.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "../plNetCommon/plNetServerSessionInfo.h"
|
||||
#include "../plNetCommon/plNetCommon.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkToAgeMsg
|
||||
|
||||
plLinkToAgeMsg::plLinkToAgeMsg() : fLinkInAnimName(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plLinkToAgeMsg::plLinkToAgeMsg( const plAgeLinkStruct * link ) : fLinkInAnimName(nil)
|
||||
{
|
||||
fAgeLink.CopyFrom( link );
|
||||
}
|
||||
|
||||
plLinkToAgeMsg::~plLinkToAgeMsg()
|
||||
{
|
||||
delete [] fLinkInAnimName;
|
||||
}
|
||||
|
||||
// StreamVersion needed for back compatibility.
|
||||
UInt8 plLinkToAgeInfo_StreamVersion = 0;
|
||||
void plLinkToAgeMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead( stream, mgr );
|
||||
UInt8 ltaVer = stream->ReadByte();
|
||||
fAgeLink.Read( stream, mgr );
|
||||
fLinkInAnimName = stream->ReadSafeString();
|
||||
}
|
||||
|
||||
void plLinkToAgeMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite( stream, mgr );
|
||||
stream->WriteByte( plLinkToAgeInfo_StreamVersion );
|
||||
fAgeLink.Write( stream, mgr );
|
||||
stream->WriteSafeString(fLinkInAnimName);
|
||||
}
|
||||
|
||||
enum LinkToAgeFlags
|
||||
{
|
||||
kLinkToAgeAgeLinkStruct,
|
||||
kLinkToAgeLinkAnimName,
|
||||
};
|
||||
|
||||
void plLinkToAgeMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if ( contentFlags.IsBitSet( kLinkToAgeAgeLinkStruct ) )
|
||||
fAgeLink.Read( s, mgr );
|
||||
if ( contentFlags.IsBitSet( kLinkToAgeLinkAnimName ) )
|
||||
fLinkInAnimName = s->ReadSafeString();
|
||||
}
|
||||
|
||||
void plLinkToAgeMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kLinkToAgeAgeLinkStruct);
|
||||
contentFlags.SetBit(kLinkToAgeLinkAnimName);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// write kLinkToAgeAgeLinkStruct
|
||||
fAgeLink.Write( s, mgr );
|
||||
s->WriteSafeString(fLinkInAnimName);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkingMgrMsg
|
||||
|
||||
plLinkingMgrMsg::plLinkingMgrMsg()
|
||||
: fLinkingMgrCmd( 0 /*plNetLinkingMgr::kNilCmd*/ )
|
||||
{
|
||||
}
|
||||
|
||||
plLinkingMgrMsg::~plLinkingMgrMsg()
|
||||
{
|
||||
}
|
||||
|
||||
enum LinkingMgrMsgFlags
|
||||
{
|
||||
kLinkingMgrCmd,
|
||||
kLinkingMgrArgs,
|
||||
};
|
||||
|
||||
void plLinkingMgrMsg::Read( hsStream* stream, hsResMgr* mgr )
|
||||
{
|
||||
plMessage::IMsgRead( stream, mgr );
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read( stream );
|
||||
|
||||
if ( contentFlags.IsBitSet( kLinkingMgrCmd ) )
|
||||
stream->ReadSwap( &fLinkingMgrCmd );
|
||||
if ( contentFlags.IsBitSet( kLinkingMgrArgs ) )
|
||||
fArgs.Read( stream, mgr );
|
||||
}
|
||||
|
||||
void plLinkingMgrMsg::Write( hsStream* stream, hsResMgr* mgr )
|
||||
{
|
||||
plMessage::IMsgWrite( stream, mgr );
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit( kLinkingMgrCmd );
|
||||
contentFlags.SetBit( kLinkingMgrArgs );
|
||||
contentFlags.Write( stream );
|
||||
|
||||
stream->WriteSwap( fLinkingMgrCmd );
|
||||
fArgs.Write( stream, mgr );
|
||||
}
|
||||
|
||||
void plLinkingMgrMsg::ReadVersion( hsStream* s, hsResMgr* mgr )
|
||||
{
|
||||
// Read() does the contentFlags thing.
|
||||
Read( s, mgr );
|
||||
}
|
||||
|
||||
void plLinkingMgrMsg::WriteVersion( hsStream* s, hsResMgr* mgr )
|
||||
{
|
||||
// Write() does the contentFlags thing.
|
||||
Write( s, mgr );
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkEffectsTriggerMsg
|
||||
|
||||
plLinkEffectsTriggerMsg::~plLinkEffectsTriggerMsg()
|
||||
{
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead( stream, mgr );
|
||||
|
||||
fInvisLevel = stream->ReadSwap32();
|
||||
fLeavingAge = stream->ReadBool();
|
||||
fLinkKey = mgr->ReadKey(stream);
|
||||
|
||||
// This variable is for internal use only. Still read/written for backwards compatability.
|
||||
fEffects = stream->ReadSwap32();
|
||||
fEffects = 0;
|
||||
|
||||
fLinkInAnimKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite( stream, mgr );
|
||||
|
||||
stream->WriteSwap32(fInvisLevel);
|
||||
stream->WriteBool(fLeavingAge);
|
||||
mgr->WriteKey(stream, fLinkKey);
|
||||
stream->WriteSwap32(fEffects);
|
||||
mgr->WriteKey(stream, fLinkInAnimKey);
|
||||
}
|
||||
|
||||
enum LinkEffectsFlags
|
||||
{
|
||||
kLinkEffectsLeavingAge,
|
||||
kLinkEffectsLinkKey,
|
||||
kLinkEffectsEffects,
|
||||
kLinkEffectsLinkInAnimKey,
|
||||
};
|
||||
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
void plLinkEffectsTriggerMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kLinkEffectsLeavingAge))
|
||||
fLeavingAge = s->ReadBool();
|
||||
if (contentFlags.IsBitSet(kLinkEffectsLinkKey))
|
||||
fLinkKey = mgr->ReadKey(s);
|
||||
if (contentFlags.IsBitSet(kLinkEffectsEffects))
|
||||
fEffects = s->ReadSwap32();
|
||||
if (contentFlags.IsBitSet(kLinkEffectsLinkInAnimKey))
|
||||
fLinkInAnimKey = mgr->ReadKey(s);
|
||||
|
||||
if (plNetClientApp::GetInstance() && fLinkKey == plNetClientApp::GetInstance()->GetLocalPlayerKey())
|
||||
{
|
||||
SetBCastFlag(plMessage::kNetStartCascade, true);
|
||||
SetBCastFlag(plMessage::kNetNonLocal | plMessage::kNetPropagate, false);
|
||||
}
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kLinkEffectsLeavingAge);
|
||||
contentFlags.SetBit(kLinkEffectsLinkKey);
|
||||
contentFlags.SetBit(kLinkEffectsEffects);
|
||||
contentFlags.SetBit(kLinkEffectsLinkInAnimKey);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kLinkEffectsLeavingAge
|
||||
s->WriteBool(fLeavingAge);
|
||||
// kLinkEffectsLinkKey
|
||||
mgr->WriteKey(s, fLinkKey);
|
||||
// kLinkEffectsEffects
|
||||
s->WriteSwap32(fEffects);
|
||||
// kLinkEffectsLinkInAnimKey
|
||||
mgr->WriteKey(s, fLinkInAnimKey);
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerMsg::SetLinkKey(plKey &key)
|
||||
{
|
||||
fLinkKey = key;
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerMsg::SetLinkInAnimKey(plKey &key)
|
||||
{
|
||||
fLinkInAnimKey = key;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkEffectsPrepMsg
|
||||
|
||||
plLinkEffectsTriggerPrepMsg::~plLinkEffectsTriggerPrepMsg()
|
||||
{
|
||||
if (fTrigger)
|
||||
hsRefCnt_SafeUnRef(fTrigger);
|
||||
}
|
||||
|
||||
void plLinkEffectsTriggerPrepMsg::SetTrigger(plLinkEffectsTriggerMsg *msg)
|
||||
{
|
||||
if (fTrigger)
|
||||
hsRefCnt_SafeUnRef(fTrigger);
|
||||
|
||||
hsRefCnt_SafeRef(msg);
|
||||
fTrigger = msg;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkEffectBCMsg
|
||||
|
||||
plLinkEffectBCMsg::plLinkEffectBCMsg() : fLinkKey(nil), fLinkFlags(0) { SetBCastFlag(plMessage::kBCastByExactType); }
|
||||
|
||||
void plLinkEffectBCMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fLinkKey = mgr->ReadKey(stream);
|
||||
fLinkFlags = stream->ReadSwap32();
|
||||
}
|
||||
|
||||
void plLinkEffectBCMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fLinkKey);
|
||||
stream->WriteSwap32(fLinkFlags);
|
||||
}
|
||||
|
||||
void plLinkEffectBCMsg::SetLinkFlag(UInt32 flag, hsBool on /* = true */)
|
||||
{
|
||||
if (on)
|
||||
fLinkFlags |= flag;
|
||||
else
|
||||
fLinkFlags &= ~flag;
|
||||
}
|
||||
|
||||
hsBool plLinkEffectBCMsg::HasLinkFlag(UInt32 flag)
|
||||
{
|
||||
return fLinkFlags & flag;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkEffectPrepBCMsg
|
||||
|
||||
plLinkEffectPrepBCMsg::plLinkEffectPrepBCMsg() : fLinkKey(nil), fLeavingAge(false) { SetBCastFlag(plMessage::kBCastByExactType); }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// plLinkCallbacks
|
||||
|
||||
void plLinkCallbackMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plEventCallbackMsg::Read(stream, mgr);
|
||||
|
||||
fLinkKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void plLinkCallbackMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plEventCallbackMsg::Write(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fLinkKey);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
////
|
||||
//// plPseudoLinkEffectMsg
|
||||
|
||||
plPseudoLinkEffectMsg::plPseudoLinkEffectMsg() : fLinkObjKey(nil), fAvatarKey(nil)
|
||||
{
|
||||
SetBCastFlag(plMessage::kNetPropagate | plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
void plPseudoLinkEffectMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fLinkObjKey = mgr->ReadKey(stream);
|
||||
fAvatarKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void plPseudoLinkEffectMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
mgr->WriteKey(stream, fLinkObjKey);
|
||||
mgr->WriteKey(stream, fAvatarKey);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
////
|
||||
//// plPseudoLinkAnimTriggerMsg
|
||||
|
||||
plPseudoLinkAnimTriggerMsg::plPseudoLinkAnimTriggerMsg() : fForward(false)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
|
||||
plPseudoLinkAnimTriggerMsg::plPseudoLinkAnimTriggerMsg(hsBool forward, plKey avatarKey)
|
||||
{
|
||||
fForward = forward;
|
||||
fAvatarKey = avatarKey;
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
void plPseudoLinkAnimTriggerMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream,mgr);
|
||||
fForward = stream->ReadBool();
|
||||
fAvatarKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void plPseudoLinkAnimTriggerMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream,mgr);
|
||||
stream->WriteBool(fForward);
|
||||
mgr->WriteKey(stream, fAvatarKey);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
////
|
||||
//// plPseudoLinkAnimCallbackMsg
|
||||
|
||||
|
||||
void plPseudoLinkAnimCallbackMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream,mgr);
|
||||
mgr->WriteKey(stream, fAvatarKey);
|
||||
}
|
||||
|
||||
void plPseudoLinkAnimCallbackMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream,mgr);
|
||||
mgr->WriteKey(stream, fAvatarKey);
|
||||
}
|
300
Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h
Normal file
300
Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.h
Normal file
@ -0,0 +1,300 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plLinkToAgeMsg_INC
|
||||
#define plLinkToAgeMsg_INC
|
||||
|
||||
#include "../pnMessage/plMessageWithCallbacks.h"
|
||||
#include "../pnMessage/plEventCallbackMsg.h"
|
||||
#include "../plNetCommon/plNetServerSessionInfo.h"
|
||||
#include "../plNetCommon/plNetCommonHelpers.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// A msg which is sent to the networking system to cause the player to link
|
||||
// to a new age.
|
||||
//
|
||||
class plKey;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plLinkToAgeMsg : public plMessage
|
||||
{
|
||||
plAgeLinkStruct fAgeLink;
|
||||
char* fLinkInAnimName;
|
||||
|
||||
public:
|
||||
plLinkToAgeMsg();
|
||||
plLinkToAgeMsg( const plAgeLinkStruct * link );
|
||||
~plLinkToAgeMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plLinkToAgeMsg );
|
||||
GETINTERFACE_ANY( plLinkToAgeMsg, plMessage );
|
||||
|
||||
plAgeLinkStruct * GetAgeLink() { return &fAgeLink; }
|
||||
const plAgeLinkStruct * GetAgeLink() const { return &fAgeLink; }
|
||||
|
||||
const char * GetLinkInAnimName() { return fLinkInAnimName; }
|
||||
void SetLinkInAnimName(const char* name) { delete [] fLinkInAnimName; fLinkInAnimName = hsStrcpy(name); }
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
// WriteVersion writes the current version of this creatable and ReadVersion will read in
|
||||
// any previous version.
|
||||
virtual void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
virtual void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// For other things the linking mgr does besides linking players to ages.
|
||||
// See plNetLinkingMgr::Cmds for a list of these.
|
||||
|
||||
class plLinkingMgrMsg : public plMessage
|
||||
{
|
||||
UInt8 fLinkingMgrCmd;
|
||||
plCreatableListHelper fArgs;
|
||||
|
||||
public:
|
||||
plLinkingMgrMsg();
|
||||
~plLinkingMgrMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plLinkingMgrMsg );
|
||||
GETINTERFACE_ANY( plLinkingMgrMsg, plMessage );
|
||||
|
||||
UInt8 GetCmd() const { return fLinkingMgrCmd; }
|
||||
void SetCmd( UInt8 v ) { fLinkingMgrCmd=v; }
|
||||
plCreatableListHelper * GetArgs() { return &fArgs; }
|
||||
|
||||
void Read( hsStream* stream, hsResMgr* mgr );
|
||||
void Write( hsStream* stream, hsResMgr* mgr );
|
||||
|
||||
void ReadVersion( hsStream* s, hsResMgr* mgr );
|
||||
void WriteVersion( hsStream* s, hsResMgr* mgr );
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plLinkEffectsTriggerMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
hsBool fLeavingAge;
|
||||
plKey fLinkKey;
|
||||
plKey fLinkInAnimKey;
|
||||
int fInvisLevel;
|
||||
public:
|
||||
plLinkEffectsTriggerMsg() : fLeavingAge(true), fLinkKey(nil), fLinkInAnimKey(nil), fEffects(0), fInvisLevel(0) { }
|
||||
~plLinkEffectsTriggerMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plLinkEffectsTriggerMsg );
|
||||
GETINTERFACE_ANY( plLinkEffectsTriggerMsg, plMessage );
|
||||
|
||||
void SetInvisLevel(int invisLevel) { fInvisLevel=invisLevel; }
|
||||
int GetInvisLevel() { return fInvisLevel; }
|
||||
|
||||
void SetLeavingAge(hsBool leaving) { fLeavingAge = leaving; }
|
||||
hsBool IsLeavingAge() { return fLeavingAge; }
|
||||
|
||||
void SetLinkKey(plKey &key);
|
||||
const plKey GetLinkKey() const { return fLinkKey; }
|
||||
|
||||
void SetLinkInAnimKey(plKey &key);
|
||||
plKey GetLinkInAnimKey() { return fLinkInAnimKey; }
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
Int32 fEffects;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plLinkEffectsTriggerPrepMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
plLinkEffectsTriggerMsg *fTrigger;
|
||||
|
||||
public:
|
||||
hsBool fLeavingAge;
|
||||
plKey fLinkKey;
|
||||
|
||||
plLinkEffectsTriggerPrepMsg() : fLeavingAge(false), fLinkKey(nil), fTrigger(nil) { }
|
||||
~plLinkEffectsTriggerPrepMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plLinkEffectsTriggerPrepMsg );
|
||||
GETINTERFACE_ANY( plLinkEffectsTriggerPrepMsg, plMessage );
|
||||
|
||||
void SetTrigger(plLinkEffectsTriggerMsg *msg);
|
||||
plLinkEffectsTriggerMsg *GetTrigger() { return fTrigger; }
|
||||
|
||||
// runtime-local only, no I/O
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
class plLinkEffectBCMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
UInt32 fLinkFlags;
|
||||
|
||||
public:
|
||||
enum // link flags
|
||||
{
|
||||
kLeavingAge = 0x1,
|
||||
kSendCallback = 0x2,
|
||||
kMute = 0x4 // don't play any sound
|
||||
};
|
||||
|
||||
plLinkEffectBCMsg();
|
||||
~plLinkEffectBCMsg() { }
|
||||
|
||||
CLASSNAME_REGISTER( plLinkEffectBCMsg );
|
||||
GETINTERFACE_ANY( plLinkEffectBCMsg, plMessage );
|
||||
|
||||
// These messages should never be sent over the net, so I'm
|
||||
// suspicious that R/W actually does something... but if
|
||||
// it isn't broken, I'm not going to touch it.
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void SetLinkFlag(UInt32 flag, hsBool on = true);
|
||||
hsBool HasLinkFlag(UInt32 flag);
|
||||
|
||||
plKey fLinkKey;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plLinkEffectPrepBCMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
hsBool fLeavingAge;
|
||||
plKey fLinkKey;
|
||||
|
||||
plLinkEffectPrepBCMsg();
|
||||
~plLinkEffectPrepBCMsg() { }
|
||||
|
||||
CLASSNAME_REGISTER( plLinkEffectPrepBCMsg );
|
||||
GETINTERFACE_ANY( plLinkEffectPrepBCMsg, plMessage );
|
||||
|
||||
// runtime-local only, no I/O
|
||||
void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plLinkCallbackMsg : public plEventCallbackMsg
|
||||
{
|
||||
public:
|
||||
plLinkCallbackMsg() { }
|
||||
~plLinkCallbackMsg() { }
|
||||
|
||||
CLASSNAME_REGISTER( plLinkCallbackMsg );
|
||||
GETINTERFACE_ANY( plLinkCallbackMsg, plEventCallbackMsg );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
plKey fLinkKey;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plPseudoLinkEffectMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plKey fLinkObjKey;
|
||||
plKey fAvatarKey;
|
||||
|
||||
plPseudoLinkEffectMsg();
|
||||
~plPseudoLinkEffectMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER(plPseudoLinkEffectMsg);
|
||||
GETINTERFACE_ANY(plPseudoLinkEffectMsg, plMessage);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
};
|
||||
|
||||
class plPseudoLinkAnimTriggerMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
|
||||
plPseudoLinkAnimTriggerMsg();
|
||||
plPseudoLinkAnimTriggerMsg(hsBool forward, plKey avatarKey);
|
||||
~plPseudoLinkAnimTriggerMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER(plPseudoLinkAnimTriggerMsg);
|
||||
GETINTERFACE_ANY(plPseudoLinkAnimTriggerMsg, plMessage);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
plKey fAvatarKey;
|
||||
hsBool fForward;
|
||||
|
||||
};
|
||||
|
||||
class plPseudoLinkAnimCallbackMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
|
||||
plPseudoLinkAnimCallbackMsg() {;}
|
||||
~plPseudoLinkAnimCallbackMsg() {;}
|
||||
|
||||
CLASSNAME_REGISTER(plPseudoLinkAnimCallbackMsg);
|
||||
GETINTERFACE_ANY(plPseudoLinkAnimCallbackMsg, plMessage);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
plKey fAvatarKey;
|
||||
};
|
||||
#endif // plLinkToAgeMsg_INC
|
103
Sources/Plasma/PubUtilLib/plMessage/plListenerMsg.cpp
Normal file
103
Sources/Plasma/PubUtilLib/plMessage/plListenerMsg.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsStream.h"
|
||||
#include "plListenerMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include "../pnKeyedObject/plFixedKey.h"
|
||||
|
||||
|
||||
void plListenerMsg::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
fPos.Read(s);
|
||||
fDir.Read(s);
|
||||
fUp.Read(s);
|
||||
fVel.Read(s);
|
||||
}
|
||||
void plListenerMsg::Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
fPos.Write(s);
|
||||
fDir.Write(s);
|
||||
fUp.Write(s);
|
||||
fVel.Write(s);
|
||||
}
|
||||
|
||||
|
||||
plSetListenerMsg::plSetListenerMsg( UInt8 type, const plKey &srcKey, hsBool binding ) : plMessage( nil, nil, nil )
|
||||
{
|
||||
plUoid uoid( kListenerMod_KEY );
|
||||
plKey pLKey = hsgResMgr::ResMgr()->FindKey( uoid );
|
||||
AddReceiver( pLKey );
|
||||
Set( srcKey, type, binding );
|
||||
}
|
||||
|
||||
plSetListenerMsg::~plSetListenerMsg()
|
||||
{
|
||||
}
|
||||
|
||||
void plSetListenerMsg::Read( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
fType = s->ReadByte();
|
||||
fSrcKey = mgr->ReadKey( s );
|
||||
fBinding = s->ReadBool();
|
||||
}
|
||||
|
||||
void plSetListenerMsg::Write( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
s->WriteByte( fType );
|
||||
mgr->WriteKey( s, fSrcKey );
|
||||
s->WriteBool( fBinding );
|
||||
}
|
||||
|
||||
void plSetListenerMsg::Set( const plKey &key, UInt8 type, hsBool binding )
|
||||
{
|
||||
fSrcKey = key;
|
||||
fType = (UInt8)type;
|
||||
fBinding = binding;
|
||||
}
|
||||
|
122
Sources/Plasma/PubUtilLib/plMessage/plListenerMsg.h
Normal file
122
Sources/Plasma/PubUtilLib/plMessage/plListenerMsg.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plListenerMsg_inc
|
||||
#define plListenerMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class plListenerMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
hsPoint3 fPos;
|
||||
hsVector3 fDir;
|
||||
hsVector3 fUp;
|
||||
hsVector3 fVel;
|
||||
|
||||
public:
|
||||
plListenerMsg() : plMessage(nil, nil, nil),
|
||||
fPos(0,0,0),
|
||||
fDir(0,1.f,0),
|
||||
fUp(0,0,1.f),
|
||||
fVel(0,0,0)
|
||||
{ SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
~plListenerMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plListenerMsg );
|
||||
GETINTERFACE_ANY( plListenerMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
const hsPoint3& SetPosition(const hsPoint3& pos) { return fPos = pos; }
|
||||
const hsVector3& SetDirection(const hsVector3& dir) { return fDir = dir; }
|
||||
const hsVector3& SetUp(const hsVector3& up) { return fUp = up; }
|
||||
const hsVector3& SetVelocity(const hsVector3& vel) { return fVel = vel; }
|
||||
|
||||
const hsPoint3& GetPosition() const { return fPos; }
|
||||
const hsVector3& GetDirection() const { return fDir; }
|
||||
const hsVector3& GetUp() const { return fUp; }
|
||||
const hsVector3& GetVelocity() const { return fVel; }
|
||||
};
|
||||
|
||||
class plSetListenerMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
UInt8 fType;
|
||||
plKey fSrcKey;
|
||||
hsBool fBinding;
|
||||
|
||||
public:
|
||||
|
||||
enum SrcType
|
||||
{
|
||||
kPosition = 0x01,
|
||||
kVelocity = 0x02,
|
||||
kFacing = 0x04,
|
||||
kVCam = 0x08,
|
||||
|
||||
kListener = kPosition | kVelocity | kFacing
|
||||
};
|
||||
|
||||
plSetListenerMsg() : plMessage( nil, nil, nil ) { fType = 0; fBinding = false; }
|
||||
plSetListenerMsg( UInt8 type, const plKey &srcKey, hsBool binding );
|
||||
~plSetListenerMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plSetListenerMsg );
|
||||
GETINTERFACE_ANY( plSetListenerMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
void Set( const plKey &key, UInt8 type, hsBool binding );
|
||||
|
||||
plKey &GetSrcKey( void ) { return fSrcKey; }
|
||||
UInt8 GetType( void ) const { return fType; }
|
||||
hsBool IsBinding( void ) const { return fBinding; }
|
||||
};
|
||||
|
||||
#endif // plListenerMsg_inc
|
135
Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp
Normal file
135
Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp
Normal file
@ -0,0 +1,135 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsStream.h"
|
||||
#include "plLoadAgeMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsUtils.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
void plLoadAgeMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
delete [] fAgeFilename;
|
||||
|
||||
// read agename
|
||||
UInt8 len;
|
||||
stream->ReadSwap(&len);
|
||||
if (len)
|
||||
{
|
||||
fAgeFilename=TRACKED_NEW char[len+1];
|
||||
stream->Read(len, fAgeFilename);
|
||||
fAgeFilename[len]=0;
|
||||
}
|
||||
fUnload = stream->ReadBool();
|
||||
stream->ReadSwap(&fPlayerID);
|
||||
fAgeGuid.Read(stream);
|
||||
}
|
||||
|
||||
void plLoadAgeMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
// write agename
|
||||
UInt8 len=fAgeFilename?hsStrlen(fAgeFilename):0;
|
||||
stream->WriteSwap(len);
|
||||
if (len)
|
||||
{
|
||||
stream->Write(len, fAgeFilename);
|
||||
}
|
||||
stream->WriteBool(fUnload);
|
||||
stream->WriteSwap(fPlayerID);
|
||||
fAgeGuid.Write(stream);
|
||||
}
|
||||
|
||||
enum LoadAgeFlags
|
||||
{
|
||||
kLoadAgeAgeName,
|
||||
kLoadAgeUnload,
|
||||
kLoadAgePlayerID,
|
||||
kLoadAgeAgeGuid,
|
||||
};
|
||||
|
||||
void plLoadAgeMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(s);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAgeAgeName))
|
||||
{
|
||||
// read agename
|
||||
delete [] fAgeFilename;
|
||||
fAgeFilename = s->ReadSafeString();
|
||||
}
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAgeUnload))
|
||||
fUnload = s->ReadBool();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAgePlayerID))
|
||||
s->ReadSwap(&fPlayerID);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAgeAgeGuid))
|
||||
fAgeGuid.Read(s);
|
||||
}
|
||||
|
||||
void plLoadAgeMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(s, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kLoadAgeAgeName);
|
||||
contentFlags.SetBit(kLoadAgeUnload);
|
||||
contentFlags.SetBit(kLoadAgePlayerID);
|
||||
contentFlags.SetBit(kLoadAgeAgeGuid);
|
||||
contentFlags.Write(s);
|
||||
|
||||
// kLoadAgeAgeName
|
||||
s->WriteSafeString(fAgeFilename);
|
||||
// kLoadAgeUnload
|
||||
s->WriteBool(fUnload);
|
||||
// kLoadAgePlayerID
|
||||
s->WriteSwap(fPlayerID);
|
||||
// kLoadAgeAgeGuid
|
||||
fAgeGuid.Write(s);
|
||||
}
|
122
Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h
Normal file
122
Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plLoadAgeMsg_INC
|
||||
#define plLoadAgeMsg_INC
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plUUID/plUUID.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
//
|
||||
// A msg which is sent to the networking system to cause an age to be loaded or unloaded
|
||||
//
|
||||
class plKey;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
class plLoadAgeMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
char* fAgeFilename; // the age to load/unload
|
||||
plUUID fAgeGuid;
|
||||
hsBool fUnload; // true if we want to unload the age
|
||||
int fPlayerID;
|
||||
public:
|
||||
plLoadAgeMsg() : fAgeFilename(nil), fUnload(false), fPlayerID(-1){ }
|
||||
virtual ~plLoadAgeMsg() { delete [] fAgeFilename; }
|
||||
|
||||
CLASSNAME_REGISTER( plLoadAgeMsg );
|
||||
GETINTERFACE_ANY( plLoadAgeMsg, plMessage );
|
||||
|
||||
void SetAgeFilename(const char* a) { delete [] fAgeFilename; fAgeFilename=a?hsStrcpy(a):nil; }
|
||||
char* GetAgeFilename() const { return fAgeFilename; }
|
||||
|
||||
void SetAgeGuid( const plUUID * v ) { fAgeGuid.CopyFrom( v ); }
|
||||
const plUUID * GetAgeGuid() const { return &fAgeGuid; }
|
||||
|
||||
void SetLoading(hsBool l) { fUnload=!l; }
|
||||
hsBool GetLoading() const { return !fUnload; }
|
||||
|
||||
void SetPlayerID(int p) { fPlayerID=p; }
|
||||
int GetPlayerID() const { return fPlayerID; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* s, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
//
|
||||
// Internal msg, sent by NetClientMgr to unload an age when linking out.
|
||||
// Should not be used for other purposes
|
||||
//
|
||||
class plLinkOutUnloadMsg : public plLoadAgeMsg
|
||||
{
|
||||
public:
|
||||
plLinkOutUnloadMsg() { fUnload=true; }
|
||||
|
||||
CLASSNAME_REGISTER( plLinkOutUnloadMsg );
|
||||
GETINTERFACE_ANY( plLinkOutUnloadMsg, plLoadAgeMsg );
|
||||
};
|
||||
|
||||
//
|
||||
// Internal msg, used by NetClientMgr.
|
||||
// (we send another to the avatar that linked)
|
||||
// Not meant to go over the wire.
|
||||
//
|
||||
class plLinkInDoneMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
|
||||
CLASSNAME_REGISTER( plLinkInDoneMsg );
|
||||
GETINTERFACE_ANY( plLinkInDoneMsg, plMessage );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { IMsgWrite(stream, mgr); }
|
||||
|
||||
void ReadVersion(hsStream* stream, hsResMgr* mgr) { IMsgRead(stream, mgr); };
|
||||
void WriteVersion(hsStream* stream, hsResMgr* mgr) { IMsgWrite(stream, mgr); };
|
||||
|
||||
};
|
||||
|
||||
#endif // plLoadAgeMsg
|
241
Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.cpp
Normal file
241
Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.cpp
Normal file
@ -0,0 +1,241 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
#include "hsStream.h"
|
||||
#include "plLoadAvatarMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
#include "../pnNetCommon/plSynchedObject.h"
|
||||
|
||||
#include "../plAvatar/plAvatarTasks.h"
|
||||
|
||||
|
||||
//////////////////
|
||||
// PLLOADAVATARMSG
|
||||
//////////////////
|
||||
|
||||
// CTOR (default)
|
||||
plLoadAvatarMsg::plLoadAvatarMsg()
|
||||
: fIsPlayer(false),
|
||||
fSpawnPoint(nil),
|
||||
fInitialTask(nil),
|
||||
fUserStr(nil)
|
||||
{
|
||||
}
|
||||
|
||||
// CTOR uoidToClone, requestorKey, userData, isPlayer, spawnPOint, initialTask
|
||||
plLoadAvatarMsg::plLoadAvatarMsg(const plUoid &uoidToClone, const plKey &requestorKey, UInt32 userData,
|
||||
hsBool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const char* userStr /*= nil*/)
|
||||
: plLoadCloneMsg(uoidToClone, requestorKey, userData),
|
||||
fIsPlayer(isPlayer),
|
||||
fSpawnPoint(spawnPoint),
|
||||
fInitialTask(initialTask),
|
||||
fUserStr(nil) // setting to nil so SetUserStr doesn't try to nuke garbage
|
||||
{
|
||||
SetUserStr(userStr);
|
||||
}
|
||||
|
||||
plLoadAvatarMsg::plLoadAvatarMsg(const plKey &existing, const plKey &requestor, UInt32 userData,
|
||||
hsBool isPlayer, hsBool 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
|
||||
{
|
||||
SetUserStr(userStr);
|
||||
}
|
||||
|
||||
|
||||
// DTOR
|
||||
plLoadAvatarMsg::~plLoadAvatarMsg()
|
||||
{
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plLoadCloneMsg::Read(stream, mgr);
|
||||
fIsPlayer = stream->ReadBool();
|
||||
fSpawnPoint = mgr->ReadKey(stream);
|
||||
if(stream->ReadBool())
|
||||
{
|
||||
fInitialTask = plAvTask::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
}
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
fUserStr = stream->ReadSafeString();
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plLoadCloneMsg::Write(stream, mgr);
|
||||
stream->WriteBool(fIsPlayer);
|
||||
mgr->WriteKey(stream, fSpawnPoint);
|
||||
if(fInitialTask)
|
||||
{
|
||||
stream->WriteBool(true);
|
||||
mgr->WriteCreatable(stream, fInitialTask);
|
||||
} else {
|
||||
stream->WriteBool(false);
|
||||
}
|
||||
stream->WriteSafeString(fUserStr);
|
||||
}
|
||||
|
||||
enum LoadAvatarMsgFlags
|
||||
{
|
||||
kLoadAvatarMsgIsPlayer,
|
||||
kLoadAvatarMsgSpawnPoint,
|
||||
kLoadAvatarMsgUserStr,
|
||||
};
|
||||
|
||||
void plLoadAvatarMsg::ReadVersion(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plLoadCloneMsg::ReadVersion(stream, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(stream);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAvatarMsgIsPlayer))
|
||||
fIsPlayer = stream->ReadBool();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadAvatarMsgSpawnPoint))
|
||||
fSpawnPoint = mgr->ReadKey(stream);
|
||||
|
||||
if (fUserStr)
|
||||
{
|
||||
delete [] fUserStr;
|
||||
fUserStr = nil;
|
||||
}
|
||||
if (contentFlags.IsBitSet(kLoadAvatarMsgUserStr))
|
||||
fUserStr = stream->ReadSafeString();
|
||||
}
|
||||
|
||||
void plLoadAvatarMsg::WriteVersion(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plLoadCloneMsg::WriteVersion(stream, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kLoadAvatarMsgIsPlayer);
|
||||
contentFlags.SetBit(kLoadAvatarMsgSpawnPoint);
|
||||
contentFlags.SetBit(kLoadAvatarMsgUserStr);
|
||||
contentFlags.Write(stream);
|
||||
|
||||
// kLoadAvatarMsgIsPlayer
|
||||
stream->WriteBool(fIsPlayer);
|
||||
|
||||
// kLoadAvatarMsgSpawnPoint
|
||||
mgr->WriteKey(stream, fSpawnPoint);
|
||||
|
||||
// kLoadAvatarMsgUserStr
|
||||
stream->WriteSafeString(fUserStr);
|
||||
}
|
||||
|
||||
// SETISPLAYER
|
||||
void plLoadAvatarMsg::SetIsPlayer(bool is)
|
||||
{
|
||||
fIsPlayer = is;
|
||||
}
|
||||
|
||||
// GETISPLAYER
|
||||
hsBool 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 = TRACKED_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
|
137
Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h
Normal file
137
Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h
Normal file
@ -0,0 +1,137 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
#ifndef plLoadAvatarMsg_INC
|
||||
#define plLoadAvatarMsg_INC
|
||||
|
||||
#include "plLoadCloneMsg.h"
|
||||
#include "hsUtils.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
|
||||
class plAvTask;
|
||||
|
||||
//
|
||||
// A msg which is sent to the networking system
|
||||
// to cause a player to be loaded or unloaded
|
||||
//
|
||||
class plKey;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
// not sure if we need this yet, but it's already in the index so here's just enough
|
||||
// implementation to keep the compiler happy.
|
||||
class plLoadAvatarMsg : public plLoadCloneMsg
|
||||
{
|
||||
public:
|
||||
plLoadAvatarMsg();
|
||||
/** Canonical constructor. If you're trying to initiate a clone, this is
|
||||
the one you want to use.
|
||||
These messages are *always* sent to the net client manager. You can't
|
||||
address them.
|
||||
After they are received on the remote machines, they are forwarded
|
||||
the remote versions of the requestor.
|
||||
|
||||
\param uoidToClone - Specifies the template that will be cloned.
|
||||
\param requestorKey - The key of the object that is requesting the clone. It's
|
||||
strongly recommended that this be a local object, so that we don't get the same
|
||||
requestor creating multiple clones by starting the process on several machines.
|
||||
\param userData - Whatever you want. Will be propagated to the requestor after cloning.
|
||||
\param isPlayer - this is a player, not an NPC
|
||||
\param spawnPoint - warp to this spot after loading
|
||||
\param initialTask - queue up this task after loading (and spawning)
|
||||
\param userStr - a string that the user can set
|
||||
*/
|
||||
plLoadAvatarMsg(const plUoid &uoidToClone, const plKey &requestorKey, UInt32 userData,
|
||||
hsBool isPlayer, const plKey &spawnPoint, plAvTask *initialTask, const char *userStr = nil);
|
||||
|
||||
/** 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.
|
||||
\param existing - The key to the clone you want to unload
|
||||
\param requestorKey - The key of the object that is requesting the clone. It's
|
||||
strongly recommended that this be a local object, so that we don't get the same
|
||||
requestor creating multiple clones by starting the process on several machines.
|
||||
\param userData - Whatever you want. Will be propagated to the requestor after cloning.
|
||||
\param isPlayer - this is a player, not an NPC
|
||||
\param isLoading - Are we loading or unloading?
|
||||
\param userStr - a string that the user can set
|
||||
*/
|
||||
plLoadAvatarMsg(const plKey &existing, const plKey &requestorKey, UInt32 userData,
|
||||
hsBool isPlayer, hsBool isLoading, const char *userStr = nil);
|
||||
|
||||
virtual ~plLoadAvatarMsg();
|
||||
|
||||
void SetIsPlayer(bool is);
|
||||
hsBool GetIsPlayer();
|
||||
|
||||
void SetSpawnPoint(const plKey &spawnSceneObjectKey);
|
||||
plKey GetSpawnPoint();
|
||||
|
||||
void SetInitialTask(plAvTask *task);
|
||||
plAvTask * GetInitialTask();
|
||||
|
||||
void SetUserStr(const char *userStr);
|
||||
const char* GetUserStr();
|
||||
|
||||
CLASSNAME_REGISTER(plLoadAvatarMsg);
|
||||
GETINTERFACE_ANY(plLoadAvatarMsg, plLoadCloneMsg);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* stream, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
protected:
|
||||
hsBool fIsPlayer;
|
||||
plKey fSpawnPoint;
|
||||
plAvTask *fInitialTask;
|
||||
char *fUserStr;
|
||||
};
|
||||
|
||||
|
||||
#endif // plLoadAvatarMsg_INC
|
||||
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
276
Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp
Normal file
276
Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp
Normal file
@ -0,0 +1,276 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
// singular
|
||||
#include "plLoadAvatarMsg.h"
|
||||
|
||||
// global
|
||||
#include "hsResMgr.h"
|
||||
|
||||
// other
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
#include "hsTypes.h"
|
||||
|
||||
|
||||
|
||||
// CTOR / default
|
||||
plLoadCloneMsg::plLoadCloneMsg()
|
||||
: fValidMsg(false),
|
||||
fOriginatingPlayerID(0),
|
||||
fTriggerMsg(nil)
|
||||
{
|
||||
SetBCastFlag(plMessage::kNetPropagate);
|
||||
};
|
||||
|
||||
// CTOR uoidToClone, requestorKey, userData, isLoading
|
||||
// this form is for creating new clones
|
||||
plLoadCloneMsg::plLoadCloneMsg(const plUoid &uoidToClone, const plKey &requestorKey, UInt32 userData)
|
||||
: fRequestorKey(requestorKey),
|
||||
fUserData(userData),
|
||||
fValidMsg(false),
|
||||
fTriggerMsg(nil),
|
||||
fIsLoading(true) // this constructor form is only used for loading
|
||||
{
|
||||
SetBCastFlag(plMessage::kNetPropagate);
|
||||
|
||||
hsKeyedObject * koRequestor = fRequestorKey->ObjectIsLoaded();
|
||||
if(koRequestor)
|
||||
{
|
||||
plNetClientApp *app = plNetClientApp::GetInstance();
|
||||
plKey originalKey = hsgResMgr::ResMgr()->FindKey(uoidToClone);
|
||||
|
||||
if(originalKey)
|
||||
{
|
||||
// all is well. finish it off.
|
||||
fCloneKey = hsgResMgr::ResMgr()->CloneKey(originalKey);
|
||||
fOriginatingPlayerID = app->GetPlayerID();
|
||||
fValidMsg = true;
|
||||
this->AddReceiver(plNetApp::GetInstance()->GetKey());
|
||||
} else {
|
||||
char buffer[128];
|
||||
sprintf(buffer, "Can't find key named %s", uoidToClone.GetObjectName());
|
||||
hsAssert(0, buffer);
|
||||
}
|
||||
} else {
|
||||
hsStatusMessage("Clone requestor is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
// CTOR existing, requestor, userData, isLoading
|
||||
// this form is for unloading or other operations on existing clones
|
||||
plLoadCloneMsg::plLoadCloneMsg(const plKey &existing, const plKey &requestor, UInt32 userData, hsBool isLoading)
|
||||
: fCloneKey(existing),
|
||||
fRequestorKey(requestor),
|
||||
fUserData(userData),
|
||||
fValidMsg(true),
|
||||
fTriggerMsg(nil),
|
||||
fIsLoading(isLoading)
|
||||
{
|
||||
if (plNetApp::GetInstance())
|
||||
{
|
||||
SetBCastFlag(plMessage::kNetPropagate);
|
||||
AddReceiver(plNetApp::GetInstance()->GetKey());
|
||||
}
|
||||
if (plNetClientApp::GetInstance())
|
||||
fOriginatingPlayerID = plNetClientApp::GetInstance()->GetPlayerID();
|
||||
hsAssert(fRequestorKey->ObjectIsLoaded(), "Clone (unloading) requestor is not loaded.");
|
||||
}
|
||||
|
||||
plLoadCloneMsg::~plLoadCloneMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fTriggerMsg);
|
||||
}
|
||||
|
||||
// READ
|
||||
void plLoadCloneMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fCloneKey = mgr->ReadKey(stream);
|
||||
fRequestorKey = mgr->ReadKey(stream);
|
||||
fOriginatingPlayerID = stream->ReadSwap32();
|
||||
fUserData = stream->ReadSwap32();
|
||||
fValidMsg = stream->ReadBool();
|
||||
fIsLoading = stream->ReadBool();
|
||||
fTriggerMsg = plMessage::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
}
|
||||
|
||||
// WRITE
|
||||
void plLoadCloneMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream,mgr);
|
||||
mgr->WriteKey(stream, fCloneKey);
|
||||
mgr->WriteKey(stream, fRequestorKey);
|
||||
stream->WriteSwap32(fOriginatingPlayerID);
|
||||
stream->WriteSwap32(fUserData);
|
||||
stream->WriteBool(fValidMsg);
|
||||
stream->WriteBool(fIsLoading);
|
||||
mgr->WriteCreatable(stream, fTriggerMsg);
|
||||
}
|
||||
|
||||
enum LoadCloneMsgFlags
|
||||
{
|
||||
kLoadCloneMsgCloneKey,
|
||||
kLoadCloneMsgRequestorKey,
|
||||
kLoadCloneMsgOrigPlayerID,
|
||||
kLoadCloneMsgUserData,
|
||||
kLoadCloneMsgValidMsg,
|
||||
kLoadCloneMsgIsLoading,
|
||||
kLoadCloneMsgTriggerMsg,
|
||||
};
|
||||
|
||||
void plLoadCloneMsg::ReadVersion(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(stream, mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.Read(stream);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgCloneKey))
|
||||
fCloneKey = mgr->ReadKey(stream);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgRequestorKey))
|
||||
fRequestorKey = mgr->ReadKey(stream);
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgOrigPlayerID))
|
||||
fOriginatingPlayerID = stream->ReadSwap32();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgUserData))
|
||||
fUserData = stream->ReadSwap32();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgValidMsg))
|
||||
fValidMsg = stream->ReadBool();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgIsLoading))
|
||||
fIsLoading = stream->ReadBool();
|
||||
|
||||
if (contentFlags.IsBitSet(kLoadCloneMsgTriggerMsg))
|
||||
fTriggerMsg = plMessage::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
}
|
||||
|
||||
void plLoadCloneMsg::WriteVersion(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWriteVersion(stream,mgr);
|
||||
|
||||
hsBitVector contentFlags;
|
||||
contentFlags.SetBit(kLoadCloneMsgCloneKey);
|
||||
contentFlags.SetBit(kLoadCloneMsgRequestorKey);
|
||||
contentFlags.SetBit(kLoadCloneMsgOrigPlayerID);
|
||||
contentFlags.SetBit(kLoadCloneMsgUserData);
|
||||
contentFlags.SetBit(kLoadCloneMsgValidMsg);
|
||||
contentFlags.SetBit(kLoadCloneMsgIsLoading);
|
||||
contentFlags.SetBit(kLoadCloneMsgTriggerMsg);
|
||||
contentFlags.Write(stream);
|
||||
|
||||
// kLoadCloneMsgCloneKey
|
||||
mgr->WriteKey(stream, fCloneKey);
|
||||
// kLoadCloneMsgRequestorKey
|
||||
mgr->WriteKey(stream, fRequestorKey);
|
||||
// kLoadCloneMsgOrigPlayerID
|
||||
stream->WriteSwap32(fOriginatingPlayerID);
|
||||
// kLoadCloneMsgUserData
|
||||
stream->WriteSwap32(fUserData);
|
||||
// kLoadCloneMsgValidMsg
|
||||
stream->WriteBool(fValidMsg);
|
||||
// kLoadCloneMsgIsLoading
|
||||
stream->WriteBool(fIsLoading);
|
||||
// kLoadCloneMsgTriggerMSg
|
||||
mgr->WriteCreatable(stream, fTriggerMsg);
|
||||
}
|
||||
|
||||
// GETCLONEKEY
|
||||
plKey plLoadCloneMsg::GetCloneKey()
|
||||
{
|
||||
return fCloneKey;
|
||||
}
|
||||
|
||||
// GETREQUESTORKEY
|
||||
plKey plLoadCloneMsg::GetRequestorKey()
|
||||
{
|
||||
return fRequestorKey;
|
||||
}
|
||||
|
||||
// ISVALIDMESSAGE
|
||||
hsBool plLoadCloneMsg::IsValidMessage()
|
||||
{
|
||||
return fValidMsg;
|
||||
}
|
||||
|
||||
// GETUSERDATA
|
||||
UInt32 plLoadCloneMsg::GetUserData()
|
||||
{
|
||||
return fUserData;
|
||||
}
|
||||
|
||||
// GETORIGINATINGPLAYERID
|
||||
UInt32 plLoadCloneMsg::GetOriginatingPlayerID()
|
||||
{
|
||||
return fOriginatingPlayerID;
|
||||
}
|
||||
|
||||
void plLoadCloneMsg::SetOriginatingPlayerID(UInt32 playerId)
|
||||
{
|
||||
fOriginatingPlayerID = playerId;
|
||||
}
|
||||
|
||||
hsBool plLoadCloneMsg::GetIsLoading()
|
||||
{
|
||||
return fIsLoading;
|
||||
}
|
||||
|
||||
void plLoadCloneMsg::SetTriggerMsg(plMessage *msg)
|
||||
{
|
||||
if (fTriggerMsg != nil)
|
||||
hsRefCnt_SafeUnRef(fTriggerMsg);
|
||||
|
||||
hsRefCnt_SafeRef(msg);
|
||||
fTriggerMsg = msg;
|
||||
}
|
||||
|
||||
plMessage *plLoadCloneMsg::GetTriggerMsg()
|
||||
{
|
||||
return fTriggerMsg;
|
||||
}
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
135
Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h
Normal file
135
Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h
Normal file
@ -0,0 +1,135 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
#ifndef plLoadCloneMsgMsg_INC
|
||||
#define plLoadCloneMsgMsg_INC
|
||||
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
// #include "hsUtils.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
|
||||
/** \class plLoadCloneMsg
|
||||
Tell the net client manager to allocate a new object based on copying an
|
||||
existing, statically keyed object.
|
||||
On the initiating machine, this will synthesize a new key and load the object.
|
||||
On the remote machines, it will use the (enclosed) new key and load the object.
|
||||
On both machines, the requestor will be notified after the object is loaded.
|
||||
*/
|
||||
class plLoadCloneMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
/** Default constructor. only useful for sending over the network, prior
|
||||
to reading and writing. The clone message needs to synthesize its key
|
||||
to do anything, and this constructor doesn't do that, because it doesn't
|
||||
have enough information. */
|
||||
plLoadCloneMsg();
|
||||
|
||||
/** Canonical constructor. If you're trying to initiate a clone, this is
|
||||
the one you want to use.
|
||||
These messages are *always* sent to the net client manager. You can't
|
||||
address them.
|
||||
After they are received on the remote machines, they are forwarded
|
||||
the remote versions of the requestor.
|
||||
|
||||
\param uoidToClone - Specifies the template that will be cloned.
|
||||
\param requestorKey - The key of the object that is requesting the clone. It's
|
||||
strongly recommended that this be a local object, so that we don't get the same
|
||||
requestor creating multiple clones by starting the process on several machines.
|
||||
\param userData - Whatever you want. Will be propagated to the requestor after cloning.
|
||||
|
||||
*/
|
||||
plLoadCloneMsg(const plUoid &uoidToClone, const plKey &requestorKey, UInt32 userData);
|
||||
|
||||
/** This constructor form is for when you want to send a clone message based on
|
||||
an existing cloned object. The two primary uses of this are:
|
||||
- unload an existing clone
|
||||
- replicate a locally existing clone to other machines. You'll need
|
||||
to set up the network propagation parameters yourself.
|
||||
\param existing - The key to the clone you want to work on
|
||||
\param requestor - Will be notified when the (un)clone is processed)
|
||||
\param userData - Whatever you want. Will be propagated to the requestor.
|
||||
\param isLoading - Are we loading or unloading?
|
||||
*/
|
||||
plLoadCloneMsg(const plKey &existing, const plKey &requestor, UInt32 userData, hsBool isLoading);
|
||||
|
||||
virtual ~plLoadCloneMsg();
|
||||
|
||||
CLASSNAME_REGISTER(plLoadCloneMsg);
|
||||
GETINTERFACE_ANY(plLoadCloneMsg, plMessage);
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void ReadVersion(hsStream* stream, hsResMgr* mgr);
|
||||
void WriteVersion(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
plKey GetCloneKey();
|
||||
plKey GetRequestorKey();
|
||||
hsBool IsValidMessage();
|
||||
UInt32 GetUserData();
|
||||
UInt32 GetOriginatingPlayerID();
|
||||
void SetOriginatingPlayerID(UInt32 playerId);
|
||||
hsBool GetIsLoading();
|
||||
void SetTriggerMsg(plMessage *msg);
|
||||
plMessage *GetTriggerMsg();
|
||||
|
||||
|
||||
protected:
|
||||
plKey fCloneKey; // the key that will be loaded
|
||||
plKey fRequestorKey; // forward the message to this guy after the clone is created
|
||||
hsBool fValidMsg; // only gets set if the message built successfully
|
||||
UInt32 fUserData; // let requestors send some data to their remote versions
|
||||
UInt32 fOriginatingPlayerID; // network / player id of the client initiating the request
|
||||
hsBool fIsLoading; // true if we're loading; false if we're unloading
|
||||
plMessage *fTriggerMsg; // Handy place to store a message that caused you to request a clone,
|
||||
// so you can see it and continue processing once your clone is loaded.
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
64
Sources/Plasma/PubUtilLib/plMessage/plMatRefMsg.h
Normal file
64
Sources/Plasma/PubUtilLib/plMessage/plMatRefMsg.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plMatRefMsg_inc
|
||||
#define plMatRefMsg_inc
|
||||
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
|
||||
class plMatRefMsg : public plGenRefMsg
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
kLayer = 0x1,
|
||||
kInsert = 0x2,
|
||||
kPiggyBack = 0x4
|
||||
};
|
||||
|
||||
plMatRefMsg() {}
|
||||
plMatRefMsg(const plKey &r, UInt8 flags, Int8 which, Int8 type) : plGenRefMsg(r, flags, which, type) {}
|
||||
|
||||
CLASSNAME_REGISTER( plMatRefMsg );
|
||||
GETINTERFACE_ANY( plMatRefMsg, plGenRefMsg );
|
||||
};
|
||||
|
||||
#endif // plMatRefMsg_inc
|
60
Sources/Plasma/PubUtilLib/plMessage/plMatrixUpdateMsg.cpp
Normal file
60
Sources/Plasma/PubUtilLib/plMessage/plMatrixUpdateMsg.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plMatrixUpdateMsg.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
void plMatrixUpdateMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fMatrix.Read(stream);
|
||||
}
|
||||
|
||||
void plMatrixUpdateMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
fMatrix.Write(stream);
|
||||
}
|
||||
|
||||
|
70
Sources/Plasma/PubUtilLib/plMessage/plMatrixUpdateMsg.h
Normal file
70
Sources/Plasma/PubUtilLib/plMessage/plMatrixUpdateMsg.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plMatrixUpdateMsg_inc
|
||||
#define plMatrixUpdateMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsMatrix44.h"
|
||||
|
||||
class plMatrixUpdateMsg : public plMessage
|
||||
{
|
||||
|
||||
public:
|
||||
plMatrixUpdateMsg(){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
plMatrixUpdateMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
~plMatrixUpdateMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plMatrixUpdateMsg );
|
||||
GETINTERFACE_ANY( plMatrixUpdateMsg, plMessage );
|
||||
|
||||
void Read( hsStream* s, hsResMgr* mgr );
|
||||
void Write( hsStream* s, hsResMgr* mgr );
|
||||
|
||||
|
||||
hsMatrix44 fMatrix;
|
||||
|
||||
};
|
||||
|
||||
#endif plMatrixUpdateMsg_inc
|
66
Sources/Plasma/PubUtilLib/plMessage/plMemberUpdateMsg.h
Normal file
66
Sources/Plasma/PubUtilLib/plMessage/plMemberUpdateMsg.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plMemberUpdateMsg_INC
|
||||
#define plMemberUpdateMsg_INC
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
//
|
||||
// A msg sent locally when remote players have joined or left the game
|
||||
// (whenever the netClientMgr's remote player list changes).
|
||||
// Also sent initially when we first join a game.
|
||||
//
|
||||
class plMemberUpdateMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plMemberUpdateMsg );
|
||||
GETINTERFACE_ANY( plMemberUpdateMsg, plMessage );
|
||||
|
||||
plMemberUpdateMsg() { SetBCastFlag( kBCastByExactType ); }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
#endif // plMemberUpdateMsg
|
85
Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h
Normal file
85
Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h
Normal file
@ -0,0 +1,85 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plMeshRefMsg_inc
|
||||
#define plMeshRefMsg_inc
|
||||
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
class hsResMgr;
|
||||
|
||||
class plMeshRefMsg : public plRefMsg
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
kVertexPool = 1,
|
||||
kMaterial = 2
|
||||
};
|
||||
|
||||
plMeshRefMsg() : fType(-1), fWhich(-1) {}
|
||||
plMeshRefMsg(const plKey &r, int which, int type) : plRefMsg(r, kOnCreate), fWhich(which), fType(type) {}
|
||||
|
||||
CLASSNAME_REGISTER( plMeshRefMsg );
|
||||
GETINTERFACE_ANY( plMeshRefMsg, plRefMsg );
|
||||
|
||||
UInt8 fType;
|
||||
UInt8 fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Read(stream, mgr);
|
||||
stream->ReadSwap(&fType);
|
||||
stream->ReadSwap(&fWhich);
|
||||
}
|
||||
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plRefMsg::Write(stream, mgr);
|
||||
stream->WriteSwap(fType);
|
||||
stream->WriteSwap(fWhich);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // plMeshRefMsg_inc
|
381
Sources/Plasma/PubUtilLib/plMessage/plMessageCreatable.h
Normal file
381
Sources/Plasma/PubUtilLib/plMessage/plMessageCreatable.h
Normal file
@ -0,0 +1,381 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plMessageCreatable_inc
|
||||
#define plMessageCreatable_inc
|
||||
|
||||
#include "../pnFactory/plCreator.h"
|
||||
|
||||
#include "plInterestingPing.h"
|
||||
|
||||
REGISTER_CREATABLE( plInterestingModMsg );
|
||||
REGISTER_CREATABLE( plInterestingPing );
|
||||
|
||||
#include "plLayRefMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plLayRefMsg );
|
||||
|
||||
#include "plMatRefMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plMatRefMsg );
|
||||
|
||||
#include "plMeshRefMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plMeshRefMsg );
|
||||
|
||||
#include "plLOSRequestMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plLOSRequestMsg );
|
||||
|
||||
#include "plLOSHitMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plLOSHitMsg );
|
||||
|
||||
#include "plActivatorMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plActivatorMsg );
|
||||
|
||||
#include "plCondRefMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plCondRefMsg );
|
||||
|
||||
#include "plAnimCmdMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plAnimCmdMsg );
|
||||
REGISTER_CREATABLE( plAGCmdMsg );
|
||||
REGISTER_CREATABLE( plAGInstanceCallbackMsg );
|
||||
REGISTER_CREATABLE( plAGDetachCallbackMsg );
|
||||
|
||||
#include "plParticleUpdateMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plParticleUpdateMsg );
|
||||
REGISTER_CREATABLE( plParticleTransferMsg );
|
||||
REGISTER_CREATABLE( plParticleKillMsg );
|
||||
REGISTER_CREATABLE( plParticleFlockMsg );
|
||||
|
||||
#include "plInputEventMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plInputEventMsg );
|
||||
REGISTER_CREATABLE( plControlEventMsg );
|
||||
REGISTER_CREATABLE( plKeyEventMsg );
|
||||
REGISTER_CREATABLE( plDebugKeyEventMsg );
|
||||
REGISTER_CREATABLE( plMouseEventMsg );
|
||||
REGISTER_CREATABLE( plIMouseXEventMsg );
|
||||
REGISTER_CREATABLE( plIMouseYEventMsg );
|
||||
REGISTER_CREATABLE( plIMouseBEventMsg );
|
||||
REGISTER_CREATABLE( plAvatarInputStateMsg );
|
||||
|
||||
#include "plPickedMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plPickedMsg );
|
||||
|
||||
#include "plCollideMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plCollideMsg );
|
||||
|
||||
#include "plMatrixUpdateMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plMatrixUpdateMsg );
|
||||
|
||||
#include "plRenderMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plRenderMsg );
|
||||
REGISTER_CREATABLE( plPreResourceMsg );
|
||||
|
||||
#include "plTimerCallbackMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plTimerCallbackMsg );
|
||||
|
||||
#include "plSpawnModMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plSpawnModMsg );
|
||||
|
||||
#include "plSpawnRequestMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plSpawnRequestMsg );
|
||||
|
||||
#include "plNodeCleanupMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plNodeCleanupMsg );
|
||||
|
||||
#include "plDeviceRecreateMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plDeviceRecreateMsg );
|
||||
|
||||
#include "plLightRefMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plLightRefMsg );
|
||||
|
||||
#include "plSimInfluenceMsg.h"
|
||||
|
||||
// REGISTER_CREATABLE( plSimInfluenceMsg );
|
||||
// REGISTER_CREATABLE( plForceMsg );
|
||||
// REGISTER_CREATABLE( plOffsetForceMsg );
|
||||
// REGISTER_CREATABLE( plTorqueMsg );
|
||||
// REGISTER_CREATABLE( plImpulseMsg );
|
||||
// REGISTER_CREATABLE( plOffsetImpulseMsg );
|
||||
// REGISTER_CREATABLE( plAngularImpulseMsg );
|
||||
// REGISTER_CREATABLE( plDampMsg );
|
||||
// REGISTER_CREATABLE( plShiftMassMsg );
|
||||
|
||||
#include "plSimStateMsg.h"
|
||||
|
||||
// REGISTER_CREATABLE( plSimStateMsg );
|
||||
// REGISTER_CREATABLE( plFreezeMsg );
|
||||
// REGISTER_CREATABLE( plEventGroupMsg );
|
||||
// REGISTER_CREATABLE( plEventGroupEnableMsg );
|
||||
// REGISTER_CREATABLE( plSuspendEventMsg );
|
||||
REGISTER_CREATABLE( plSubWorldMsg );
|
||||
|
||||
#include "plLinearVelocityMsg.h"
|
||||
REGISTER_CREATABLE( plLinearVelocityMsg );
|
||||
|
||||
#include "plAngularVelocityMsg.h"
|
||||
REGISTER_CREATABLE( plAngularVelocityMsg );
|
||||
|
||||
#include "plRenderRequestMsg.h"
|
||||
|
||||
REGISTER_CREATABLE( plRenderRequestMsg );
|
||||
REGISTER_CREATABLE( plRenderRequestAck );
|
||||
|
||||
#include "plLinkToAgeMsg.h"
|
||||
REGISTER_CREATABLE(plLinkToAgeMsg);
|
||||
REGISTER_CREATABLE(plLinkingMgrMsg);
|
||||
REGISTER_CREATABLE(plLinkCallbackMsg);
|
||||
REGISTER_CREATABLE(plLinkEffectsTriggerMsg);
|
||||
REGISTER_CREATABLE(plLinkEffectBCMsg);
|
||||
REGISTER_CREATABLE(plLinkEffectsTriggerPrepMsg);
|
||||
REGISTER_CREATABLE(plLinkEffectPrepBCMsg);
|
||||
REGISTER_CREATABLE(plPseudoLinkEffectMsg);
|
||||
REGISTER_CREATABLE(plPseudoLinkAnimTriggerMsg);
|
||||
REGISTER_CREATABLE(plPseudoLinkAnimCallbackMsg);
|
||||
|
||||
#include "plListenerMsg.h"
|
||||
REGISTER_CREATABLE(plListenerMsg);
|
||||
REGISTER_CREATABLE(plSetListenerMsg);
|
||||
|
||||
#include "plTransitionMsg.h"
|
||||
REGISTER_CREATABLE(plTransitionMsg);
|
||||
|
||||
#include "plConsoleMsg.h"
|
||||
REGISTER_CREATABLE(plConsoleMsg);
|
||||
|
||||
#include "plLoadAgeMsg.h"
|
||||
REGISTER_CREATABLE(plLoadAgeMsg);
|
||||
REGISTER_CREATABLE(plLinkOutUnloadMsg);
|
||||
|
||||
#include "plResponderMsg.h"
|
||||
REGISTER_CREATABLE(plResponderMsg);
|
||||
|
||||
#include "plOneShotMsg.h"
|
||||
REGISTER_CREATABLE(plOneShotMsg);
|
||||
|
||||
#include "plTriggerMsg.h"
|
||||
REGISTER_CREATABLE( plTriggerMsg );
|
||||
|
||||
#ifndef NO_AV_MSGS
|
||||
#include "plAvatarMsg.h"
|
||||
REGISTER_CREATABLE( plAvatarMsg );
|
||||
REGISTER_CREATABLE( plArmatureUpdateMsg );
|
||||
REGISTER_CREATABLE( plAvatarSetTypeMsg );
|
||||
REGISTER_CREATABLE( plAvTaskMsg );
|
||||
REGISTER_CREATABLE( plAvSeekMsg );
|
||||
REGISTER_CREATABLE( plAvOneShotMsg );
|
||||
REGISTER_CREATABLE( plAvBrainGenericMsg );
|
||||
|
||||
#ifndef SERVER
|
||||
REGISTER_CREATABLE( plAvPushBrainMsg );
|
||||
REGISTER_CREATABLE( plAvPopBrainMsg );
|
||||
#endif // ndef SERVER
|
||||
|
||||
REGISTER_CREATABLE( plAvatarStealthModeMsg );
|
||||
REGISTER_CREATABLE( plAvatarBehaviorNotifyMsg );
|
||||
REGISTER_CREATABLE( plAvatarOpacityCallbackMsg );
|
||||
REGISTER_CREATABLE( plAvTaskSeekDoneMsg );
|
||||
REGISTER_CREATABLE( plAvatarSpawnNotifyMsg );
|
||||
REGISTER_CREATABLE( plAvatarPhysicsEnableCallbackMsg );
|
||||
#endif // ndef NO_AV_MSGS
|
||||
|
||||
#include "plMultistageMsg.h"
|
||||
REGISTER_CREATABLE( plMultistageModMsg );
|
||||
|
||||
#include "plExcludeRegionMsg.h"
|
||||
REGISTER_CREATABLE(plExcludeRegionMsg);
|
||||
|
||||
#include "plDynamicTextMsg.h"
|
||||
REGISTER_CREATABLE(plDynamicTextMsg);
|
||||
|
||||
#include "plInputIfaceMgrMsg.h"
|
||||
REGISTER_CREATABLE(plInputIfaceMgrMsg);
|
||||
|
||||
#include "plRoomLoadNotifyMsg.h"
|
||||
REGISTER_CREATABLE(plRoomLoadNotifyMsg);
|
||||
|
||||
#include "plMemberUpdateMsg.h"
|
||||
REGISTER_CREATABLE(plMemberUpdateMsg);
|
||||
|
||||
#include "plAgeLoadedMsg.h"
|
||||
REGISTER_CREATABLE(plAgeLoadedMsg);
|
||||
REGISTER_CREATABLE(plAgeLoaded2Msg);
|
||||
REGISTER_CREATABLE(plAgeBeginLoadingMsg);
|
||||
REGISTER_CREATABLE(plInitialAgeStateLoadedMsg);
|
||||
REGISTER_CREATABLE(plLinkInDoneMsg)
|
||||
|
||||
#include "plReplaceGeometryMsg.h"
|
||||
REGISTER_CREATABLE(plReplaceGeometryMsg);
|
||||
REGISTER_CREATABLE(plSwapSpansRefMsg);
|
||||
|
||||
#include "plShadowCastMsg.h"
|
||||
REGISTER_CREATABLE(plShadowCastMsg);
|
||||
|
||||
#include "plResMgrHelperMsg.h"
|
||||
REGISTER_CREATABLE(plResMgrHelperMsg);
|
||||
|
||||
#include "plBulletMsg.h"
|
||||
REGISTER_CREATABLE(plBulletMsg);
|
||||
|
||||
#include "plDynaDecalEnableMsg.h"
|
||||
REGISTER_CREATABLE(plDynaDecalEnableMsg);
|
||||
|
||||
#include "plDynamicEnvMapMsg.h"
|
||||
REGISTER_CREATABLE(plDynamicEnvMapMsg);
|
||||
|
||||
#include "plAvatarFootMsg.h"
|
||||
REGISTER_CREATABLE(plAvatarFootMsg);
|
||||
|
||||
#include "plRippleShapeMsg.h"
|
||||
REGISTER_CREATABLE(plRippleShapeMsg);
|
||||
|
||||
#include "plNetOwnershipMsg.h"
|
||||
REGISTER_CREATABLE(plNetOwnershipMsg);
|
||||
|
||||
#include "plCCRMessageCreatable.h" // kept separately for selective server include
|
||||
|
||||
#include "plConnectedToVaultMsg.h"
|
||||
REGISTER_CREATABLE(plConnectedToVaultMsg);
|
||||
|
||||
#include "plClimbMsg.h"
|
||||
REGISTER_CREATABLE(plClimbMsg);
|
||||
|
||||
#include "plNetVoiceListMsg.h"
|
||||
REGISTER_CREATABLE(plNetVoiceListMsg);
|
||||
|
||||
#include "plSwimMsg.h"
|
||||
REGISTER_CREATABLE(plSwimMsg);
|
||||
|
||||
#include "plVaultNotifyMsg.h"
|
||||
REGISTER_CREATABLE(plVaultNotifyMsg);
|
||||
|
||||
#include "plSynchEnableMsg.h"
|
||||
REGISTER_CREATABLE(plSynchEnableMsg);
|
||||
|
||||
#include "plMovieMsg.h"
|
||||
REGISTER_CREATABLE(plMovieMsg);
|
||||
|
||||
#include "plCaptureRenderMsg.h"
|
||||
REGISTER_CREATABLE(plCaptureRenderMsg);
|
||||
|
||||
#include "plClimbEventMsg.h"
|
||||
REGISTER_CREATABLE(plClimbEventMsg);
|
||||
|
||||
#include "plNetCommMsgs.h"
|
||||
REGISTER_CREATABLE(plNetCommAuthConnectedMsg);
|
||||
REGISTER_CREATABLE(plNetCommAuthMsg);
|
||||
REGISTER_CREATABLE(plNetCommFileListMsg);
|
||||
REGISTER_CREATABLE(plNetCommFileDownloadMsg);
|
||||
REGISTER_CREATABLE(plNetCommLinkToAgeMsg);
|
||||
REGISTER_CREATABLE(plNetCommPlayerListMsg);
|
||||
REGISTER_CREATABLE(plNetCommActivePlayerMsg);
|
||||
REGISTER_CREATABLE(plNetCommCreatePlayerMsg);
|
||||
REGISTER_CREATABLE(plNetCommDeletePlayerMsg);
|
||||
REGISTER_CREATABLE(plNetCommPublicAgeListMsg);
|
||||
REGISTER_CREATABLE(plNetCommPublicAgeMsg);
|
||||
REGISTER_CREATABLE(plNetCommRegisterAgeMsg);
|
||||
|
||||
#include "plPreloaderMsg.h"
|
||||
REGISTER_CREATABLE(plPreloaderMsg);
|
||||
|
||||
#include "plNetClientMgrMsg.h"
|
||||
REGISTER_CREATABLE(plNetClientMgrMsg);
|
||||
|
||||
#include "plNCAgeJoinerMsg.h"
|
||||
REGISTER_CREATABLE(plNCAgeJoinerMsg);
|
||||
|
||||
#include "plAccountUpdateMsg.h"
|
||||
REGISTER_CREATABLE(plAccountUpdateMsg);
|
||||
|
||||
#include "plRideAnimatedPhysMsg.h"
|
||||
REGISTER_CREATABLE(plRideAnimatedPhysMsg);
|
||||
|
||||
#ifndef SERVER
|
||||
#ifndef NO_AV_MSGS
|
||||
#include "plAIMsg.h"
|
||||
REGISTER_CREATABLE(plAIMsg);
|
||||
REGISTER_CREATABLE(plAIBrainCreatedMsg);
|
||||
REGISTER_CREATABLE(plAIArrivedAtGoalMsg);
|
||||
#endif // NO_AV_MSGS
|
||||
#endif // SERVER
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Messages excluded from SERVER build, and the NoAvMsgs build configurations
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef NO_AV_MSGS
|
||||
#ifndef SERVER
|
||||
|
||||
# include "plLoadCloneMsg.h"
|
||||
REGISTER_CREATABLE(plLoadCloneMsg);
|
||||
|
||||
# include "plLoadAvatarMsg.h"
|
||||
REGISTER_CREATABLE(plLoadAvatarMsg);
|
||||
|
||||
# include "plAvCoopMsg.h"
|
||||
REGISTER_CREATABLE(plAvCoopMsg);
|
||||
|
||||
#endif // ndef SERVER
|
||||
#endif // ndef NO_AV_MSGS
|
||||
|
||||
|
||||
#endif // plMessageCreatable_inc
|
||||
|
196
Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h
Normal file
196
Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h
Normal file
@ -0,0 +1,196 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plMovieMsg_inc
|
||||
#define plMovieMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../pnKeyedObject/plFixedKey.h"
|
||||
#include "hsPoint2.h"
|
||||
#include "hsTemplates.h"
|
||||
|
||||
class plMovieMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kIgnore = 0x0,
|
||||
kStart = 0x1,
|
||||
kPause = 0x2,
|
||||
kResume = 0x4,
|
||||
kStop = 0x8,
|
||||
kMove = 0x10, // Call SetCenter() or default is 0,0
|
||||
kScale = 0x20, // Call SetScale() or default is 1,1
|
||||
kColor = 0x40, // Call SetColor() or default is 1,1,1
|
||||
kVolume = 0x80, // Call SetVolume() or default is 1
|
||||
kOpacity = 0x100, // Call SetOpacity() or default is 1
|
||||
kColorAndOpacity = 0x200, // Call SetColor() or default is 1,1,1,1
|
||||
kMake = 0x400, //Installs, but doesn't play until kStart
|
||||
kAddCallbacks = 0x800, // Call AddCallback() for each callback message
|
||||
kFadeIn = 0x1000, // Call SetFadeInSecs() and SetFadeInColor() or defs are 0 and 0,0,0,0
|
||||
kFadeOut = 0x2000 // Call SetFadeOutSecs() and SetFadeOutColor() or defs are 0 and 0,0,0,0
|
||||
};
|
||||
protected:
|
||||
|
||||
hsPoint2 fCenter;
|
||||
|
||||
hsPoint2 fScale;
|
||||
|
||||
hsColorRGBA fColor;
|
||||
|
||||
hsColorRGBA fFadeInColor;
|
||||
hsScalar fFadeInSecs;
|
||||
|
||||
hsColorRGBA fFadeOutColor;
|
||||
hsScalar fFadeOutSecs;
|
||||
|
||||
hsScalar fVolume;
|
||||
|
||||
char* fFileName;
|
||||
|
||||
UInt16 fCmd;
|
||||
|
||||
hsTArray<plMessage*> fCallbacks;
|
||||
|
||||
public:
|
||||
plMovieMsg(const char* n, UInt16 cmd)
|
||||
: plMessage(nil, nil, nil)
|
||||
{
|
||||
fFileName = hsStrcpy(n);
|
||||
SetCmd(cmd).MakeDefault();
|
||||
}
|
||||
plMovieMsg() : fFileName(nil), fCmd(kIgnore)
|
||||
{
|
||||
MakeDefault();
|
||||
}
|
||||
virtual ~plMovieMsg()
|
||||
{
|
||||
delete [] fFileName;
|
||||
int i;
|
||||
for( i = 0; i < fCallbacks.GetCount(); i++ )
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fCallbacks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
CLASSNAME_REGISTER( plMovieMsg );
|
||||
GETINTERFACE_ANY( plMovieMsg, plMessage );
|
||||
|
||||
plMovieMsg& MakeDefault()
|
||||
{
|
||||
SetCenter(0,0);
|
||||
SetScale(1.f,1.f);
|
||||
SetColor(1.f, 1.f, 1.f, 1.f);
|
||||
SetFadeInSecs(0);
|
||||
SetFadeInColor(0, 0, 0, 0);
|
||||
SetFadeOutSecs(0);
|
||||
SetFadeOutColor(0, 0, 0, 0);
|
||||
SetVolume(1.f);
|
||||
SetBCastFlag(kBCastByType);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Make sure you set at least one command, and set appropriate params for the command
|
||||
UInt16 GetCmd() const { return fCmd; }
|
||||
plMovieMsg& SetCmd(UInt16 c) { fCmd = c; return *this; }
|
||||
|
||||
// Center 0,0 is center of screen, 1,1 is Upper-Right, -1,-1 is Lower-Left, etc.
|
||||
const hsPoint2& GetCenter() const { return fCenter; }
|
||||
hsScalar GetCenterX() const { return fCenter.fX; }
|
||||
hsScalar GetCenterY() const { return fCenter.fY; }
|
||||
|
||||
plMovieMsg& SetCenter(const hsPoint2& p) { fCenter = p; return *this; }
|
||||
plMovieMsg& SetCenter(hsScalar x, hsScalar y) { fCenter.Set(x, y); return *this; }
|
||||
plMovieMsg& SetCenterX(hsScalar x) { fCenter.fX = x; return *this; }
|
||||
plMovieMsg& SetCenterY(hsScalar y) { fCenter.fY = y; return *this; }
|
||||
|
||||
// Scale of 1.0 matches movie pixel to screen pixel (whatever the resolution).
|
||||
// Scale of 2.0 doubles each movie pixel across 2 screen pixels.
|
||||
// Etc.
|
||||
const hsPoint2& GetScale() const { return fScale; }
|
||||
hsScalar GetScaleX() const { return fScale.fX; }
|
||||
hsScalar GetScaleY() const { return fScale.fY; }
|
||||
|
||||
plMovieMsg& SetScale(const hsPoint2& p) { fScale = p; return *this; }
|
||||
plMovieMsg& SetScale(hsScalar x, hsScalar y) { fScale.Set(x, y); return *this; }
|
||||
plMovieMsg& SetScaleX(hsScalar x) { fScale.fX = x; return *this; }
|
||||
plMovieMsg& SetScaleY(hsScalar y) { fScale.fY = y; return *this; }
|
||||
|
||||
// Include the movie folder, e.g. "avi/porno.bik"
|
||||
// String is copied, not pointer copy.
|
||||
const char* GetFileName() const { return fFileName; }
|
||||
plMovieMsg& SetFileName(const char* n) { delete [] fFileName; fFileName = hsStrcpy(n); return *this; }
|
||||
|
||||
// Color is mostly useful for alpha fade up and down.
|
||||
const hsColorRGBA& GetColor() const { return fColor; }
|
||||
plMovieMsg& SetColor(const hsColorRGBA& c) { fColor = c; return *this; }
|
||||
plMovieMsg& SetColor(hsScalar r, hsScalar g, hsScalar b, hsScalar a) { fColor.Set(r,g,b,a); return *this; }
|
||||
plMovieMsg& SetOpacity(hsScalar a) { return SetColor(1.f, 1.f, 1.f, a); }
|
||||
|
||||
// Or the auto matic fades
|
||||
const hsColorRGBA& GetFadeInColor() const { return fFadeInColor; }
|
||||
plMovieMsg& SetFadeInColor(const hsColorRGBA& c) { fFadeInColor = c; return *this; }
|
||||
plMovieMsg& SetFadeInColor(hsScalar r, hsScalar g, hsScalar b, hsScalar a) { fFadeInColor.Set(r,g,b,a); return *this; }
|
||||
|
||||
hsScalar GetFadeInSecs() const { return fFadeInSecs; }
|
||||
plMovieMsg& SetFadeInSecs(hsScalar s) { fFadeInSecs = s; return *this; }
|
||||
|
||||
const hsColorRGBA& GetFadeOutColor() const { return fFadeOutColor; }
|
||||
plMovieMsg& SetFadeOutColor(const hsColorRGBA& c) { fFadeOutColor = c; return *this; }
|
||||
plMovieMsg& SetFadeOutColor(hsScalar r, hsScalar g, hsScalar b, hsScalar a) { fFadeOutColor.Set(r,g,b,a); return *this; }
|
||||
|
||||
hsScalar GetFadeOutSecs() const { return fFadeOutSecs; }
|
||||
plMovieMsg& SetFadeOutSecs(hsScalar s) { fFadeOutSecs = s; return *this; }
|
||||
|
||||
// Volume is on scale of 0=muted to 1=full
|
||||
hsScalar GetVolume() const { return fVolume; }
|
||||
plMovieMsg& SetVolume(hsScalar v) { fVolume = v; return *this; }
|
||||
|
||||
plMovieMsg& AddCallback(plMessage* msg) { hsRefCnt_SafeRef(msg); fCallbacks.Append(msg); return *this; }
|
||||
UInt32 GetNumCallbacks() const { return fCallbacks.GetCount(); }
|
||||
plMessage* GetCallback(int i) const { return fCallbacks[i]; }
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr) { hsAssert(false, "Not for I/O"); plMessage::IMsgRead(s, mgr); }
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr) { hsAssert(false, "Not for I/O"); plMessage::IMsgWrite(s, mgr); }
|
||||
};
|
||||
|
||||
#endif // plMovieMsg_inc
|
61
Sources/Plasma/PubUtilLib/plMessage/plMultistageMsg.cpp
Normal file
61
Sources/Plasma/PubUtilLib/plMessage/plMultistageMsg.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plMultistageMsg.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
void plMultistageModMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fCmds.Read(stream);
|
||||
fStageNum = stream->ReadByte();
|
||||
fNumLoops = stream->ReadByte();
|
||||
}
|
||||
|
||||
void plMultistageModMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
fCmds.Write(stream);
|
||||
stream->WriteByte(fStageNum);
|
||||
stream->WriteByte(fNumLoops);
|
||||
}
|
78
Sources/Plasma/PubUtilLib/plMessage/plMultistageMsg.h
Normal file
78
Sources/Plasma/PubUtilLib/plMessage/plMultistageMsg.h
Normal file
@ -0,0 +1,78 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plMultistageMsg_inc
|
||||
#define plMultistageMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
// Messages sent to a MultistageModifier.
|
||||
|
||||
class plMultistageModMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
hsBitVector fCmds;
|
||||
|
||||
public:
|
||||
enum // Commands
|
||||
{
|
||||
kSetLoopCount,
|
||||
};
|
||||
|
||||
UInt8 fStageNum;
|
||||
UInt8 fNumLoops;
|
||||
|
||||
plMultistageModMsg() : fStageNum(0), fNumLoops(1) {}
|
||||
plMultistageModMsg(const plKey &sender, const plKey &receiver) : plMessage(sender,receiver,nil),fStageNum(0),fNumLoops(1) {}
|
||||
|
||||
hsBool GetCommand(UInt8 cmd) { return fCmds.IsBitSet(cmd); }
|
||||
void SetCommand(UInt8 cmd, hsBool val = true) { fCmds.SetBit(cmd, val); }
|
||||
|
||||
// plasma protocol
|
||||
CLASSNAME_REGISTER( plMultistageModMsg );
|
||||
GETINTERFACE_ANY( plMultistageModMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
};
|
||||
|
||||
#endif
|
48
Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.cpp
Normal file
48
Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "plNCAgeJoinerMsg.h"
|
70
Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.h
Normal file
70
Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNCAgeJoinerMsg.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNCAGEJOINERMSG_H
|
||||
#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNCAGEJOINERMSG_H
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
|
||||
class plNCAgeJoinerMsg : public plMessage {
|
||||
public:
|
||||
enum {
|
||||
kHACK_NotifyRcvdAllSDLStates, // Just until the server is working again
|
||||
};
|
||||
|
||||
unsigned type;
|
||||
|
||||
CLASSNAME_REGISTER(plNCAgeJoinerMsg);
|
||||
GETINTERFACE_ANY(plNCAgeJoinerMsg, plMessage);
|
||||
|
||||
void Read (hsStream *, hsResMgr *) { FATAL("plNCAgeJoinerMsg::Read"); }
|
||||
void Write (hsStream *, hsResMgr *) { FATAL("plNCAgeJoinerMsg::Write"); }
|
||||
};
|
||||
|
||||
|
||||
#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNCAGEJOINERMSG_H
|
48
Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.cpp
Normal file
48
Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "plNetClientMgrMsg.h"
|
73
Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h
Normal file
73
Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCLIENTMGRMSG_H
|
||||
#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCLIENTMGRMSG_H
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
|
||||
class plNetClientMgrMsg : public plMessage {
|
||||
public:
|
||||
enum {
|
||||
kNotifyRcvdAllSDLStates,
|
||||
kCmdDisableNet,
|
||||
};
|
||||
|
||||
unsigned type;
|
||||
char str[256];
|
||||
bool yes;
|
||||
|
||||
CLASSNAME_REGISTER(plNetClientMgrMsg);
|
||||
GETINTERFACE_ANY(plNetClientMgrMsg, plMessage);
|
||||
|
||||
void Read (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Read"); }
|
||||
void Write (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Write"); }
|
||||
};
|
||||
|
||||
|
||||
#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCLIENTMGRMSG_H
|
48
Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.cpp
Normal file
48
Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#include "plNetCommMsgs.h"
|
176
Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h
Normal file
176
Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h
Normal file
@ -0,0 +1,176 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H
|
||||
#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H
|
||||
|
||||
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnNetBase/pnNetBase.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../pnNetProtocol/pnNetProtocol.h"
|
||||
|
||||
|
||||
class plNetCommReplyMsg : public plMessage {
|
||||
public:
|
||||
enum EParamType {
|
||||
kParamTypeOther = 0,
|
||||
kParamTypePython,
|
||||
};
|
||||
|
||||
ENetError result;
|
||||
void * param;
|
||||
EParamType ptype;
|
||||
|
||||
plNetCommReplyMsg () { SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
void Read (hsStream * s, hsResMgr * mgr) { plMessage::IMsgRead(s, mgr); }
|
||||
void Write (hsStream * s, hsResMgr * mgr) { plMessage::IMsgWrite(s, mgr); }
|
||||
};
|
||||
|
||||
class plNetCommAuthMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommAuthMsg);
|
||||
GETINTERFACE_ANY(plNetCommAuthMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommAuthConnectedMsg : public plMessage {
|
||||
public:
|
||||
plNetCommAuthConnectedMsg () { SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
CLASSNAME_REGISTER(plNetCommAuthConnectedMsg);
|
||||
GETINTERFACE_ANY(plNetCommAuthConnectedMsg, plMessage);
|
||||
|
||||
void Read (hsStream * s, hsResMgr * mgr) { plMessage::IMsgRead(s, mgr); }
|
||||
void Write (hsStream * s, hsResMgr * mgr) { plMessage::IMsgWrite(s, mgr); }
|
||||
};
|
||||
|
||||
struct NetCliAuthFileInfo;
|
||||
class plNetCommFileListMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
FARRAY(NetCliAuthFileInfo) fileInfoArr;
|
||||
|
||||
CLASSNAME_REGISTER(plNetCommFileListMsg);
|
||||
GETINTERFACE_ANY(plNetCommFileListMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommFileDownloadMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
wchar filename[MAX_PATH];
|
||||
hsStream * writer;
|
||||
|
||||
CLASSNAME_REGISTER(plNetCommFileDownloadMsg);
|
||||
GETINTERFACE_ANY(plNetCommFileDownloadMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommLinkToAgeMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommLinkToAgeMsg);
|
||||
GETINTERFACE_ANY(plNetCommLinkToAgeMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommPlayerListMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommPlayerListMsg);
|
||||
GETINTERFACE_ANY(plNetCommPlayerListMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommActivePlayerMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommActivePlayerMsg);
|
||||
GETINTERFACE_ANY(plNetCommActivePlayerMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommCreatePlayerMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommCreatePlayerMsg);
|
||||
GETINTERFACE_ANY(plNetCommCreatePlayerMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommDeletePlayerMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommDeletePlayerMsg);
|
||||
GETINTERFACE_ANY(plNetCommDeletePlayerMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommPublicAgeListMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommPublicAgeListMsg);
|
||||
GETINTERFACE_ANY(plNetCommPublicAgeListMsg, plMessage);
|
||||
|
||||
ARRAY(struct NetAgeInfo) ages;
|
||||
};
|
||||
|
||||
class plNetCommPublicAgeMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommPublicAgeMsg);
|
||||
GETINTERFACE_ANY(plNetCommPublicAgeMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommRegisterAgeMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommRegisterAgeMsg);
|
||||
GETINTERFACE_ANY(plNetCommRegisterAgeMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommUnregisterAgeMsg : public plNetCommReplyMsg {
|
||||
public:
|
||||
CLASSNAME_REGISTER(plNetCommUnregisterAgeMsg);
|
||||
GETINTERFACE_ANY(plNetCommUnregisterAgeMsg, plMessage);
|
||||
};
|
||||
|
||||
class plNetCommDisconnectedMsg : public plMessage {
|
||||
public:
|
||||
ENetProtocol protocol;
|
||||
|
||||
void Read (hsStream * s, hsResMgr * mgr) { plMessage::IMsgRead(s, mgr); }
|
||||
void Write (hsStream * s, hsResMgr * mgr) { plMessage::IMsgWrite(s, mgr); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H
|
77
Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h
Normal file
77
Sources/Plasma/PubUtilLib/plMessage/plNetOwnershipMsg.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plNetOwnershipMsg_INC
|
||||
#define plNetOwnershipMsg_INC
|
||||
|
||||
#include "hsStlUtils.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plNetMessage/plNetMessage.h"
|
||||
|
||||
//
|
||||
// A msg sent locally when this client changes ownership of a group of objects
|
||||
//
|
||||
class hsResMgr;
|
||||
class hsStream;
|
||||
class plNetOwnershipMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
std::vector<plNetMsgGroupOwner::GroupInfo> fGroups;
|
||||
public:
|
||||
plNetOwnershipMsg() { SetBCastFlag(plMessage::kBCastByType); }
|
||||
|
||||
CLASSNAME_REGISTER( plNetOwnershipMsg );
|
||||
GETINTERFACE_ANY( plNetOwnershipMsg, plMessage );
|
||||
|
||||
// getters
|
||||
int GetNumGroups() const { return fGroups.size(); }
|
||||
plNetMsgGroupOwner::GroupInfo GetGroupInfo(int i) const { return fGroups[i]; }
|
||||
|
||||
// setters
|
||||
void AddGroupInfo(plNetMsgGroupOwner::GroupInfo gi) { fGroups.push_back(gi); }
|
||||
void ClearGroupInfo() { fGroups.clear(); }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { hsAssert(false, "NA: localOnly msg"); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { hsAssert(false, "NA: localOnly msg"); }
|
||||
};
|
||||
|
||||
#endif // plNetOwnershipMsg
|
70
Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp
Normal file
70
Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plNetVoiceListMsg.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
void plNetVoiceListMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fRemoved = mgr->ReadKey(stream);
|
||||
fCmd = stream->ReadSwap32();
|
||||
int n = stream->ReadSwap32();
|
||||
fClientIDs.SetCountAndZero(0);
|
||||
for (int i = 0; i < n; i++)
|
||||
fClientIDs.Append(stream->ReadSwap32());
|
||||
|
||||
}
|
||||
|
||||
void plNetVoiceListMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fRemoved);
|
||||
stream->WriteSwap32(fCmd);
|
||||
stream->WriteSwap32(fClientIDs.Count());
|
||||
for (int i = 0; i<fClientIDs.Count(); i++)
|
||||
stream->WriteSwap32(fClientIDs[i]);
|
||||
}
|
86
Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.h
Normal file
86
Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plNetVoiceListMsg_inc
|
||||
#define plNetVoiceListMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsTemplates.h"
|
||||
|
||||
class plNetVoiceListMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
hsTArray<UInt32> fClientIDs;
|
||||
int fCmd;
|
||||
plKey fRemoved;
|
||||
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
kForcedListenerMode,
|
||||
kDistanceMode,
|
||||
};
|
||||
|
||||
plNetVoiceListMsg() : plMessage(nil, nil, nil), fCmd( 0 ) { SetBCastFlag(kBCastByExactType); }
|
||||
plNetVoiceListMsg( UInt32 cmd ) :
|
||||
plMessage(nil, nil, nil), fCmd( cmd )
|
||||
{ SetBCastFlag( kBCastByExactType ); }
|
||||
|
||||
~plNetVoiceListMsg() { ; }
|
||||
|
||||
CLASSNAME_REGISTER( plNetVoiceListMsg );
|
||||
GETINTERFACE_ANY( plNetVoiceListMsg, plMessage );
|
||||
|
||||
UInt32 GetCmd( void ) { return fCmd; }
|
||||
hsTArray<UInt32>* GetClientList( void ) { return &fClientIDs; };
|
||||
plKey GetRemovedKey() { return fRemoved; }
|
||||
void SetRemovedKey(plKey& k) { fRemoved = k; }
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // plNetVoiceListMsg_inc
|
68
Sources/Plasma/PubUtilLib/plMessage/plNodeCleanupMsg.h
Normal file
68
Sources/Plasma/PubUtilLib/plMessage/plNodeCleanupMsg.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plNodeCleanupMsg Header //
|
||||
// Tiny message to let sceneNodes know that they need to clean up. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _plNodeCleanupMsg_h
|
||||
#define _plNodeCleanupMsg_h
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plNodeCleanupMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plNodeCleanupMsg() : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); }
|
||||
~plNodeCleanupMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plNodeCleanupMsg );
|
||||
GETINTERFACE_ANY( plNodeCleanupMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); }
|
||||
};
|
||||
|
||||
#endif // _plNodeCleanupMsg_h
|
98
Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp
Normal file
98
Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp
Normal file
@ -0,0 +1,98 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plOneShotCallbacks.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsUtils.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
plOneShotCallbacks::plOneShotCallbacks()
|
||||
{
|
||||
}
|
||||
|
||||
plOneShotCallbacks::~plOneShotCallbacks()
|
||||
{
|
||||
int size = fCallbacks.size();
|
||||
for (int i = 0; i < size; i++)
|
||||
delete [] fCallbacks[i].fMarker;
|
||||
fCallbacks.clear();
|
||||
}
|
||||
|
||||
void plOneShotCallbacks::AddCallback(const char *marker, plKey &receiver, Int16 user)
|
||||
{
|
||||
fCallbacks.push_back(plOneShotCallback(hsStrcpy(marker), receiver, user));
|
||||
}
|
||||
|
||||
int plOneShotCallbacks::GetNumCallbacks()
|
||||
{
|
||||
return fCallbacks.size();
|
||||
}
|
||||
|
||||
plOneShotCallbacks::plOneShotCallback& plOneShotCallbacks::GetCallback(int i)
|
||||
{
|
||||
return fCallbacks[i];
|
||||
}
|
||||
|
||||
void plOneShotCallbacks::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
int size = stream->ReadSwap32();
|
||||
fCallbacks.reserve(size);
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
char *marker = stream->ReadSafeString();
|
||||
plKey receiver = mgr->ReadKey(stream);
|
||||
Int16 user = stream->ReadSwap16();
|
||||
|
||||
fCallbacks.push_back(plOneShotCallback(marker, receiver, user));
|
||||
}
|
||||
}
|
||||
|
||||
void plOneShotCallbacks::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
int size = fCallbacks.size();
|
||||
stream->WriteSwap32(size);
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
stream->WriteSafeString(fCallbacks[i].fMarker);
|
||||
mgr->WriteKey(stream, fCallbacks[i].fReceiver);
|
||||
stream->WriteSwap16(fCallbacks[i].fUser);
|
||||
}
|
||||
}
|
84
Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h
Normal file
84
Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h
Normal file
@ -0,0 +1,84 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "hsRefCnt.h"
|
||||
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
//
|
||||
// HACK
|
||||
// Basically, I just made this class because I couldn't stand duplicating
|
||||
// all the code and strings for plOneShotMsg and plAvOneShotMsg. - Colin
|
||||
//
|
||||
class plOneShotCallbacks : public hsRefCnt
|
||||
{
|
||||
public:
|
||||
class plOneShotCallback
|
||||
{
|
||||
public:
|
||||
plOneShotCallback(char *marker, plKey &receiver, Int16 user) :
|
||||
fMarker(marker), fReceiver(receiver) , fUser(user) {}
|
||||
|
||||
char *fMarker;
|
||||
plKey fReceiver;
|
||||
Int16 fUser;
|
||||
};
|
||||
|
||||
protected:
|
||||
std::vector<plOneShotCallback> fCallbacks;
|
||||
|
||||
public:
|
||||
plOneShotCallbacks();
|
||||
~plOneShotCallbacks();
|
||||
|
||||
void AddCallback(const char *marker, plKey &receiver, Int16 user=0);
|
||||
int GetNumCallbacks();
|
||||
plOneShotCallback& GetCallback(int i);
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
66
Sources/Plasma/PubUtilLib/plMessage/plOneShotMsg.cpp
Normal file
66
Sources/Plasma/PubUtilLib/plMessage/plOneShotMsg.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plOneShotMsg.h"
|
||||
#include "plOneShotCallbacks.h"
|
||||
|
||||
plOneShotMsg::plOneShotMsg()
|
||||
{
|
||||
fCallbacks = TRACKED_NEW plOneShotCallbacks;
|
||||
}
|
||||
|
||||
plOneShotMsg::~plOneShotMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fCallbacks);
|
||||
fCallbacks = nil;
|
||||
}
|
||||
|
||||
void plOneShotMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plResponderMsg::Read(stream, mgr);
|
||||
fCallbacks->Read(stream, mgr);
|
||||
}
|
||||
|
||||
void plOneShotMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plResponderMsg::Write(stream, mgr);
|
||||
fCallbacks->Write(stream, mgr);
|
||||
}
|
68
Sources/Plasma/PubUtilLib/plMessage/plOneShotMsg.h
Normal file
68
Sources/Plasma/PubUtilLib/plMessage/plOneShotMsg.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plOneShotMsg_inc
|
||||
#define plOneShotMsg_inc
|
||||
|
||||
#include "plResponderMsg.h"
|
||||
|
||||
class plOneShotCallbacks;
|
||||
|
||||
class plOneShotMsg : public plResponderMsg
|
||||
{
|
||||
public:
|
||||
// We can't use a plEventCallbackMsg since we don't know the actual times we
|
||||
// want to be called back at. We need to use a string, then the plAGAnim
|
||||
// will figure out the time internally and create a plEventCallbackMsg.
|
||||
plOneShotCallbacks *fCallbacks;
|
||||
|
||||
plOneShotMsg();
|
||||
~plOneShotMsg();
|
||||
|
||||
CLASSNAME_REGISTER(plOneShotMsg);
|
||||
GETINTERFACE_ANY(plOneShotMsg, plResponderMsg);
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
#endif // plOneShotMsg_inc
|
223
Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h
Normal file
223
Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h
Normal file
@ -0,0 +1,223 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plParticleUpdateMsg_inc
|
||||
#define plParticleUpdateMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// plParticleUpdateMsg. Messages to change the parameters of a particle system
|
||||
// and its generators.
|
||||
|
||||
class plParticleUpdateMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plParticleUpdateMsg()
|
||||
: plMessage(nil, nil, nil) {}
|
||||
plParticleUpdateMsg(const plKey &s, const plKey &r, const double* t, UInt32 paramID, hsScalar paramValue )
|
||||
: plMessage(s, r, t) { fParamID = paramID; fParamValue = paramValue; }
|
||||
virtual ~plParticleUpdateMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plParticleUpdateMsg );
|
||||
GETINTERFACE_ANY( plParticleUpdateMsg, plMessage );
|
||||
|
||||
enum paramIDs
|
||||
{
|
||||
kParamParticlesPerSecond,
|
||||
kParamInitPitchRange,
|
||||
kParamInitYawRange,
|
||||
// kParamInitVel,
|
||||
// kParamInitVelRange,
|
||||
kParamVelMin,
|
||||
kParamVelMax,
|
||||
kParamXSize,
|
||||
kParamYSize,
|
||||
// kParamSizeRange,
|
||||
kParamScaleMin,
|
||||
kParamScaleMax,
|
||||
kParamGenLife,
|
||||
// kParamPartLife,
|
||||
// kParamPartLifeRange,
|
||||
kParamPartLifeMin,
|
||||
kParamPartLifeMax,
|
||||
kParamEnabled,
|
||||
};
|
||||
|
||||
UInt32 fParamID;
|
||||
hsScalar fParamValue;
|
||||
|
||||
UInt32 GetParamID() { return fParamID; }
|
||||
hsScalar GetParamValue() { return fParamValue; }
|
||||
|
||||
// IO
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fParamID = stream->ReadSwap32();
|
||||
stream->ReadSwap(&fParamValue);
|
||||
}
|
||||
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
stream->WriteSwap32(fParamID);
|
||||
stream->WriteSwap(fParamValue);
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// plParticleTransferMsg. Currently intended for just the avatar, but amendable. (Talk to Bob)
|
||||
// Takes one particle system, clones it, slaps the clone on the target
|
||||
// sceneObject, and transfers some particles from the old system to the new one.
|
||||
|
||||
class plParticleTransferMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plKey fSysSOKey; // sceneObject of the system we're snagging particles from
|
||||
UInt16 fNumToTransfer; // number of particles to transfer
|
||||
|
||||
plParticleTransferMsg() : plMessage(nil, nil, nil), fSysSOKey(nil), fNumToTransfer(0) {}
|
||||
plParticleTransferMsg(const plKey &s, const plKey &r, const double* t, plKey sysSOKey, UInt16 numParticles )
|
||||
: plMessage(s, r, t) { fSysSOKey = sysSOKey; fNumToTransfer = numParticles; }
|
||||
virtual ~plParticleTransferMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plParticleTransferMsg );
|
||||
GETINTERFACE_ANY( plParticleTransferMsg, plMessage );
|
||||
|
||||
// IO
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
|
||||
fSysSOKey = mgr->ReadKey(stream);
|
||||
fNumToTransfer = stream->ReadSwap16();
|
||||
}
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
|
||||
mgr->WriteKey(stream, fSysSOKey);
|
||||
stream->WriteSwap16(fNumToTransfer);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// plParticleKillMsg. Tell a system that a number (or percentage) of its
|
||||
// particles have to go.
|
||||
|
||||
class plParticleKillMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
hsScalar fNumToKill;
|
||||
hsScalar fTimeLeft;
|
||||
|
||||
UInt8 fFlags;
|
||||
enum
|
||||
{
|
||||
kParticleKillImmortalOnly = 0x1, // Only slap a death sentence on "immortal" particles (the others are already dying)
|
||||
kParticleKillPercentage = 0x2, // Tells us to interpret "fNumToKill" as a 0-1 percentage.
|
||||
};
|
||||
|
||||
plParticleKillMsg() : plMessage(nil, nil, nil), fNumToKill(0.f), fTimeLeft(0.f), fFlags(kParticleKillImmortalOnly) {}
|
||||
plParticleKillMsg(const plKey &s, const plKey &r, const double* t, hsScalar numToKill, hsScalar timeLeft, UInt8 flags = kParticleKillImmortalOnly )
|
||||
: plMessage(s, r, t) { fNumToKill = numToKill; fTimeLeft = timeLeft; fFlags = flags; }
|
||||
virtual ~plParticleKillMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plParticleKillMsg );
|
||||
GETINTERFACE_ANY( plParticleKillMsg, plMessage );
|
||||
|
||||
// Local only
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream,mgr);
|
||||
fNumToKill = stream->ReadSwapScalar();
|
||||
fTimeLeft = stream->ReadSwapScalar();
|
||||
stream->ReadSwap(&fFlags);
|
||||
}
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteSwapScalar(fNumToKill);
|
||||
stream->WriteSwapScalar(fTimeLeft);
|
||||
stream->WriteSwap(fFlags);
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// plParticleFlockMsg. Commands for a flock effect
|
||||
|
||||
class plParticleFlockMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
hsScalar fX, fY, fZ;
|
||||
UInt8 fCmd;
|
||||
enum
|
||||
{
|
||||
kFlockCmdSetOffset,
|
||||
kFlockCmdSetDissentPoint,
|
||||
};
|
||||
|
||||
plParticleFlockMsg() : plMessage(nil, nil, nil), fCmd(0), fX(0.f), fY(0.f), fZ(0.f) {}
|
||||
plParticleFlockMsg(const plKey &s, const plKey &r, const double* t, UInt8 cmd, hsScalar x, hsScalar y, hsScalar z)
|
||||
: plMessage(s, r, t), fCmd(cmd), fX(x), fY(y), fZ(z) {}
|
||||
virtual ~plParticleFlockMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plParticleFlockMsg );
|
||||
GETINTERFACE_ANY( plParticleFlockMsg, plMessage );
|
||||
|
||||
// Local only
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr) {}
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // plParticleUpdateMsg_inc
|
||||
|
88
Sources/Plasma/PubUtilLib/plMessage/plPickedMsg.h
Normal file
88
Sources/Plasma/PubUtilLib/plMessage/plPickedMsg.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plPickedMsg_inc
|
||||
#define plPickedMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
|
||||
class plPickedMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
hsBool fPicked;
|
||||
hsPoint3 fHitPoint; // where in the world the object was picked on
|
||||
|
||||
plPickedMsg() : fPicked(true),fHitPoint(0,0,0){SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
plPickedMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) : fPicked(true),fHitPoint(0,0,0) {SetBCastFlag(plMessage::kPropagateToModifiers);}
|
||||
~plPickedMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plPickedMsg );
|
||||
GETINTERFACE_ANY( plPickedMsg, plMessage );
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fPicked = stream->ReadBool();
|
||||
fHitPoint.Read(stream);
|
||||
}
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteBool(fPicked);
|
||||
fHitPoint.Write(stream);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // PickedMsg
|
104
Sources/Plasma/PubUtilLib/plMessage/plPlayerMsg.h
Normal file
104
Sources/Plasma/PubUtilLib/plMessage/plPlayerMsg.h
Normal file
@ -0,0 +1,104 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPlayerMsg_inc
|
||||
#define plPlayerMsg_inc
|
||||
|
||||
//
|
||||
// Player message class
|
||||
//
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsBitVector.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plPlayerMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
hsPoint3 targPoint;
|
||||
|
||||
public:
|
||||
plPlayerMsg() { SetBCastFlag(plMessage::kBCastByExactType); }
|
||||
plPlayerMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t){ SetBCastFlag(plMessage::kBCastByExactType); }
|
||||
~plPlayerMsg(){;}
|
||||
|
||||
CLASSNAME_REGISTER( plPlayerMsg );
|
||||
GETINTERFACE_ANY( plPlayerMsg, plMessage );
|
||||
|
||||
enum ModCmds
|
||||
{
|
||||
kMovementStarted = 0,
|
||||
kMovementStopped,
|
||||
kSetDesiredFacing,
|
||||
kWarpToSpawnPoint,
|
||||
|
||||
kNumCmds
|
||||
};
|
||||
|
||||
hsBitVector fCmd;
|
||||
|
||||
hsBool Cmd(int n) { return fCmd.IsBitSet(n); }
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd() { fCmd.Clear(); }
|
||||
const hsPoint3 GetTargPoint() { return targPoint; }
|
||||
void SetTargPoint(hsPoint3 pt) { targPoint = pt; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
targPoint.Read(stream);
|
||||
fCmd.Read(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
targPoint.Write(stream);
|
||||
fCmd.Write(stream);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // plPlayerMsg_inc
|
67
Sources/Plasma/PubUtilLib/plMessage/plPreloaderMsg.h
Normal file
67
Sources/Plasma/PubUtilLib/plMessage/plPreloaderMsg.h
Normal file
@ -0,0 +1,67 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/PubUtilLib/plMessage/plPreloaderMsg.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLPRELOADERMSG_H
|
||||
#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLPRELOADERMSG_H
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plPreloaderMsg : public plMessage {
|
||||
public:
|
||||
bool fSuccess;
|
||||
|
||||
plPreloaderMsg () { SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
CLASSNAME_REGISTER(plPreloaderMsg);
|
||||
GETINTERFACE_ANY(plPreloaderMsg, plMessage);
|
||||
|
||||
void Read (hsStream* stream, hsResMgr* ) { FATAL("plPreloaderMsg::Read"); }
|
||||
void Write (hsStream* stream, hsResMgr* ) { FATAL("plPreloaderMsg::Write"); }
|
||||
};
|
||||
|
||||
|
||||
#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLPRELOADERMSG_H
|
90
Sources/Plasma/PubUtilLib/plMessage/plRenderMsg.h
Normal file
90
Sources/Plasma/PubUtilLib/plMessage/plRenderMsg.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plRenderMsg_inc
|
||||
#define plRenderMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plPipeline;
|
||||
|
||||
class plRenderMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
plPipeline* fPipe;
|
||||
|
||||
public:
|
||||
plRenderMsg() : plMessage(nil, nil, nil), fPipe(nil) { SetBCastFlag(kBCastByExactType); }
|
||||
plRenderMsg(plPipeline* pipe) : plMessage(nil, nil, nil), fPipe(pipe) { SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
~plRenderMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plRenderMsg );
|
||||
GETINTERFACE_ANY( plRenderMsg, plMessage );
|
||||
|
||||
plPipeline* Pipeline() const { return fPipe; }
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead(s, mgr); }
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite(s, mgr); }
|
||||
};
|
||||
|
||||
class plPreResourceMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
plPipeline* fPipe;
|
||||
|
||||
public:
|
||||
plPreResourceMsg() : plMessage(nil, nil, nil), fPipe(nil) { SetBCastFlag(kBCastByExactType); }
|
||||
plPreResourceMsg(plPipeline* pipe) : plMessage(nil, nil, nil), fPipe(pipe) { SetBCastFlag(kBCastByExactType); }
|
||||
|
||||
~plPreResourceMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plPreResourceMsg );
|
||||
GETINTERFACE_ANY( plPreResourceMsg, plMessage );
|
||||
|
||||
plPipeline* Pipeline() const { return fPipe; }
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr) {}
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr) {}
|
||||
};
|
||||
|
||||
#endif // plRenderMsg_inc
|
109
Sources/Plasma/PubUtilLib/plMessage/plRenderRequestMsg.cpp
Normal file
109
Sources/Plasma/PubUtilLib/plMessage/plRenderRequestMsg.cpp
Normal file
@ -0,0 +1,109 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plRenderRequestMsg.h"
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include "../pnKeyedObject/plFixedKey.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
|
||||
plRenderRequestMsg::plRenderRequestMsg(plKey sender, plRenderRequestBase* req)
|
||||
: plMessage(sender, nil, nil),
|
||||
fReq(req)
|
||||
{
|
||||
plUoid oid( kClient_KEY ); // from plFixedKey.h
|
||||
plKey key = hsgResMgr::ResMgr()->FindKey(oid);
|
||||
AddReceiver(key);
|
||||
|
||||
hsRefCnt_SafeRef(fReq);
|
||||
}
|
||||
|
||||
plRenderRequestMsg::~plRenderRequestMsg()
|
||||
{
|
||||
hsRefCnt_SafeUnRef(fReq);
|
||||
}
|
||||
|
||||
|
||||
plRenderRequestMsg::plRenderRequestMsg()
|
||||
{
|
||||
hsAssert(false, "Improper usage, use argumented constructor");
|
||||
}
|
||||
|
||||
void plRenderRequestMsg::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "Transmission/read/write of render requests not currently supported");
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
|
||||
fReq = nil;
|
||||
}
|
||||
|
||||
void plRenderRequestMsg::Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "Transmission/read/write of render requests not currently supported");
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
}
|
||||
|
||||
plRenderRequestAck::plRenderRequestAck()
|
||||
{
|
||||
hsAssert(false, "Improper usage, use argumented constructor");
|
||||
}
|
||||
|
||||
plRenderRequestAck::plRenderRequestAck(plKey r, UInt32 userData)
|
||||
: plMessage(nil, r, nil),
|
||||
fUserData(userData)
|
||||
{
|
||||
}
|
||||
|
||||
void plRenderRequestAck::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "Transmission/read/write of render requests not currently supported");
|
||||
plMessage::IMsgRead(s, mgr);
|
||||
|
||||
}
|
||||
|
||||
void plRenderRequestAck::Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert(false, "Transmission/read/write of render requests not currently supported");
|
||||
plMessage::IMsgWrite(s, mgr);
|
||||
}
|
||||
|
116
Sources/Plasma/PubUtilLib/plMessage/plRenderRequestMsg.h
Normal file
116
Sources/Plasma/PubUtilLib/plMessage/plRenderRequestMsg.h
Normal file
@ -0,0 +1,116 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plRenderRequestMsg_inc
|
||||
#define plRenderRequestMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "hsRefCnt.h"
|
||||
|
||||
class plRenderRequest;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
// This is a little StoneAge, using the old HeadSpin ref count here.
|
||||
// It's a perfect spot for a smart pointer, but we ain't got none.
|
||||
//
|
||||
// Basic issue is that we hand a pointer to this request off to the
|
||||
// client (via the plRenderRequestMsg), who will at some later point this frame
|
||||
// hand it to the pipeline to be processed. So if I want to hand it off and
|
||||
// forget about it, the client needs to delete it. If I want to reuse it every
|
||||
// frame and destroy it when I'm done, I need to delete it. Sounds just like
|
||||
// a smart pointer, or for the cro-magnons a RefCnt.
|
||||
|
||||
class plRenderRequestBase : public hsRefCnt
|
||||
{
|
||||
};
|
||||
|
||||
class plRenderRequestMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
plRenderRequestBase* fReq;
|
||||
|
||||
public:
|
||||
// Argumentless constructor useless (except for compiling).
|
||||
plRenderRequestMsg();
|
||||
// non-nil sender will get an ack when render is "done".
|
||||
plRenderRequestMsg(plKey sender, plRenderRequestBase* req);
|
||||
virtual ~plRenderRequestMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plRenderRequestMsg );
|
||||
GETINTERFACE_ANY( plRenderRequestMsg, plMessage );
|
||||
|
||||
// These aren't really implemented. Read/Write/Transmission of
|
||||
// these messages doesn't currently make sense.
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
plRenderRequest* Request() const { return (plRenderRequest*)fReq; }
|
||||
|
||||
};
|
||||
|
||||
class plRenderRequestAck: public plMessage
|
||||
{
|
||||
protected:
|
||||
UInt32 fUserData;
|
||||
UInt32 fNumDrawn; // number of objects drawn.
|
||||
public:
|
||||
// Argumentless constructor useless (except for compiling).
|
||||
plRenderRequestAck();
|
||||
plRenderRequestAck(plKey r, UInt32 userData=0);
|
||||
~plRenderRequestAck() {}
|
||||
|
||||
CLASSNAME_REGISTER( plRenderRequestAck );
|
||||
GETINTERFACE_ANY( plRenderRequestAck, plMessage );
|
||||
|
||||
void SetNumDrawn(UInt32 n) { fNumDrawn = n; }
|
||||
UInt32 GetNumDrawn() const { return fNumDrawn; }
|
||||
|
||||
// These aren't really implemented. Read/Write/Transmission of
|
||||
// these messages doesn't currently make sense.
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
};
|
||||
|
||||
#endif // plRenderRequestMsg_inc
|
90
Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h
Normal file
90
Sources/Plasma/PubUtilLib/plMessage/plReplaceGeometryMsg.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plReplaceGeometryMsg_inc
|
||||
#define plReplaceGeometryMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
class plSharedMesh;
|
||||
class hsGMaterial;
|
||||
class plDrawableSpans;
|
||||
|
||||
class plReplaceGeometryMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
plSharedMesh *fMesh;
|
||||
hsGMaterial *fMaterial;
|
||||
UInt32 fFlags;
|
||||
|
||||
plReplaceGeometryMsg() : fMesh(nil), fMaterial(nil), fFlags(0) {}
|
||||
~plReplaceGeometryMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plReplaceGeometryMsg );
|
||||
GETINTERFACE_ANY( plReplaceGeometryMsg, plMessage );
|
||||
|
||||
// No R/W, these shouldn't be sent over the wire
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr) {}
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr) {}
|
||||
|
||||
// flags
|
||||
enum
|
||||
{
|
||||
kAddingGeom = 0x0001,
|
||||
kAddToFront = 0x0002,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class plSwapSpansRefMsg : public plGenRefMsg
|
||||
{
|
||||
public:
|
||||
plDrawableSpans *fSpans;
|
||||
|
||||
plSwapSpansRefMsg() : plGenRefMsg(), fSpans(nil) {}
|
||||
plSwapSpansRefMsg(const plKey &r, UInt8 c, int which, int type) : plGenRefMsg(r, c, which, type) {}
|
||||
~plSwapSpansRefMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER( plSwapSpansRefMsg );
|
||||
GETINTERFACE_ANY( plSwapSpansRefMsg, plGenRefMsg );
|
||||
};
|
||||
|
||||
#endif
|
91
Sources/Plasma/PubUtilLib/plMessage/plResMgrHelperMsg.h
Normal file
91
Sources/Plasma/PubUtilLib/plMessage/plResMgrHelperMsg.h
Normal file
@ -0,0 +1,91 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef _plResMgrHelperMsg_h
|
||||
#define _plResMgrHelperMsg_h
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsStream.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../plResMgr/plResManagerHelper.h"
|
||||
|
||||
class plResManagerHelper;
|
||||
class plResMgrHelperMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
|
||||
friend class plResManagerHelper;
|
||||
|
||||
plResPageKeyRefList *fKeyList;
|
||||
|
||||
UInt8 fCommand;
|
||||
|
||||
public:
|
||||
|
||||
enum Commands
|
||||
{
|
||||
kKeyRefList,
|
||||
kUpdateDebugScreen,
|
||||
kEnableDebugScreen,
|
||||
kDisableDebugScreen
|
||||
};
|
||||
|
||||
plResMgrHelperMsg( UInt8 command = 0 ) : plMessage(nil, nil, nil), fKeyList( nil ) { fCommand = command; }
|
||||
~plResMgrHelperMsg() { delete fKeyList; }
|
||||
|
||||
CLASSNAME_REGISTER( plResMgrHelperMsg );
|
||||
GETINTERFACE_ANY( plResMgrHelperMsg, plMessage );
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert( false, "This should never get read" );
|
||||
}
|
||||
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
hsAssert( false, "This should never get written" );
|
||||
}
|
||||
|
||||
UInt8 GetCommand( void ) const { return fCommand; }
|
||||
};
|
||||
|
||||
#endif // _plResMgrHelperMsg_h
|
66
Sources/Plasma/PubUtilLib/plMessage/plResponderMsg.h
Normal file
66
Sources/Plasma/PubUtilLib/plMessage/plResponderMsg.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plResponderMsg_inc
|
||||
#define plResponderMsg_inc
|
||||
|
||||
#include "../pnMessage/plMessage.h"
|
||||
|
||||
// Derive your message from this class if you need to know the key of the avatar
|
||||
// that activated your responder
|
||||
class plResponderMsg : public plMessage
|
||||
{
|
||||
public:
|
||||
// Don't bother reading and writing this, it is set right before sending
|
||||
plKey fPlayerKey;
|
||||
|
||||
plResponderMsg() : fPlayerKey(nil) {}
|
||||
~plResponderMsg() {}
|
||||
|
||||
CLASSNAME_REGISTER(plResponderMsg);
|
||||
GETINTERFACE_ANY(plResponderMsg, plMessage);
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); }
|
||||
void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); }
|
||||
};
|
||||
|
||||
#endif // plResponderMsg_inc
|
@ -0,0 +1,70 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plRideAnimatedPhysMsg.h"
|
||||
// global
|
||||
#include "hsResMgr.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
plRideAnimatedPhysMsg::plRideAnimatedPhysMsg()
|
||||
:fRegion(nil)
|
||||
,fEntering(false)
|
||||
{
|
||||
}
|
||||
plRideAnimatedPhysMsg::plRideAnimatedPhysMsg(const plKey &sender, const plKey &receiver, bool entering, plKey regionKey)
|
||||
: plMessage(sender, receiver, nil)
|
||||
,fRegion(regionKey)
|
||||
,fEntering(entering)
|
||||
{
|
||||
}
|
||||
|
||||
void plRideAnimatedPhysMsg::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgRead(stream, mgr);
|
||||
fEntering = stream->Readbool();
|
||||
fRegion = mgr->ReadKey(stream);
|
||||
}
|
||||
void plRideAnimatedPhysMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->Writebool(fEntering);
|
||||
mgr->WriteKey(stream, fRegion);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user