1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Fix line endings and tabs

This commit is contained in:
Branan Purvine-Riley
2011-04-11 16:27:55 -07:00
parent d4250e19b5
commit 908aaeb6f6
2738 changed files with 702562 additions and 702562 deletions

View File

@ -1,25 +1,25 @@
include_directories(../../CoreLib)
include_directories(../../FeatureLib)
include_directories(../../NucleusLib)
include_directories(../../NucleusLib/inc)
include_directories(../../PubUtilLib)
include_directories(${OPENSSL_INCLUDE_DIR})
set(pfCharacter_SOURCES
pfMarkerInfo.cpp
pfMarkerMgr.cpp
plPlayerModifier.cpp
)
set(pfCharacter_HEADERS
pfCharacterCreatable.h
pfMarkerInfo.h
pfMarkerMgr.h
plPlayerModifier.h
)
add_library(pfCharacter STATIC ${pfCharacter_SOURCES} ${pfCharacter_HEADERS})
source_group("Source Files" FILES ${pfCharacter_SOURCES})
source_group("Header Files" FILES ${pfCharacter_HEADERS})
include_directories(../../CoreLib)
include_directories(../../FeatureLib)
include_directories(../../NucleusLib)
include_directories(../../NucleusLib/inc)
include_directories(../../PubUtilLib)
include_directories(${OPENSSL_INCLUDE_DIR})
set(pfCharacter_SOURCES
pfMarkerInfo.cpp
pfMarkerMgr.cpp
plPlayerModifier.cpp
)
set(pfCharacter_HEADERS
pfCharacterCreatable.h
pfMarkerInfo.h
pfMarkerMgr.h
plPlayerModifier.h
)
add_library(pfCharacter STATIC ${pfCharacter_SOURCES} ${pfCharacter_HEADERS})
source_group("Source Files" FILES ${pfCharacter_SOURCES})
source_group("Header Files" FILES ${pfCharacter_HEADERS})

View File

