@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# include "plNetCliAgeJoiner.h"
# include "plNetCliAgeJoiner.h"
# include "plNetClientMgr.h"
# include "plNetClientMgr.h"
# include "plNetLinkingMgr.h"
# include "plNetLinkingMgr.h"
# include "plNetObjectDebugger.h"
# include "pnSceneObject/plSceneObject.h"
# include "pnSceneObject/plSceneObject.h"
# include "pnSceneObject/plCoordinateInterface.h"
# include "pnSceneObject/plCoordinateInterface.h"
@ -59,6 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# include "plNetClientComm/plNetClientComm.h"
# include "plNetClientComm/plNetClientComm.h"
# include "plAgeLoader/plAgeLoader.h"
# include "plAgeLoader/plAgeLoader.h"
# include "plAvatar/plArmatureMod.h"
# include "plAvatar/plAvatarMgr.h"
# include "plAvatar/plAvatarMgr.h"
# include "plVault/plVault.h"
# include "plVault/plVault.h"
@ -100,11 +102,13 @@ struct plNCAgeJoiner {
FNCAgeJoinerCallback callback ;
FNCAgeJoinerCallback callback ;
void * userState ;
void * userState ;
bool complete ;
bool complete ;
bool muteLinkSfx ;
plOperationProgress * progressBar ;
plOperationProgress * progressBar ;
plNCAgeJoiner (
plNCAgeJoiner (
const NetCommAge & age ,
const NetCommAge & age ,
bool muteSfx ,
FNCAgeJoinerCallback callback ,
FNCAgeJoinerCallback callback ,
void * userState
void * userState
) ;
) ;
@ -157,10 +161,12 @@ void AgeVaultDownloadCallback (
//============================================================================
//============================================================================
plNCAgeJoiner : : plNCAgeJoiner (
plNCAgeJoiner : : plNCAgeJoiner (
const NetCommAge & age ,
const NetCommAge & age ,
bool muteSfx ,
FNCAgeJoinerCallback callback ,
FNCAgeJoinerCallback callback ,
void * userState
void * userState
) : nextOp ( kNoOp )
) : nextOp ( kNoOp )
, age ( age )
, age ( age )
, muteLinkSfx ( muteSfx )
, callback ( callback )
, callback ( callback )
, userState ( userState )
, userState ( userState )
, complete ( false )
, complete ( false )
@ -354,7 +360,7 @@ void plNCAgeJoiner::ExecNextOp () {
nc - > SetFlagsBit ( plNetClientApp : : kPlayingGame ) ;
nc - > SetFlagsBit ( plNetClientApp : : kPlayingGame ) ;
nc - > SetFlagsBit ( plNetClientApp : : kNeedToSendInitialAgeStateLoadedMsg ) ;
nc - > SetFlagsBit ( plNetClientApp : : kNeedToSendInitialAgeStateLoadedMsg ) ;
plAgeLoader : : GetInstance ( ) - > NotifyAgeLoaded ( true ) ;
plAgeLoader : : GetInstance ( ) - > NotifyAgeLoaded ( true ) ;
Complete ( true , " Age joined " ) ;
nextOp = kNoOp ;
}
}
break ;
break ;
@ -449,6 +455,36 @@ bool plNCAgeJoiner::MsgReceive (plMessage * msg) {
return true ;
return true ;
}
}
//========================================================================
// Done loading all states. Time to link in!
//========================================================================
plInitialAgeStateLoadedMsg * stateMsg = plInitialAgeStateLoadedMsg : : ConvertNoRef ( msg ) ;
if ( stateMsg ) {
plNetObjectDebugger : : GetInstance ( ) - > LogMsg ( " OnServerInitComplete " ) ;
nc - > SetFlagsBit ( plNetClientApp : : kLoadingInitialAgeState , false ) ;
const plArmatureMod * avMod = plAvatarMgr : : GetInstance ( ) - > GetLocalAvatar ( ) ;
plLinkEffectsTriggerMsg * lem = new plLinkEffectsTriggerMsg ( ) ;
lem - > SetLeavingAge ( false ) ; // linking in
lem - > SetLinkKey ( nc - > GetLocalPlayerKey ( ) ) ;
plKey animKey = avMod - > GetLinkInAnimKey ( ) ;
lem - > SetLinkInAnimKey ( animKey ) ;
// indicate if we are invisible
if ( avMod & & avMod - > IsInStealthMode ( ) & & avMod - > GetTarget ( 0 ) )
lem - > SetInvisLevel ( avMod - > GetStealthLevel ( ) ) ;
lem - > SetBCastFlag ( plMessage : : kNetPropagate ) ;
lem - > MuteLinkSfx ( muteLinkSfx ) ;
lem - > AddReceiver ( hsgResMgr : : ResMgr ( ) - > FindKey ( plUoid ( kLinkEffectsMgr_KEY ) ) ) ;
lem - > AddReceiver ( hsgResMgr : : ResMgr ( ) - > FindKey ( plUoid ( kClient_KEY ) ) ) ;
lem - > Send ( ) ;
Complete ( true , " Age joined " ) ;
return true ;
}
return false ;
return false ;
}
}
@ -469,6 +505,7 @@ void plNCAgeJoiner::Update () {
void NCAgeJoinerCreate (
void NCAgeJoinerCreate (
plNCAgeJoiner * * pjoiner ,
plNCAgeJoiner * * pjoiner ,
const NetCommAge & age ,
const NetCommAge & age ,
bool muteSfx ,
FNCAgeJoinerCallback callback ,
FNCAgeJoinerCallback callback ,
void * userState
void * userState
) {
) {
@ -478,6 +515,7 @@ void NCAgeJoinerCreate (
plNCAgeJoiner * joiner ;
plNCAgeJoiner * joiner ;
* pjoiner = joiner = new plNCAgeJoiner (
* pjoiner = joiner = new plNCAgeJoiner (
age ,
age ,
muteSfx ,
callback ,
callback ,
userState
userState
) ;
) ;