Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ylmbtm committed Jun 19, 2019
1 parent 4868b53 commit f9e351f
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 52 deletions.
1 change: 0 additions & 1 deletion Server/Src/LogicServer/GuildManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class CGuildManager

CGuild* GetGuildByID(UINT64 u64ID);


CGuild* CreateGuild(UINT64 uRoleID, std::string& strName, INT32 nIcon);

BOOL RemoveGuild(UINT64 uGuildID);
Expand Down
4 changes: 3 additions & 1 deletion Server/Src/LogicServer/PlayerObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CPlayerObject
//向玩家所在的场景服发消息
BOOL SendMsgToScene(UINT32 dwMsgID, const google::protobuf::Message& pdata);

BOOL ToTransferData(TransferDataItem *pTransItem);
BOOL ToTransferData(TransferDataItem* pTransItem);

BOOL NotifyTaskEvent(UINT32 dwEventID, UINT32 dwParam1, UINT32 dwParm2);

Expand Down Expand Up @@ -95,6 +95,8 @@ class CPlayerObject
BOOL m_IsOnline;
std::vector<CModuleBase*> m_MoudleList;



public:
UINT32 m_dwCopyGuid; //当前的副本ID
UINT32 m_dwCopyID; //当前的副本类型
Expand Down
9 changes: 5 additions & 4 deletions Server/Src/ServerData/GuildData.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ struct GuildDataObject : public ShareObject
memset(m_szNotice, 0, GUILD_NOTICE_LEN);
}

UINT64 m_uGuid; //格子的guid
CHAR m_szName[GUILD_NAME_LEN];
CHAR m_szNotice[GUILD_NOTICE_LEN];
INT32 m_Level;
INT32 m_Level; //等级
UINT64 m_uGuid; //guid
CHAR m_szName[GUILD_NAME_LEN]; //名字
CHAR m_szNotice[GUILD_NOTICE_LEN]; //公告
UINT64 m_ApplyRoles[GUILD_MAX_APPLY_NUM]; //申请id

BOOL Create(IDBInterface* pDB)
{
Expand Down
42 changes: 21 additions & 21 deletions Server/Src/ServerData/RoleData.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ struct RoleDataObject : public ShareObject
memset(m_szName, 0, ROLE_NAME_LEN);
}

UINT64 m_uRoleID; //角色ID
UINT64 m_uAccountID; //账号ID
CHAR m_szName[ROLE_NAME_LEN]; //角色名
INT32 m_CarrerID; //职业ID
INT32 m_Level; //等级
INT64 m_Action[ACTION_NUM]; //所有的体力
INT64 m_Actime[ACTION_NUM]; //体力恢复时间
INT64 m_Exp; //经验
INT32 m_nLangID; //语言ID
INT64 m_u64Fight; //战力
INT32 m_VipLvl; //VIP等级
INT32 m_VipExp; //VIP经验
INT32 m_CityCopyID; //主城副本类型
BOOL m_bDelete; //是否删除
INT64 m_uQQ; //QQ号
UINT64 m_uCreateTime; //角色创建时间
UINT64 m_uLogonTime; //本次登录时间
UINT64 m_uLogoffTime; //离线时间
UINT64 m_uRoleID; //角色ID
UINT64 m_uAccountID; //账号ID
CHAR m_szName[ROLE_NAME_LEN];//角色名
INT32 m_CarrerID; //职业ID
INT32 m_Level; //等级
INT64 m_Action[ACTION_NUM]; //所有的体力
INT64 m_Actime[ACTION_NUM]; //体力恢复时间
INT64 m_Exp; //经验
INT32 m_nLangID; //语言ID
INT64 m_u64Fight; //战力
INT32 m_VipLvl; //VIP等级
INT32 m_VipExp; //VIP经验
INT32 m_CityCopyID; //主城副本类型
BOOL m_bDelete; //是否删除
INT64 m_uQQ; //QQ号
UINT64 m_uCreateTime; //角色创建时间
UINT64 m_uLogonTime; //本次登录时间
UINT64 m_uLogoffTime; //离线时间

