初步修复
This commit is contained in:
parent
8fc4357cc6
commit
e4714f3f0e
46705 changed files with 12004901 additions and 0 deletions
107
Server/ServerCommon/MasterSystemCacheRepository.h
Normal file
107
Server/ServerCommon/MasterSystemCacheRepository.h
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
class CDNUserSession;
|
||||
|
||||
namespace MasterSystem
|
||||
{
|
||||
const DWORD CACHETICK = (1000*30); // 30ÃÊ
|
||||
const DWORD CACHECLEARTICK = (1000*60*10); // 10ºÐ
|
||||
|
||||
class CCacheRepository:public CSingleton<CCacheRepository>
|
||||
{
|
||||
public:
|
||||
|
||||
CCacheRepository():m_dwCacheTick(0),m_uiCacheClearCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
void GetMasterList( CDNUserSession* pSession, UINT uiPage, BYTE cJob, BYTE cGender );
|
||||
void SetMasterList( CDNUserSession* pSession, TAGetPageMasterCharacter* pData );
|
||||
|
||||
void GetMasterCharacter( CDNUserSession* pSession, INT64 biCharacterDBID );
|
||||
void SetMasterCharacter( CDNUserSession* pSession, TAGetMasterCharacterType1* pData );
|
||||
|
||||
void GetMyMasterInfo( CDNUserSession* pSession, INT64 biPupilCharacterDBID, INT64 biMasterCharacterDBID, bool bRefresh );
|
||||
void SetMyMasterInto( CDNUserSession* pSession, TAGetMasterCharacterType2* pData );
|
||||
|
||||
const TPupilInfo* GetPupilInfo( INT64 biMasterCharacterDBID, INT64 biPupilCharacterDBID );
|
||||
void GetPupilList( CDNUserSession* pSession, INT64 biCharacterDBID, bool bRefresh );
|
||||
void SetPupilList( CDNUserSession* pSession, TAGetListPupil* pData );
|
||||
|
||||
void GetMasterClassmateList( CDNUserSession* pSession, INT64 biCharacterDBID, bool bRefresh );
|
||||
void SetMasterClassmateList( CDNUserSession* pSession, TAGetListMyMasterAndClassmate* pData );
|
||||
|
||||
void GetClassmateInfo( CDNUserSession* pSession, INT64 biClassmateCharacterDBID, bool bRefresh );
|
||||
void SetClassmateInfo( CDNUserSession* pSession, TAGetMyClassmate* pData );
|
||||
|
||||
TCommunityLocation GetLocationInfo( INT64 biCharacterDBID );
|
||||
|
||||
void SetRegisterMaster( CDNUserSession* pSession, TAAddMasterCharacter* pData );
|
||||
void SetRegisterMaster( CDNUserSession* pSession, TADelMasterCharacter* pData );
|
||||
|
||||
void ClearCache();
|
||||
|
||||
private:
|
||||
|
||||
CSyncLock m_Sync;
|
||||
|
||||
DWORD m_dwCacheTick;
|
||||
UINT m_uiCacheClearCount;
|
||||
|
||||
//#####################################################################################
|
||||
// [0]MasterList
|
||||
//#####################################################################################
|
||||
// Key:<Page,Job,Gender> : Value:<Tick,Data>
|
||||
//#####################################################################################
|
||||
|
||||
typedef std::map< std::tr1::tuple<UINT,BYTE,BYTE>, std::pair<DWORD,std::vector<TMasterInfo>> > MMasterList;
|
||||
typedef MMasterList::iterator MMasterListItor;
|
||||
|
||||
MMasterList m_mMasterList;
|
||||
|
||||
//#####################################################################################
|
||||
// [1]PupilList
|
||||
//#####################################################################################
|
||||
// Key:MasterCharacterDBID : value:<Tick,Data>
|
||||
//#####################################################################################
|
||||
|
||||
typedef std::map< INT64, std::pair<DWORD,std::vector<TPupilInfo>> > MPupilList;
|
||||
typedef MPupilList::iterator MPupilListItor;
|
||||
|
||||
MPupilList m_mPupilList;
|
||||
|
||||
//#####################################################################################
|
||||
// [2]Master&Classmate List
|
||||
//#####################################################################################
|
||||
// Key:PupilCharacterDBID : value:<Tick,Data>
|
||||
//#####################################################################################
|
||||
|
||||
typedef std::map< INT64, std::pair<DWORD,std::vector<TMasterAndClassmateInfo>> > MMasterClassmateList;
|
||||
typedef MMasterClassmateList::iterator MMasterClassmateListItor;
|
||||
|
||||
MMasterClassmateList m_mMasterClassmateList;
|
||||
|
||||
//#####################################################################################
|
||||
// [3]ClassmateInfo
|
||||
//#####################################################################################
|
||||
// Key:CharacterDBID : value:<Tick,Data>
|
||||
//#####################################################################################
|
||||
|
||||
typedef std::map< INT64, std::pair<DWORD,TClassmateInfo> > MClassmateInfoList;
|
||||
typedef MClassmateInfoList::iterator MClassmateInfoListItor;
|
||||
|
||||
MClassmateInfoList m_mClassmateList;
|
||||
|
||||
//#####################################################################################
|
||||
// [4]MyMasterInfo
|
||||
//#####################################################################################
|
||||
// Key:<PupilCharacterDBID,MasterCharacterDBID> : value:<Tick,Data>
|
||||
//#####################################################################################
|
||||
|
||||
typedef std::map< std::pair<INT64,INT64>, std::pair<DWORD,TMyMasterInfo> > MMyMasterInfoList;
|
||||
typedef MMyMasterInfoList::iterator MMyMasterInfoListItor;
|
||||
|
||||
MMyMasterInfoList m_mMyMasterList;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue