Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ylmbtm committed Oct 22, 2021
1 parent 2aa2e05 commit f9a74a0
Show file tree
Hide file tree
Showing 16 changed files with 608 additions and 515 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gitee地址: https://gitee.com/ylmbtm/GameProject3

交流QQ群 : 871115813
公众号:![public1](https://github.com/ylmbtm/resource/blob/master/20210818175029.png)
![public1](https://wx1.sinaimg.cn/mw2000/002dp2Ulgy1gvofyue87sj6065065wf602.jpg)


#### 体验客户端效果(群文件中有全部客户端代码及资源)
Expand Down
3 changes: 1 addition & 2 deletions Server/Src/CenterServer/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
// 特定于项目的包含文件
//


#ifndef __STDAFX__
#define __STDAFX__

#define HAVE_RINT 1
#include "ServerEngine.h"
#include "../ServerData/ServerDefine.h"
#endif
8 changes: 4 additions & 4 deletions Server/Src/LogicServer/PlayerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

CPlayerManager::CPlayerManager()
{
m_dwMaxCacheNum = CConfigFile::GetInstancePtr()->GetIntValue("max_cache_num");
if (m_dwMaxCacheNum <= 10)
m_nMaxCacheNum = CConfigFile::GetInstancePtr()->GetIntValue("max_cache_num");
if (m_nMaxCacheNum <= 10)
{
m_dwMaxCacheNum = 3000;
m_nMaxCacheNum = 3000;
}
TimerManager::GetInstancePtr()->AddFixTimer(0, 1, &CPlayerManager::ZeroTimer, this);
}
Expand Down Expand Up @@ -183,7 +183,7 @@ BOOL CPlayerManager::OnUpdate(UINT64 uTick)
}
}

if (uReleaseRoleID != 0 && GetCount() > m_dwMaxCacheNum)
if (uReleaseRoleID != 0 && GetCount() > m_nMaxCacheNum)
{
//当内存中的人数超过人,就清理一个离线时间最长的玩家
ReleasePlayer(uReleaseRoleID);
Expand Down
2 changes: 1 addition & 1 deletion Server/Src/LogicServer/PlayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CPlayerManager : public AVLTree<UINT64, CPlayerObject>
BOOL ReleaseAll();
public:

UINT32 m_dwMaxCacheNum;
INT32 m_nMaxCacheNum;
};

#endif //__WS_PLAYER_OBJECT_H__
3 changes: 3 additions & 0 deletions Server/Src/ServerEngine/CommonConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ std::string FloatToString(FLOAT fValue, INT32 nPrecision = -1, BOOL bRound = FAL
BOOL IsTextUTF8(const char* str, INT32 nLength);

INT32 GetValidUtf8Length(char* pStr, INT32 nLen);

std::string TruncateUtf8(char* pStr, INT32 nLen);

BOOL SpliteString(std::string strSrc, std::string strDelim, std::vector<std::string>& vtStr);

BOOL SpliteStringByBlank(std::string strSrc, std::vector<std::string>& vtStr);

BOOL SpliteString(std::string strSrc, char cDelim, std::vector<std::string>& vtStr);
Expand Down
Loading

0 comments on commit f9a74a0

Please sign in to comment.