//签到数据
INT32 m_nSignNum; //签到天数
UINT32 m_nSignDay; //最新的签到时间
UINT32 m_RecvAction; //领取体力标记
INT32 m_nSignNum; //签到天数
UINT32 m_nSignDay; //最新的签到时间
UINT32 m_RecvAction; //领取体力标记

BOOL Create(IDBInterface* pDB)
{
Expand Down
1 change: 1 addition & 0 deletions Server/Src/ServerData/ServerDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
//公会名长度
#define GUILD_NAME_LEN 255
#define GUILD_NOTICE_LEN 1024
#define GUILD_MAX_APPLY_NUM 50

//语言数
#define MAX_LANGUAGE_NUM 15
Expand Down
38 changes: 25 additions & 13 deletions Server/Src/ServerEngine/EventFuncManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ class CFunctionSlotBase
{
public:
virtual ~CFunctionSlotBase() {}
virtual BOOL operator()(void* pdata) { return TRUE; }
virtual UINT32 GetParam() { return 0; }
virtual VOID* GetThisAddr() { return 0; }
virtual VOID EmptyThisAddr() {}
virtual BOOL operator()(void* pdata)
{
return TRUE;
}
virtual UINT32 GetParam() = 0;

virtual VOID* GetThisAddr() = 0;

virtual VOID EmptyThisAddr() = 0;
};


Expand All @@ -33,12 +38,12 @@ class CFunctionSlot : public CFunctionSlotBase
return true;
}
else
{
return false;
{
return false;
}
}

virtual UINT32 getParma()
virtual UINT32 GetParma()
{
return m_dwParam;
}
Expand All @@ -60,6 +65,8 @@ class CFunctionSlot : public CFunctionSlotBase
UINT32 m_dwParam;
};

typedef std::map< int, std::vector<CFunctionSlotBase* >* > FUNC_MAP_TYPE;

class CEventFuncManager
{
public:
Expand Down Expand Up @@ -105,7 +112,7 @@ class CEventFuncManager
}

template<typename T>
bool UnregisterMessageHandle(int nMsgID, T* pObj)
bool UnregisterMessageHandle(int nMsgID, T* pObj, int nParam = 0)
{
std::vector<CFunctionSlotBase* >* vec = NULL;
FUNC_MAP_TYPE::iterator it = m_FuncMap.find(nMsgID);
Expand All @@ -120,12 +127,18 @@ class CEventFuncManager

for (std::vector<CFunctionSlotBase* >::iterator itor = vec->begin(); itor != vec->end(); ++itor)
{
if ((*itor)->GetThisAddr() == reinterpret_cast<void*>(pObj))
if ((*itor)->GetThisAddr() != reinterpret_cast<void*>(pObj))
{
continue;
}

if ((*itor)->GetParam() != nParam)
{
//反注册并不真实删除,只是将this指针置空
(*itor)->EmptyThisAddr();
continue;
}

//反注册并不真实删除,只是将this指针置空
(*itor)->EmptyThisAddr();
}
return true;
}
Expand All @@ -149,8 +162,7 @@ class CEventFuncManager
}

protected:
std::map<int, std::vector<CFunctionSlotBase*>* > m_FuncMap;
typedef std::map< int, std::vector<CFunctionSlotBase* >* > FUNC_MAP_TYPE;
FUNC_MAP_TYPE m_FuncMap;
};

#endif // _EVENT_MANAGER_H__
1 change: 0 additions & 1 deletion Server/Src/ServerEngine/TimerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ BOOL TimerManager::DelTimer(UINT32 dwSec, UINT32 dwData)
pDelEvent = pDelEvent->m_pNext;
}


if(pDelEvent == m_pUsedHead)
{
m_pUsedHead = m_pUsedHead->m_pNext;
Expand Down
11 changes: 0 additions & 11 deletions Server/Src/ServerEngine/TimerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,6 @@ class EngineClass TimerManager
m_pUsedHead->m_pPrev = NULL;
}

//TimeEvent *pInserPos = m_pHead;
//while(pInserPos != NULL)
//{
// if(pNewEvent->dwFireTime < pInserPos->dwFireTime)
// {
//
//
// return TRUE;
// }
//}

return TRUE;
}

Expand Down

0 comments on commit f9e351f

Please sign in to comment.