Exemplo n.º 1
0
//
// App is exiting
//
void plNetClientMgr::Shutdown()
{
    ISendDirtyState(hsTimer::GetSysSeconds());

    plNetLinkingMgr::GetInstance()->LeaveAge(true);

    // release all avatar clones
    IUnloadRemotePlayers();
    IUnloadNPCs();

    // Finally, pump the dispatch system so all the new refs get delivered.
    plgDispatch::Dispatch()->MsgQueueProcess();

    if (fMsgRecorder)
    {
        delete fMsgRecorder;
        fMsgRecorder = nil;
    }
    for (int i = 0; i < fMsgPlayers.size(); i++)
        delete fMsgPlayers[i];
    fMsgPlayers.clear();

    IRemoveCloneRoom();

    VaultDestroy();

    // commit hara-kiri
    UnRegisterAs(kNetClientMgr_KEY);
    SetInstance(nullptr);
}
Exemplo n.º 2
0
void plAutoProfileImp::IShutdown()
{
    // KLUDGE - Copy the load timing log, in case we used it
    #define kTimingLog      "readtimings.0.log"
    #define kAgeTimingLog   "agetimings.0.log"

    plFileSystem::Copy(plFileName::Join(plFileSystem::GetLogPath(), kTimingLog),
                       plFileName::Join(plProfileManagerFull::Instance().GetProfilePath(), kTimingLog));
    plFileSystem::Copy(plFileName::Join(plFileSystem::GetLogPath(), kAgeTimingLog),
                       plFileName::Join(plProfileManagerFull::Instance().GetProfilePath(), kAgeTimingLog));

#ifdef HS_BUILD_FOR_WIN32
    ShellExecute(nil, nil, "PostRun.bat", nil, nil, SW_SHOWNORMAL);
#endif

    plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
    plgDispatch::Dispatch()->UnRegisterForExactType(plInitialAgeStateLoadedMsg::Index(), GetKey());
    plgDispatch::Dispatch()->UnRegisterForExactType(plAgeLoadedMsg::Index(), GetKey());

    UnRegisterAs(kAutoProfile_KEY);
    // Pump the queue so we get fully unregistered
    plgDispatch::Dispatch()->MsgQueueProcess();

    plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit);
    clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY));
}
Exemplo n.º 3
0
void    plInputInterfaceMgr::Shutdown( void )
{
    int i;


//  WriteKeyMap();

    for( i = 0; i < fInterfaces.GetCount(); i++ )
    {
        fInterfaces[ i ]->Shutdown();
        hsRefCnt_SafeUnRef( fInterfaces[ i ] );
    }
    fInterfaces.Reset();

    for( i = 0; i < fMessageQueue.GetCount(); i++ )
        delete fMessageQueue[ i ];
    fMessageQueue.Reset();

    plgDispatch::Dispatch()->UnRegisterForType( plInputIfaceMgrMsg::Index(), GetKey() );
    plgDispatch::Dispatch()->UnRegisterForType( plInputEventMsg::Index(), GetKey() );

    plgDispatch::Dispatch()->UnRegisterForType( plEvalMsg::Index(), GetKey() );
    plgDispatch::Dispatch()->UnRegisterForExactType( plPlayerPageMsg::Index(), GetKey() );
    plgDispatch::Dispatch()->UnRegisterForExactType( plCmdIfaceModMsg::Index(), GetKey() );
    plgDispatch::Dispatch()->UnRegisterForExactType( plClientMsg::Index(), GetKey() );

    UnRegisterAs( kInputInterfaceMgr_KEY );
}
Exemplo n.º 4
0
void pfMarkerMgr::IShutdown()
{
    std::map<uint32_t, pfMarkerInfo*>::iterator curMarker = fMarkers.begin();
    while (curMarker != fMarkers.end())
    {
        curMarker->second->Remove();
        delete curMarker->second;
        ++curMarker;
    }
    fMarkers.clear();

    plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
    UnRegisterAs(kMarkerMgr_KEY);
}
Exemplo n.º 5
0
void plAgeLoader::Shutdown()
{
    plResPatcher::GetInstance()->Shutdown();
    UnRegisterAs(kAgeLoader_KEY);
    SetInstance(nullptr);
}
Exemplo n.º 6
0
void plAVIWriterImp::Shutdown()
{
    Close();
    UnRegisterAs(kAVIWriter_KEY);
    SetKey(nil);
}