@ -1,35 +1,35 @@
/*==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/>.
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 pfCharacterCreatable_inc
#define pfCharacterCreatable_inc
#include "pnFactory/plCreator.h"
#include "pfMarkerMgr.h"
REGISTER_NONCREATABLE(pfMarkerMgr);
#endif // pfCharacterCreatable_inc
/*==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/>.
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 pfCharacterCreatable_inc
#define pfCharacterCreatable_inc
#include "pnFactory/plCreator.h"
#include "pfMarkerMgr.h"
REGISTER_NONCREATABLE(pfMarkerMgr);
#endif // pfCharacterCreatable_inc

View File

@ -1,250 +1,250 @@
/*==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/>.
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 "pfMarkerInfo.h"
#include "pfMarkerMgr.h"
#include "plModifier/plGameMarkerModifier.h"
#include "plMessage/plLoadCloneMsg.h"
#include "pnMessage/plWarpMsg.h"
#include "pnSceneObject/plCoordinateInterface.h"
#include "plMessage/plAnimCmdMsg.h"
#include "pnMessage/plEnableMsg.h"
#include "pnMessage/plSoundMsg.h"
#include "pnSceneObject/plAudioInterface.h"
// For Init
#include "pnMessage/plClientMsg.h"
#include "pnSceneObject/plSceneObject.h"
#include "plResMgr/plResManager.h"
#include "plResMgr/plKeyFinder.h"
plUoid pfMarkerInfo::fMarkerUoid;
static const int kFreezeLen = 10; // How long a marker is frozen after you hit it
void pfMarkerInfo::Init()
{
plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr();
// Force the client to keep the GlobalMarkers keys loaded, so we don't load them every time we clone
plClientMsg* loadAgeKeysMsg = TRACKED_NEW plClientMsg(plClientMsg::kLoadAgeKeys);
loadAgeKeysMsg->SetAgeName("GlobalMarkers");
loadAgeKeysMsg->Send(resMgr->FindKey(kClient_KEY));
//
// Get the Uoid for the markers
//
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else
fMarkerUoid.Invalidate();
}
pfMarkerInfo::pfMarkerInfo(const hsPoint3& pos, bool isNew) :
fMod(nil),
fPosition(pos),
fType(kMarkerOpen),
fLastChange(0),
fVisible(true),
fIsNew(isNew),
fSpawned(false)
{
}
void pfMarkerInfo::Spawn(MarkerType type)
{
if (!fMarkerUoid.IsValid())
{
plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr();
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else
{
hsAssert(false, "Unable to spawn markers because the marker age was not loaded or found");
return;
}
}
fType = type;
fLastChange = 0;
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fMarkerUoid, pfMarkerMgr::Instance()->GetKey(), 0);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
fKey = cloneMsg->GetCloneKey();
cloneMsg->Send();
}
void pfMarkerInfo::InitSpawned(plKey markerKey)
{
fKey = markerKey;
fSpawned = true;
plSceneObject* so = plSceneObject::ConvertNoRef(fKey->GetObjectPtr());
fMod = (plGameMarkerModifier*)so->GetModifierByType(plGameMarkerModifier::Index());
hsAssert(fMod, "Couldn't find marker modifier");
fMod->FixupAnimKeys();
// Warp it into position
hsMatrix44 pos;
pos.Reset();
pos.SetTranslate(&fPosition);
plWarpMsg* warpMsg = TRACKED_NEW plWarpMsg(pfMarkerMgr::Instance()->GetKey(), fKey, plWarpMsg::kFlushTransform, pos);
warpMsg->Send();
// update its state
Show(fVisible);
IPlayColor(true);
if (fType == kMarkerLocalSelected)
IPlayBounce(true);
}
void pfMarkerInfo::Show(bool show)
{
fVisible = show;
if (fSpawned) {
plEnableMsg* msg = TRACKED_NEW plEnableMsg;
msg->SetBCastFlag(plMessage::kPropagateToChildren);
msg->SetCmd(plEnableMsg::kDrawable);
msg->SetCmd(show ? plEnableMsg::kEnable : plEnableMsg::kDisable);
msg->SetSender(pfMarkerMgr::Instance()->GetKey());
msg->Send(fKey);
}
}
void pfMarkerInfo::SetFrozen(double freezeStartTime)
{
fLastChange = freezeStartTime;
IPlayBounce(true);
}
void pfMarkerInfo::Update(double curTime)
{
if (fLastChange != 0 && (curTime - fLastChange) > kFreezeLen)
{
fLastChange = 0;
IPlayBounce(false);
}
if (fIsNew)
{
IPlaySound(true);
fIsNew = false;
}
}
void pfMarkerInfo::Remove()
{
if (fKey)
{
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fKey, pfMarkerMgr::Instance()->GetKey(), 0, false);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
cloneMsg->Send();
fKey = nil;
fMod = nil;
}
}
void pfMarkerInfo::SetType(pfMarkerInfo::MarkerType type)
{
if (fType == kMarkerLocalSelected)
IPlayBounce(false);
IPlayColor(false);
fType = type;
IPlayColor(true);
if (fType == kMarkerLocalSelected)
IPlayBounce(true);
}
void pfMarkerInfo::IPlayBounce(bool play)
{
if (fMod && fSpawned)
{
// Send anim start/stop msg
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
animMsg->SetSender(pfMarkerMgr::Instance()->GetKey());
animMsg->Send(fMod->fBounceAnimKey);
}
}
void pfMarkerInfo::IPlayColor(bool play)
{
if (fMod && fSpawned)
{
// Play the correct color anim
plKey key = nil;
switch (fType)
{
case kMarkerOpen:
case kMarkerLocal:
case kMarkerLocalSelected:
key = fMod->fOpenAnimKey;
break;
case kMarkerGreen:
key = fMod->fGreenAnimKey;
break;
case kMarkerRed:
key = fMod->fRedAnimKey;
break;
}
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
animMsg->SetSender(pfMarkerMgr::Instance()->GetKey());
animMsg->AddReceiver(key);
animMsg->Send();
}
}
void pfMarkerInfo::IPlaySound(bool place)
{
if (fMod && fSpawned)
{
const plAudioInterface* ai = fMod->GetTarget()->GetAudioInterface();
plSoundMsg* msg = TRACKED_NEW plSoundMsg;
msg->fIndex = place ? fMod->fPlaceSndIdx : fMod->fHitSndIdx;
msg->SetCmd(plSoundMsg::kPlay);
msg->SetSender(pfMarkerMgr::Instance()->GetKey());
msg->Send(ai->GetKey());
}
/*==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/>.
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 "pfMarkerInfo.h"
#include "pfMarkerMgr.h"
#include "plModifier/plGameMarkerModifier.h"
#include "plMessage/plLoadCloneMsg.h"
#include "pnMessage/plWarpMsg.h"
#include "pnSceneObject/plCoordinateInterface.h"
#include "plMessage/plAnimCmdMsg.h"
#include "pnMessage/plEnableMsg.h"
#include "pnMessage/plSoundMsg.h"
#include "pnSceneObject/plAudioInterface.h"
// For Init
#include "pnMessage/plClientMsg.h"
#include "pnSceneObject/plSceneObject.h"
#include "plResMgr/plResManager.h"
#include "plResMgr/plKeyFinder.h"
plUoid pfMarkerInfo::fMarkerUoid;
static const int kFreezeLen = 10; // How long a marker is frozen after you hit it
void pfMarkerInfo::Init()
{
plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr();
// Force the client to keep the GlobalMarkers keys loaded, so we don't load them every time we clone
plClientMsg* loadAgeKeysMsg = TRACKED_NEW plClientMsg(plClientMsg::kLoadAgeKeys);
loadAgeKeysMsg->SetAgeName("GlobalMarkers");
loadAgeKeysMsg->Send(resMgr->FindKey(kClient_KEY));
//
// Get the Uoid for the markers
//
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else
fMarkerUoid.Invalidate();
}
pfMarkerInfo::pfMarkerInfo(const hsPoint3& pos, bool isNew) :
fMod(nil),
fPosition(pos),
fType(kMarkerOpen),
fLastChange(0),
fVisible(true),
fIsNew(isNew),
fSpawned(false)
{
}
void pfMarkerInfo::Spawn(MarkerType type)
{
if (!fMarkerUoid.IsValid())
{
plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr();
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else
{
hsAssert(false, "Unable to spawn markers because the marker age was not loaded or found");
return;
}
}
fType = type;
fLastChange = 0;
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fMarkerUoid, pfMarkerMgr::Instance()->GetKey(), 0);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
fKey = cloneMsg->GetCloneKey();
cloneMsg->Send();
}
void pfMarkerInfo::InitSpawned(plKey markerKey)
{
fKey = markerKey;
fSpawned = true;
plSceneObject* so = plSceneObject::ConvertNoRef(fKey->GetObjectPtr());
fMod = (plGameMarkerModifier*)so->GetModifierByType(plGameMarkerModifier::Index());
hsAssert(fMod, "Couldn't find marker modifier");
fMod->FixupAnimKeys();
// Warp it into position
hsMatrix44 pos;
pos.Reset();
pos.SetTranslate(&fPosition);
plWarpMsg* warpMsg = TRACKED_NEW plWarpMsg(pfMarkerMgr::Instance()->GetKey(), fKey, plWarpMsg::kFlushTransform, pos);
warpMsg->Send();
// update its state
Show(fVisible);
IPlayColor(true);
if (fType == kMarkerLocalSelected)
IPlayBounce(true);
}
void pfMarkerInfo::Show(bool show)
{
fVisible = show;
if (fSpawned) {
plEnableMsg* msg = TRACKED_NEW plEnableMsg;
msg->SetBCastFlag(plMessage::kPropagateToChildren);
msg->SetCmd(plEnableMsg::kDrawable);
msg->SetCmd(show ? plEnableMsg::kEnable : plEnableMsg::kDisable);
msg->SetSender(pfMarkerMgr::Instance()->GetKey());
msg->Send(fKey);
}
}
void pfMarkerInfo::SetFrozen(double freezeStartTime)
{
fLastChange = freezeStartTime;
IPlayBounce(true);
}
void pfMarkerInfo::Update(double curTime)
{
if (fLastChange != 0 && (curTime - fLastChange) > kFreezeLen)
{
fLastChange = 0;
IPlayBounce(false);
}
if (fIsNew)
{
IPlaySound(true);
fIsNew = false;
}
}
void pfMarkerInfo::Remove()
{
if (fKey)
{
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fKey, pfMarkerMgr::Instance()->GetKey(), 0, false);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
cloneMsg->Send();
fKey = nil;
fMod = nil;
}
}
void pfMarkerInfo::SetType(pfMarkerInfo::MarkerType type)
{
if (fType == kMarkerLocalSelected)
IPlayBounce(false);
IPlayColor(false);
fType = type;
IPlayColor(true);
if (fType == kMarkerLocalSelected)
IPlayBounce(true);
}
void pfMarkerInfo::IPlayBounce(bool play)
{
if (fMod && fSpawned)
{
// Send anim start/stop msg
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
animMsg->SetSender(pfMarkerMgr::Instance()->GetKey());
animMsg->Send(fMod->fBounceAnimKey);
}
}
void pfMarkerInfo::IPlayColor(bool play)
{
if (fMod && fSpawned)
{
// Play the correct color anim
plKey key = nil;
switch (fType)
{
case kMarkerOpen:
case kMarkerLocal:
case kMarkerLocalSelected:
key = fMod->fOpenAnimKey;
break;
case kMarkerGreen:
key = fMod->fGreenAnimKey;
break;
case kMarkerRed:
key = fMod->fRedAnimKey;
break;
}
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
animMsg->SetSender(pfMarkerMgr::Instance()->GetKey());
animMsg->AddReceiver(key);
animMsg->Send();
}
}
void pfMarkerInfo::IPlaySound(bool place)
{
if (fMod && fSpawned)
{
const plAudioInterface* ai = fMod->GetTarget()->GetAudioInterface();
plSoundMsg* msg = TRACKED_NEW plSoundMsg;
msg->fIndex = place ? fMod->fPlaceSndIdx : fMod->fHitSndIdx;
msg->SetCmd(plSoundMsg::kPlay);
msg->SetSender(pfMarkerMgr::Instance()->GetKey());
msg->Send(ai->GetKey());
}
}

View File

@ -1,84 +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/>.
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 pfMarkerInfo_h_inc
#define pfMarkerInfo_h_inc
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plUoid.h"
#include "hsGeometry3.h"
class plMessage;
class plGameMarkerModifier;
class pfMarkerInfo
{
public:
enum MarkerType { kMarkerOpen, kMarkerGreen, kMarkerRed, kMarkerLocal, kMarkerLocalSelected };
protected:
// MarkerMgr will set this up
static plUoid fMarkerUoid;
plKey fKey;
plGameMarkerModifier* fMod;
hsPoint3 fPosition;
MarkerType fType;
double fLastChange; // Last time this marker changed hands
bool fVisible;
bool fIsNew;
bool fSpawned;
void IPlayBounce(bool play);
void IPlayColor(bool play);
void IPlaySound(bool place);
public:
pfMarkerInfo(const hsPoint3& pos, bool isNew);
~pfMarkerInfo() {}
static void Init();
plKey GetKey() { return fKey; }
void Spawn(MarkerType type);
void InitSpawned(plKey markerKey);
void Remove();
void Update(double curTime);
void Show(bool show);
bool IsVisible() { return fVisible; }
void SetType(pfMarkerInfo::MarkerType type);
pfMarkerInfo::MarkerType GetType() { return fType; }
void SetFrozen(double freezeStartTime);
bool IsFrozen() { return fLastChange != 0; }
void PlayHitSound() { IPlaySound(false); }
};
#endif // pfMarkerInfo_h_inc
/*==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/>.
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 pfMarkerInfo_h_inc
#define pfMarkerInfo_h_inc
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plUoid.h"
#include "hsGeometry3.h"
class plMessage;
class plGameMarkerModifier;
class pfMarkerInfo
{
public:
enum MarkerType { kMarkerOpen, kMarkerGreen, kMarkerRed, kMarkerLocal, kMarkerLocalSelected };
protected:
// MarkerMgr will set this up
static plUoid fMarkerUoid;
plKey fKey;
plGameMarkerModifier* fMod;
hsPoint3 fPosition;
MarkerType fType;
double fLastChange; // Last time this marker changed hands
bool fVisible;
bool fIsNew;
bool fSpawned;
void IPlayBounce(bool play);
void IPlayColor(bool play);
void IPlaySound(bool place);
public:
pfMarkerInfo(const hsPoint3& pos, bool isNew);
~pfMarkerInfo() {}
static void Init();
plKey GetKey() { return fKey; }
void Spawn(MarkerType type);
void InitSpawned(plKey markerKey);
void Remove();
void Update(double curTime);
void Show(bool show);
bool IsVisible() { return fVisible; }
void SetType(pfMarkerInfo::MarkerType type);
pfMarkerInfo::MarkerType GetType() { return fType; }
void SetFrozen(double freezeStartTime);
bool IsFrozen() { return fLastChange != 0; }
void PlayHitSound() { IPlaySound(false); }
};
#endif // pfMarkerInfo_h_inc

View File

@ -1,313 +1,313 @@
/*==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/>.
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 "pfMarkerMgr.h"
#include "pfMessage/pfMarkerMsg.h"
#include "pfMarkerInfo.h"
#include "plModifier/plCloneSpawnModifier.h"
#include "plStatusLog/plStatusLog.h"
#include "plMessage/plLoadCloneMsg.h"
#include "pnMessage/plTimeMsg.h"
#include "pnMessage/plNotifyMsg.h"
#include "plNetClient/plNetClientMgr.h"
#include "plgDispatch.h"
////////////////////////////////////////////////////////////////////////////////
pfMarkerMgr* pfMarkerMgr::fInstance = nil;
const UInt32 pfMarkerMgr::kNoMarkerSelected = (UInt32)(-1);
pfMarkerMgr* pfMarkerMgr::Instance()
{
if (!pfMarkerMgr::fInstance)
{
pfMarkerMgr::fInstance = TRACKED_NEW pfMarkerMgr;
pfMarkerMgr::fInstance->IInit();
}
return pfMarkerMgr::fInstance;
}
void pfMarkerMgr::Shutdown()
{
if (pfMarkerMgr::fInstance)
{
pfMarkerMgr::fInstance->IShutdown();
pfMarkerMgr::fInstance = nil;
}
}
////////////////////////////////////////////////////////////////////////////////
pfMarkerMgr::pfMarkerMgr(): fSelectedMarker(kNoMarkerSelected), fShowingLocalMarkers(false), fMarkersRespawn(false)
{
fLog = plStatusLogMgr::GetInstance().CreateStatusLog(20, "Marker.log", plStatusLog::kAlignToTop | plStatusLog::kFilledBackground);
pfMarkerInfo::Init();
}
pfMarkerMgr::~pfMarkerMgr()
{
delete fLog;
}
void pfMarkerMgr::IInit()
{
fMyKey = RegisterAs(kMarkerMgr_KEY);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
}
void pfMarkerMgr::IShutdown()
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
++curMarker;
}
fMarkers.clear();
plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
UnRegisterAs(kMarkerMgr_KEY);
}
pfMarkerInfo* pfMarkerMgr::IFindMarker(plKey markerKey, UInt32& id)
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
if (curMarker->second->GetKey() == markerKey)
{
id = curMarker->first;
return curMarker->second;
}
++curMarker;
}
id = kNoMarkerSelected;
return nil;
}
void pfMarkerMgr::IUpdate()
{
// Update all markers
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Update(hsTimer::GetSeconds());
++curMarker;
}
}
void pfMarkerMgr::IMarkerHit(plKey markerKey, plKey playerKey)
{
if (playerKey != plNetClientMgr::GetInstance()->GetLocalPlayerKey())
return; // not the local player, abort
// make sure the marker isn't frozen
UInt32 id;
pfMarkerInfo* hitMarker = IFindMarker(markerKey, id);
if (!hitMarker)
return; // abort, something weird is going on
if (hitMarker->IsFrozen())
return; // marker frozen, abort
// tell people about it
pfMarkerMsg* msg = TRACKED_NEW pfMarkerMsg;
msg->fType = pfMarkerMsg::kMarkerCaptured;
msg->fMarkerID = id;
msg->Send();
}
void pfMarkerMgr::AddMarker(double x, double y, double z, UInt32 id, bool justCreated)
{
if (fMarkers.find(id) != fMarkers.end())
{
// delete existing one if we're changing its location
fMarkers[id]->Remove();
DEL(fMarkers[id]);
}
hsPoint3 pos((hsScalar)x, (hsScalar)y, (hsScalar)z);
fMarkers[id] = TRACKED_NEW pfMarkerInfo(pos, justCreated);
fMarkers[id]->Spawn(pfMarkerInfo::kMarkerOpen);
}
void pfMarkerMgr::RemoveMarker(UInt32 id)
{
if (fMarkers.find(id) == fMarkers.end())
return;
fMarkers[id]->Remove();
DEL(fMarkers[id]);
fMarkers.erase(id);
}
void pfMarkerMgr::RemoveAllMarkers()
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
++curMarker;
}
fMarkers.clear();
}
void pfMarkerMgr::ClearSelectedMarker()
{
if (fSelectedMarker != kNoMarkerSelected)
{
if (fMarkers.find(fSelectedMarker) != fMarkers.end())
fMarkers[fSelectedMarker]->SetType(pfMarkerInfo::kMarkerOpen);
fSelectedMarker = kNoMarkerSelected;
}
}
void pfMarkerMgr::SetSelectedMarker(UInt32 id)
{
ClearSelectedMarker();
if (id != kNoMarkerSelected)
{
if (fMarkers.find(id) != fMarkers.end())
{
fMarkers[id]->SetType(pfMarkerInfo::kMarkerLocalSelected);
fSelectedMarker = id;
}
}
}
UInt32 pfMarkerMgr::GetSelectedMarker()
{
return fSelectedMarker;
}
// for QUEST games (no teams)
void pfMarkerMgr::CaptureMarker(UInt32 id, bool captured)
{
if (fMarkers.find(id) == fMarkers.end())
return;
if (fMarkersRespawn)
fMarkers[id]->SetFrozen(hsTimer::GetSeconds());
else
fMarkers[id]->Show(!captured);
fMarkers[id]->PlayHitSound();
fMarkers[id]->SetType(captured ? pfMarkerInfo::kMarkerGreen : pfMarkerInfo::kMarkerOpen);
}
// for TEAM games (0 = not captured)
void pfMarkerMgr::CaptureMarker(UInt32 id, int team)
{
if (fMarkers.find(id) == fMarkers.end())
return;
if (fMarkersRespawn)
fMarkers[id]->SetFrozen(hsTimer::GetSeconds());
else
fMarkers[id]->Show(team == 0); // 0 = uncaptured
fMarkers[id]->PlayHitSound();
if (team == 0)
fMarkers[id]->SetType(pfMarkerInfo::kMarkerOpen);
else if (team == 1)
fMarkers[id]->SetType(pfMarkerInfo::kMarkerGreen);
else
fMarkers[id]->SetType(pfMarkerInfo::kMarkerRed);
}
void pfMarkerMgr::LocalShowMarkers(bool show)
{
fShowingLocalMarkers = show;
if (show)
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
curMarker->second->Show(true);
}
else
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
curMarker->second->Show(false);
}
}
bool pfMarkerMgr::AreLocalMarkersShowing()
{
return fShowingLocalMarkers;
}
hsBool pfMarkerMgr::MsgReceive(plMessage* msg)
{
plEvalMsg* evalMsg = plEvalMsg::ConvertNoRef(msg);
if (evalMsg)
{
IUpdate();
return true;
}
// Somebody hit a marker
plNotifyMsg* notify = plNotifyMsg::ConvertNoRef(msg);
if (notify)
{
proCollisionEventData* cEvent = (proCollisionEventData*)notify->FindEventRecord(proEventData::kCollision);
if (cEvent)
{
plKey markerKey = cEvent->fHittee;
plKey playerKey = cEvent->fHitter;
if (plNetClientMgr::GetInstance()->IsAPlayerKey(cEvent->fHittee))
{
// swap the above, since the hittee is actually the player
playerKey = cEvent->fHittee;
markerKey = cEvent->fHitter;
}
IMarkerHit(markerKey, playerKey);
}
return true;
}
plLoadCloneMsg* cloneMsg = plLoadCloneMsg::ConvertNoRef(msg);
if (cloneMsg)
{
plKey cloneKey = cloneMsg->GetCloneKey();
if (cloneMsg->GetIsLoading() && cloneKey)
{
UInt32 id;
pfMarkerInfo* marker = IFindMarker(cloneKey, id);
marker->InitSpawned(cloneKey);
}
return true;
}
return hsKeyedObject::MsgReceive(msg);
/*==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/>.
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 "pfMarkerMgr.h"
#include "pfMessage/pfMarkerMsg.h"
#include "pfMarkerInfo.h"
#include "plModifier/plCloneSpawnModifier.h"
#include "plStatusLog/plStatusLog.h"
#include "plMessage/plLoadCloneMsg.h"
#include "pnMessage/plTimeMsg.h"
#include "pnMessage/plNotifyMsg.h"
#include "plNetClient/plNetClientMgr.h"
#include "plgDispatch.h"
////////////////////////////////////////////////////////////////////////////////
pfMarkerMgr* pfMarkerMgr::fInstance = nil;
const UInt32 pfMarkerMgr::kNoMarkerSelected = (UInt32)(-1);
pfMarkerMgr* pfMarkerMgr::Instance()
{
if (!pfMarkerMgr::fInstance)
{
pfMarkerMgr::fInstance = TRACKED_NEW pfMarkerMgr;
pfMarkerMgr::fInstance->IInit();
}
return pfMarkerMgr::fInstance;
}
void pfMarkerMgr::Shutdown()
{
if (pfMarkerMgr::fInstance)
{
pfMarkerMgr::fInstance->IShutdown();
pfMarkerMgr::fInstance = nil;
}
}
////////////////////////////////////////////////////////////////////////////////
pfMarkerMgr::pfMarkerMgr(): fSelectedMarker(kNoMarkerSelected), fShowingLocalMarkers(false), fMarkersRespawn(false)
{
fLog = plStatusLogMgr::GetInstance().CreateStatusLog(20, "Marker.log", plStatusLog::kAlignToTop | plStatusLog::kFilledBackground);
pfMarkerInfo::Init();
}
pfMarkerMgr::~pfMarkerMgr()
{
delete fLog;
}
void pfMarkerMgr::IInit()
{
fMyKey = RegisterAs(kMarkerMgr_KEY);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
}
void pfMarkerMgr::IShutdown()
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
++curMarker;
}
fMarkers.clear();
plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
UnRegisterAs(kMarkerMgr_KEY);
}
pfMarkerInfo* pfMarkerMgr::IFindMarker(plKey markerKey, UInt32& id)
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
if (curMarker->second->GetKey() == markerKey)
{
id = curMarker->first;
return curMarker->second;
}
++curMarker;
}
id = kNoMarkerSelected;
return nil;
}
void pfMarkerMgr::IUpdate()
{
// Update all markers
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Update(hsTimer::GetSeconds());
++curMarker;
}
}
void pfMarkerMgr::IMarkerHit(plKey markerKey, plKey playerKey)
{
if (playerKey != plNetClientMgr::GetInstance()->GetLocalPlayerKey())
return; // not the local player, abort
// make sure the marker isn't frozen
UInt32 id;
pfMarkerInfo* hitMarker = IFindMarker(markerKey, id);
if (!hitMarker)
return; // abort, something weird is going on
if (hitMarker->IsFrozen())
return; // marker frozen, abort
// tell people about it
pfMarkerMsg* msg = TRACKED_NEW pfMarkerMsg;
msg->fType = pfMarkerMsg::kMarkerCaptured;
msg->fMarkerID = id;
msg->Send();
}
void pfMarkerMgr::AddMarker(double x, double y, double z, UInt32 id, bool justCreated)
{
if (fMarkers.find(id) != fMarkers.end())
{
// delete existing one if we're changing its location
fMarkers[id]->Remove();
DEL(fMarkers[id]);
}
hsPoint3 pos((hsScalar)x, (hsScalar)y, (hsScalar)z);
fMarkers[id] = TRACKED_NEW pfMarkerInfo(pos, justCreated);
fMarkers[id]->Spawn(pfMarkerInfo::kMarkerOpen);
}
void pfMarkerMgr::RemoveMarker(UInt32 id)
{
if (fMarkers.find(id) == fMarkers.end())
return;
fMarkers[id]->Remove();
DEL(fMarkers[id]);
fMarkers.erase(id);
}
void pfMarkerMgr::RemoveAllMarkers()
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
++curMarker;
}
fMarkers.clear();
}
void pfMarkerMgr::ClearSelectedMarker()
{
if (fSelectedMarker != kNoMarkerSelected)
{
if (fMarkers.find(fSelectedMarker) != fMarkers.end())
fMarkers[fSelectedMarker]->SetType(pfMarkerInfo::kMarkerOpen);
fSelectedMarker = kNoMarkerSelected;
}
}
void pfMarkerMgr::SetSelectedMarker(UInt32 id)
{
ClearSelectedMarker();
if (id != kNoMarkerSelected)
{
if (fMarkers.find(id) != fMarkers.end())
{
fMarkers[id]->SetType(pfMarkerInfo::kMarkerLocalSelected);
fSelectedMarker = id;
}
}
}
UInt32 pfMarkerMgr::GetSelectedMarker()
{
return fSelectedMarker;
}
// for QUEST games (no teams)
void pfMarkerMgr::CaptureMarker(UInt32 id, bool captured)
{
if (fMarkers.find(id) == fMarkers.end())
return;
if (fMarkersRespawn)
fMarkers[id]->SetFrozen(hsTimer::GetSeconds());
else
fMarkers[id]->Show(!captured);
fMarkers[id]->PlayHitSound();
fMarkers[id]->SetType(captured ? pfMarkerInfo::kMarkerGreen : pfMarkerInfo::kMarkerOpen);
}
// for TEAM games (0 = not captured)
void pfMarkerMgr::CaptureMarker(UInt32 id, int team)
{
if (fMarkers.find(id) == fMarkers.end())
return;
if (fMarkersRespawn)
fMarkers[id]->SetFrozen(hsTimer::GetSeconds());
else
fMarkers[id]->Show(team == 0); // 0 = uncaptured
fMarkers[id]->PlayHitSound();
if (team == 0)
fMarkers[id]->SetType(pfMarkerInfo::kMarkerOpen);
else if (team == 1)
fMarkers[id]->SetType(pfMarkerInfo::kMarkerGreen);
else
fMarkers[id]->SetType(pfMarkerInfo::kMarkerRed);
}
void pfMarkerMgr::LocalShowMarkers(bool show)
{
fShowingLocalMarkers = show;
if (show)
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
curMarker->second->Show(true);
}
else
{
std::map<UInt32, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
while (curMarker != fMarkers.end())
curMarker->second->Show(false);
}
}
bool pfMarkerMgr::AreLocalMarkersShowing()
{
return fShowingLocalMarkers;
}
hsBool pfMarkerMgr::MsgReceive(plMessage* msg)
{
plEvalMsg* evalMsg = plEvalMsg::ConvertNoRef(msg);
if (evalMsg)
{
IUpdate();
return true;
}
// Somebody hit a marker
plNotifyMsg* notify = plNotifyMsg::ConvertNoRef(msg);
if (notify)
{
proCollisionEventData* cEvent = (proCollisionEventData*)notify->FindEventRecord(proEventData::kCollision);
if (cEvent)
{
plKey markerKey = cEvent->fHittee;
plKey playerKey = cEvent->fHitter;
if (plNetClientMgr::GetInstance()->IsAPlayerKey(cEvent->fHittee))
{
// swap the above, since the hittee is actually the player
playerKey = cEvent->fHittee;
markerKey = cEvent->fHitter;
}
IMarkerHit(markerKey, playerKey);
}
return true;
}
plLoadCloneMsg* cloneMsg = plLoadCloneMsg::ConvertNoRef(msg);
if (cloneMsg)
{
plKey cloneKey = cloneMsg->GetCloneKey();
if (cloneMsg->GetIsLoading() && cloneKey)
{
UInt32 id;
pfMarkerInfo* marker = IFindMarker(cloneKey, id);
marker->InitSpawned(cloneKey);
}
return true;
}
return hsKeyedObject::MsgReceive(msg);
}

View File

@ -1,97 +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/>.
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 pfMarkerMgr_h_inc
#define pfMarkerMgr_h_inc
#include "pnKeyedObject/hsKeyedObject.h"
#include <map>
class plStatusLog;
////////////////////////////////////////////////////////////////////////////////
class pfMarkerMsg;
class pfMarkerGame;
class pfMarkerInfo;
class pfMarkerMgr : public hsKeyedObject
{
protected:
friend class pfMarkerInfo;
friend class pfMarkerInfoOwned;
// Because for some reason if I ask for my key, the refs hit zero when I release it (0 initial refs?)
plKey fMyKey;
plStatusLog* fLog;
static pfMarkerMgr* fInstance;
bool fShowingLocalMarkers;
bool fMarkersRespawn;
UInt32 fSelectedMarker;
static const UInt32 kNoMarkerSelected;
std::map<UInt32, pfMarkerInfo*> fMarkers; // key is marker id number
void IInit();
void IShutdown();
pfMarkerInfo* IFindMarker(plKey markerKey, UInt32& id);
void IUpdate();
void IMarkerHit(plKey markerKey, plKey playerKey);
pfMarkerMgr();
~pfMarkerMgr();
public:
CLASSNAME_REGISTER(pfMarkerMgr);
GETINTERFACE_ANY(pfMarkerMgr, hsKeyedObject);
static pfMarkerMgr* Instance();
static void Shutdown();
hsBool MsgReceive(plMessage* msg);
void AddMarker(double x, double y, double z, UInt32 id, bool justCreated);
void RemoveMarker(UInt32 id);
void RemoveAllMarkers();
void ClearSelectedMarker();
void SetSelectedMarker(UInt32 id);
UInt32 GetSelectedMarker();
void SetMarkersRespawn(bool respawn) {fMarkersRespawn = respawn;}
bool GetMarkersRespawn() {return fMarkersRespawn;}
void CaptureMarker(UInt32 id, bool captured); // for QUEST games (no teams)
void CaptureMarker(UInt32 id, int team); // for TEAM games (0 = not captured)
// Shows your markers locally, so you can see where they are
void LocalShowMarkers(bool show = true);
bool AreLocalMarkersShowing();
};
#endif // pfMarkerMgr_h_inc
/*==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/>.
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 pfMarkerMgr_h_inc
#define pfMarkerMgr_h_inc
#include "pnKeyedObject/hsKeyedObject.h"
#include <map>
class plStatusLog;
////////////////////////////////////////////////////////////////////////////////
class pfMarkerMsg;
class pfMarkerGame;
class pfMarkerInfo;
class pfMarkerMgr : public hsKeyedObject
{
protected:
friend class pfMarkerInfo;
friend class pfMarkerInfoOwned;
// Because for some reason if I ask for my key, the refs hit zero when I release it (0 initial refs?)
plKey fMyKey;
plStatusLog* fLog;
static pfMarkerMgr* fInstance;
bool fShowingLocalMarkers;
bool fMarkersRespawn;
UInt32 fSelectedMarker;
static const UInt32 kNoMarkerSelected;
std::map<UInt32, pfMarkerInfo*> fMarkers; // key is marker id number
void IInit();
void IShutdown();
pfMarkerInfo* IFindMarker(plKey markerKey, UInt32& id);
void IUpdate();
void IMarkerHit(plKey markerKey, plKey playerKey);
pfMarkerMgr();
~pfMarkerMgr();
public:
CLASSNAME_REGISTER(pfMarkerMgr);
GETINTERFACE_ANY(pfMarkerMgr, hsKeyedObject);
static pfMarkerMgr* Instance();
static void Shutdown();
hsBool MsgReceive(plMessage* msg);
void AddMarker(double x, double y, double z, UInt32 id, bool justCreated);
void RemoveMarker(UInt32 id);
void RemoveAllMarkers();
void ClearSelectedMarker();
void SetSelectedMarker(UInt32 id);
UInt32 GetSelectedMarker();
void SetMarkersRespawn(bool respawn) {fMarkersRespawn = respawn;}
bool GetMarkersRespawn() {return fMarkersRespawn;}
void CaptureMarker(UInt32 id, bool captured); // for QUEST games (no teams)
void CaptureMarker(UInt32 id, int team); // for TEAM games (0 = not captured)
// Shows your markers locally, so you can see where they are
void LocalShowMarkers(bool show = true);
bool AreLocalMarkersShowing();
};
#endif // pfMarkerMgr_h_inc

File diff suppressed because it is too large Load Diff

View File

@ -1,133 +1,133 @@
/*==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/>.
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 plPlayerModifier_inc
//#define plPlayerModifier_inc
//
//#include "../pnModifier/plSingleModifier.h"
//#include "../pnSceneObject/plSimulationInterface.h"
//#include "hsMatrix44.h"
//
//class plControlEventMsg;
//
//namespace Havok {
// class Vector3;
//}
//
//class plPlayerModifier : public plSingleModifier
//{
//protected:
//
// enum
// {
// kWantsToSpawn = 0,
// kTimerSet,
// kHasSpawned,
// kNeedsLocalSetup
// };
//
// struct spawnPt
// {
// hsPoint3 pt;
// hsScalar dist;
// };
//
// static hsScalar fTurnRate;
//
// static hsScalar fAcceleration;
// static hsScalar fDeceleration;
// static hsScalar fMaxVelocity;
// hsScalar fCurSpeed;
//
//
// double fLastTime;
// hsMatrix44 fDesiredMatrix;
//
// hsPoint3 fDesiredPosition;
// hsPoint3 fFacingTarget;
// bool bUseDesiredFacing;
// bool bUseDesiredMatrix;
// bool bIgnoreDesiredMatrix;
//
// hsScalar fRotationScalar;
// hsTArray<spawnPt*> fSpawnPoints;
//
// void IAdjustVelocity(hsScalar adjAccelRate,
// hsScalar adjDecelRate,
// hsVector3* dir,
// hsVector3* vel,
// hsScalar maxSpeed,
// hsScalar distToGoal,
// double elapsedTime);
//
// hsScalar IClampVelocity(hsVector3* vel, hsScalar maxSpeed, double elapsedTime);
// hsBool32 IShouldDecelerate(hsScalar decelSpeed, hsScalar curSpeed, hsScalar distToGoal);
//
// hsBool HasMovementFlag(int f) const { return fMoveFlags.IsBitSet(f); }
// void SetMovementFlag(int f) { fMoveFlags.SetBit(f); }
// void ClearMovementFlag(int which) { fMoveFlags.ClearBit( which ); }
//
// hsBitVector fMoveFlags;
// hsBitVector fFlags;
//
// void WarpToSpawnPoint() { SetFlag( kWantsToSpawn ); }
//
// hsBool bMoving;
//
// void IApplyForce(plSimulationInterface::plSimpleForce type, const Havok::Vector3 &vec);
// void IDoLocalSetup(plSceneObject*);
// void IMakeUsListener( plSceneObject *so );
//
//public:
// plPlayerModifier();
// virtual ~plPlayerModifier();
//
// CLASSNAME_REGISTER( plPlayerModifier );
// GETINTERFACE_ANY( plPlayerModifier, plSingleModifier );
//
// virtual hsBool MsgReceive(plMessage* msg);
// virtual void AddTarget(plSceneObject* so);
// virtual void RemoveTarget(plSceneObject* so);
//
// hsBool HandleControlInput(plControlEventMsg* pMsg);
// virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
//
// void SetMoving(hsBool b);
// hsBool IsMoving() { return bMoving; }
//
// hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
// void SetFlag(int f) { fFlags.SetBit(f); }
// void ClearFlag(int which) { fFlags.ClearBit( which ); }
//
// static void SetTurnRate(float f) {fTurnRate = f;}
// static void SetAcceleration(float f) {fAcceleration = f;}
// static void SetDeceleration(float f) {fDeceleration = f;}
// static void SetVelocity(float f) {fMaxVelocity = f;}
//
//
//};
//
//#endif plPlayerModifier_inc
/*==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/>.
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 plPlayerModifier_inc
//#define plPlayerModifier_inc
//
//#include "../pnModifier/plSingleModifier.h"
//#include "../pnSceneObject/plSimulationInterface.h"
//#include "hsMatrix44.h"
//
//class plControlEventMsg;
//
//namespace Havok {
// class Vector3;
//}
//
//class plPlayerModifier : public plSingleModifier
//{
//protected:
//
// enum
// {
// kWantsToSpawn = 0,
// kTimerSet,
// kHasSpawned,
// kNeedsLocalSetup
// };
//
// struct spawnPt
// {
// hsPoint3 pt;
// hsScalar dist;
// };
//
// static hsScalar fTurnRate;
//
// static hsScalar fAcceleration;
// static hsScalar fDeceleration;
// static hsScalar fMaxVelocity;
// hsScalar fCurSpeed;
//
//
// double fLastTime;
// hsMatrix44 fDesiredMatrix;
//
// hsPoint3 fDesiredPosition;
// hsPoint3 fFacingTarget;
// bool bUseDesiredFacing;
// bool bUseDesiredMatrix;
// bool bIgnoreDesiredMatrix;
//
// hsScalar fRotationScalar;
// hsTArray<spawnPt*> fSpawnPoints;
//
// void IAdjustVelocity(hsScalar adjAccelRate,
// hsScalar adjDecelRate,
// hsVector3* dir,
// hsVector3* vel,
// hsScalar maxSpeed,
// hsScalar distToGoal,
// double elapsedTime);
//
// hsScalar IClampVelocity(hsVector3* vel, hsScalar maxSpeed, double elapsedTime);
// hsBool32 IShouldDecelerate(hsScalar decelSpeed, hsScalar curSpeed, hsScalar distToGoal);
//
// hsBool HasMovementFlag(int f) const { return fMoveFlags.IsBitSet(f); }
// void SetMovementFlag(int f) { fMoveFlags.SetBit(f); }
// void ClearMovementFlag(int which) { fMoveFlags.ClearBit( which ); }
//
// hsBitVector fMoveFlags;
// hsBitVector fFlags;
//
// void WarpToSpawnPoint() { SetFlag( kWantsToSpawn ); }
//
// hsBool bMoving;
//
// void IApplyForce(plSimulationInterface::plSimpleForce type, const Havok::Vector3 &vec);
// void IDoLocalSetup(plSceneObject*);
// void IMakeUsListener( plSceneObject *so );
//
//public:
// plPlayerModifier();
// virtual ~plPlayerModifier();
//
// CLASSNAME_REGISTER( plPlayerModifier );
// GETINTERFACE_ANY( plPlayerModifier, plSingleModifier );
//
// virtual hsBool MsgReceive(plMessage* msg);
// virtual void AddTarget(plSceneObject* so);
// virtual void RemoveTarget(plSceneObject* so);
//
// hsBool HandleControlInput(plControlEventMsg* pMsg);
// virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
//
// void SetMoving(hsBool b);
// hsBool IsMoving() { return bMoving; }
//
// hsBool HasFlag(int f) const { return fFlags.IsBitSet(f); }
// void SetFlag(int f) { fFlags.SetBit(f); }
// void ClearFlag(int which) { fFlags.ClearBit( which ); }
//
// static void SetTurnRate(float f) {fTurnRate = f;}
// static void SetAcceleration(float f) {fAcceleration = f;}
// static void SetDeceleration(float f) {fDeceleration = f;}
// static void SetVelocity(float f) {fMaxVelocity = f;}
//
//
//};
//
//#endif plPlayerModifier_inc