Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ylmbtm committed Feb 22, 2022
1 parent aecd4b9 commit ac9fde8
Show file tree
Hide file tree
Showing 28 changed files with 1,929 additions and 1,939 deletions.
17 changes: 14 additions & 3 deletions Server/Src/DBServer/DBWriterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,21 @@ void CDBWriterManager::DBWriteThread()
}
}

BOOL bHasWrite = WriteDataToDB();
if (!bHasWrite && IsStop())
if (IsStop())
{
break;
CLog::GetInstancePtr()->LogError("开始退出将所有己修改的数据写入数据库.....");
BOOL bHasWrite = WriteDataToDB();
if (!bHasWrite)
{
CLog::GetInstancePtr()->LogError("所有己修改的数据己写入数据库.");
break;
}

continue;
}
else
{
WriteDataToDB();
}

CommonFunc::Sleep(60000); //休息10秒
Expand Down
2 changes: 1 addition & 1 deletion Server/Src/GameServer/GameService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

CGameService::CGameService(void)
{
m_nLogicConnID = 0;
m_nLogicConnID = 0;
m_nProxyConnID = 0;
m_nServerID = 0;
}
Expand Down
52 changes: 26 additions & 26 deletions Server/Src/GameServer/GameStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ struct St_SkillData

typedef struct St_ObjectStatus
{
union
{
UINT32 dwValues;
struct
{
UINT32 nDir : 9; // 朝向
UINT32 bDead : 1; // 是否死亡
};
};
union
{
UINT32 dwValues;
struct
{
UINT32 nDir : 9; // 朝向
UINT32 bDead : 1; // 是否死亡
};
};
} St_ObjectStatus;

typedef struct St_ChangeStatus
{
union
{
UINT32 dwValue;
struct
{
UINT32 bBase : 1; // 基础数据,属性, 行动状态, 坐标, 朝向
UINT32 bDead : 1; // 是否死亡
UINT32 bEquip : 1; // 装备
UINT32 bActor : 1; // 角色
UINT32 bAction : 1; // 行动状态
UINT32 bBuff : 1; // BUFF
UINT32 bLevel : 1; // 等级
UINT32 bControl: 1; // 控制权
UINT32 bCamp : 1; // 阵营
UINT32 bMount : 1; // 坐骑
};
};
union
{
UINT32 dwValue;
struct
{
UINT32 bBase : 1; // 基础数据,属性, 行动状态, 坐标, 朝向
UINT32 bDead : 1; // 是否死亡
UINT32 bEquip : 1; // 装备
UINT32 bActor : 1; // 角色
UINT32 bAction : 1; // 行动状态
UINT32 bBuff : 1; // BUFF
UINT32 bLevel : 1; // 等级
UINT32 bControl: 1; // 控制权
UINT32 bCamp : 1; // 阵营
UINT32 bMount : 1; // 坐骑
};
};
} St_ChangeStatus;


Expand Down
4 changes: 2 additions & 2 deletions Server/Src/GameServer/GridManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ BOOL CGridManager::GetSurroundingGrids( INT32 nIndex, INT32 sGridsp[10])
return TRUE;
}

BOOL CGridManager::IsObjectExist(CMapObject* pMapObject, INT32 dwIndex)
BOOL CGridManager::IsObjectExist(CMapObject* pMapObject, INT32 nIndex)
{
CGrid* pGrid = GetGridByIndex(dwIndex);
CGrid* pGrid = GetGridByIndex(nIndex);

ERROR_RETURN_FALSE(pGrid != NULL);

Expand Down
2 changes: 1 addition & 1 deletion Server/Src/GameServer/GridManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CGridManager : public std::vector<CGrid>
BOOL GetSurroundingGrids(INT32 nIndex, INT32 sGridsp[10]);

//以下是用来测试的方法
BOOL IsObjectExist(CMapObject* pMapObject, INT32 dwIndex);
BOOL IsObjectExist(CMapObject* pMapObject, INT32 nIndex);

public:

Expand Down
6 changes: 3 additions & 3 deletions Server/Src/GameServer/MonsterCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ BOOL MonsterCreator::OnUpdate(UINT64 uTick)
return TRUE;
}

BOOL MonsterCreator::GenMonsterWave(INT32 dwWaveIndex)
BOOL MonsterCreator::GenMonsterWave(INT32 nWaveIndex)
{
if(dwWaveIndex >= (INT32)m_MonsterVaveList.size())
if(nWaveIndex >= (INT32)m_MonsterVaveList.size())
{
return FALSE;
}

MonsterWave& Wave = m_MonsterVaveList.at(dwWaveIndex);
MonsterWave& Wave = m_MonsterVaveList.at(nWaveIndex);

for( std::vector<MonsterData>::iterator itor = Wave.m_vtMonsterList.begin(); itor != Wave.m_vtMonsterList.end(); itor++)
{
Expand Down
15 changes: 7 additions & 8 deletions Server/Src/LogData/LogStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ struct Log_BaseData
CHAR m_szIdfa[64] = { 0 }; //客户端idfa
CHAR m_szRoleName[64] = { 0 };
//以下两条仅角色日志有效
UINT32 m_nLevel = 0;//角色等级
UINT32 m_nVipLevel = 0;//角色VIP等级
UINT32 m_nAddWay = 0;//
INT32 m_nLevel = 0;//角色等级
INT32 m_nVipLevel = 0;//角色VIP等级
INT32 m_nAddWay = 0;//
};

struct Log_AccountCreate : public Log_BaseData
Expand Down Expand Up @@ -95,7 +95,7 @@ struct Log_RoleCreate : public Log_BaseData

struct Log_RoleLogin : public Log_BaseData
{

INT32 m_nIpAddr = 0; //登录IP
Log_RoleLogin()
{
m_LogType = ELT_ROLE_LOGIN;
Expand Down Expand Up @@ -199,12 +199,11 @@ struct Log_RoleChat : public Log_BaseData
return TRUE;
}
};
//金币获取(游戏币)

//等级变化日志
struct Log_RoleLevel : public Log_BaseData
{
UINT64 m_uPreValue;
UINT64 m_uAfterValue;

UINT32 m_uPreValue = 0;
Log_RoleLevel()
{
m_LogType = ELT_ROLE_LEVEL;
Expand Down
Loading

0 comments on commit ac9fde8

Please sign in to comment.