|
|
@ -547,12 +547,14 @@ bool plNetLinkingMgr::IProcessVaultNotifyMsg(plVaultNotifyMsg* msg) |
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
bool plNetLinkingMgr::IDispatchMsg( plMessage * msg, uint32_t playerID ) |
|
|
|
bool plNetLinkingMgr::IDispatchMsg( plMessage* msg, LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
plNetClientMgr * nc = plNetClientMgr::GetInstance(); |
|
|
|
plNetClientMgr * nc = plNetClientMgr::GetInstance(); |
|
|
|
|
|
|
|
|
|
|
|
msg->AddReceiver( plNetClientMgr::GetInstance()->GetKey() ); |
|
|
|
msg->AddReceiver( plNetClientMgr::GetInstance()->GetKey() ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plLinkToAgeMsg* linkToAge = plLinkToAgeMsg::ConvertNoRef(msg); |
|
|
|
|
|
|
|
if (linkToAge) |
|
|
|
|
|
|
|
linkToAge->PlayLinkSfx(hsTestBits(sfx, kPlayLinkIn), hsTestBits(sfx, kPlayLinkOut)); |
|
|
|
if ( playerID!=kInvalidPlayerID && playerID!=nc->GetPlayerID() ) |
|
|
|
if ( playerID!=kInvalidPlayerID && playerID!=nc->GetPlayerID() ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
msg->SetBCastFlag( plMessage::kNetAllowInterAge ); |
|
|
|
msg->SetBCastFlag( plMessage::kNetAllowInterAge ); |
|
|
@ -563,17 +565,17 @@ bool plNetLinkingMgr::IDispatchMsg( plMessage * msg, uint32_t playerID ) |
|
|
|
msg->AddNetReceiver( playerID ); |
|
|
|
msg->AddNetReceiver( playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( msg->Send()!=0 ); |
|
|
|
return msg->Send(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkToAge( plAgeLinkStruct * link, uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToAge( plAgeLinkStruct * link, LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LinkToAge(link, nil, playerID); |
|
|
|
LinkToAge(link, nil, sfx, playerID); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkToAge( plAgeLinkStruct * link, const char* linkAnim, uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToAge( plAgeLinkStruct * link, const char* linkAnim, LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -584,11 +586,11 @@ void plNetLinkingMgr::LinkToAge( plAgeLinkStruct * link, const char* linkAnim, u |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( link ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( link ); |
|
|
|
if (linkAnim) |
|
|
|
if (linkAnim) |
|
|
|
pMsg->SetLinkInAnimName(linkAnim); |
|
|
|
pMsg->SetLinkInAnimName(linkAnim); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, sfx, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// link myself back to my last age
|
|
|
|
// link myself back to my last age
|
|
|
|
void plNetLinkingMgr::LinkToPrevAge( uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToPrevAge( LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -599,7 +601,7 @@ void plNetLinkingMgr::LinkToPrevAge( uint32_t playerID ) |
|
|
|
if (GetPrevAgeLink()->GetAgeInfo()->HasAgeFilename()) |
|
|
|
if (GetPrevAgeLink()->GetAgeInfo()->HasAgeFilename()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( GetPrevAgeLink() ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( GetPrevAgeLink() ); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, sfx, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -607,7 +609,7 @@ void plNetLinkingMgr::LinkToPrevAge( uint32_t playerID ) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkToMyPersonalAge( uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToMyPersonalAge( LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -625,10 +627,10 @@ void plNetLinkingMgr::LinkToMyPersonalAge( uint32_t playerID ) |
|
|
|
link.SetSpawnPoint(hutSpawnPoint); |
|
|
|
link.SetSpawnPoint(hutSpawnPoint); |
|
|
|
|
|
|
|
|
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( &link ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( &link ); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, sfx, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkToMyNeighborhoodAge( uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToMyNeighborhoodAge( LinkSfx sfx, uint32_t playerID ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -644,10 +646,10 @@ void plNetLinkingMgr::LinkToMyNeighborhoodAge( uint32_t playerID ) |
|
|
|
link.SetLinkingRules( plNetCommon::LinkingRules::kOwnedBook ); |
|
|
|
link.SetLinkingRules( plNetCommon::LinkingRules::kOwnedBook ); |
|
|
|
|
|
|
|
|
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( &link ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( &link ); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, sfx, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkPlayerHere( uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkPlayerHere( uint32_t playerID, LinkSfx sfx ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -659,10 +661,10 @@ void plNetLinkingMgr::LinkPlayerHere( uint32_t playerID ) |
|
|
|
// send the player our current age info so they can link here.
|
|
|
|
// send the player our current age info so they can link here.
|
|
|
|
plAgeLinkStruct link; |
|
|
|
plAgeLinkStruct link; |
|
|
|
link.GetAgeInfo()->CopyFrom( GetAgeLink()->GetAgeInfo() ); |
|
|
|
link.GetAgeInfo()->CopyFrom( GetAgeLink()->GetAgeInfo() ); |
|
|
|
LinkPlayerToAge( &link, playerID ); |
|
|
|
LinkPlayerToAge( &link, playerID, sfx ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkPlayerToAge( plAgeLinkStruct * link, uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkPlayerToAge( plAgeLinkStruct * link, uint32_t playerID, LinkSfx sfx ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
if ( !fLinkingEnabled ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -674,7 +676,7 @@ void plNetLinkingMgr::LinkPlayerToAge( plAgeLinkStruct * link, uint32_t playerID |
|
|
|
// send the player the age link so they can link there.
|
|
|
|
// send the player the age link so they can link there.
|
|
|
|
link->SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); |
|
|
|
link->SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( link ); |
|
|
|
plLinkToAgeMsg* pMsg = new plLinkToAgeMsg( link ); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, sfx, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -693,7 +695,7 @@ void plNetLinkingMgr::LinkPlayerToPrevAge( uint32_t playerID ) |
|
|
|
|
|
|
|
|
|
|
|
plLinkingMgrMsg* pMsg = new plLinkingMgrMsg(); |
|
|
|
plLinkingMgrMsg* pMsg = new plLinkingMgrMsg(); |
|
|
|
pMsg->SetCmd( kLinkPlayerToPrevAge); |
|
|
|
pMsg->SetCmd( kLinkPlayerToPrevAge); |
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, kPlayBoth, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void plNetLinkingMgr::LinkToPlayersAge( uint32_t playerID ) |
|
|
|
void plNetLinkingMgr::LinkToPlayersAge( uint32_t playerID ) |
|
|
@ -709,7 +711,7 @@ void plNetLinkingMgr::LinkToPlayersAge( uint32_t playerID ) |
|
|
|
plLinkingMgrMsg* pMsg = new plLinkingMgrMsg(); |
|
|
|
plLinkingMgrMsg* pMsg = new plLinkingMgrMsg(); |
|
|
|
pMsg->SetCmd( kLinkPlayerHere ); |
|
|
|
pMsg->SetCmd( kLinkPlayerHere ); |
|
|
|
pMsg->GetArgs()->AddInt( 0, NetCommGetPlayer()->playerInt ); // send them our id.
|
|
|
|
pMsg->GetArgs()->AddInt( 0, NetCommGetPlayer()->playerInt ); // send them our id.
|
|
|
|
IDispatchMsg( pMsg, playerID ); |
|
|
|
IDispatchMsg( pMsg, kPlayBoth, playerID ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|