Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
#include "stdafx.h"
|
|
#include "StatServerMultiDispatch.h"
|
|
|
|
#include <Network/Session/Session.h>
|
|
#include <Network/Dispatch/MultiDispatchStorage.h>
|
|
|
|
#include <Log/ServerLog.h>
|
|
#include <Setup/SetupClient.h>
|
|
|
|
enum StatServerConst
|
|
{
|
|
STAT_SERVER_DEFAULT_DISPATCH_NUM = 10
|
|
};
|
|
|
|
CMultiDispatch& CStatServerMultiDispatch::GetDispatchTable()
|
|
{
|
|
static CMultiDispatch multiDispatch;
|
|
return multiDispatch;
|
|
}
|
|
|
|
CStatServerMultiDispatch::CStatServerMultiDispatch(CSession& Session)
|
|
: CRylServerDispatch(Session, STAT_SERVER_DEFAULT_DISPATCH_NUM)
|
|
{
|
|
DETLOG1(g_Log, "this:0x%p/CStatServerMultiDispatch Created", this);
|
|
}
|
|
|
|
CStatServerMultiDispatch::~CStatServerMultiDispatch()
|
|
{
|
|
DETLOG1(g_Log, "this:0x%p/CStatServerMultiDispatch Destroyed", this);
|
|
}
|
|
|
|
void CStatServerMultiDispatch::Connected()
|
|
{
|
|
// 접속 IP를 key로 잡아서 세팅한다.
|
|
INET_Addr& remoteAddr = GetSession().GetRemoteAddr();
|
|
|
|
unsigned long dwDispatchID = remoteAddr.get_addr_in().sin_addr.S_un.S_addr;
|
|
GetDispatchTable().SetDispatch(dwDispatchID, this);
|
|
|
|
DETLOG2(g_Log, "this:0x%p/Key:%u/CStatServerMultiDispatch Connected", this, dwDispatchID);
|
|
}
|
|
|
|
void CStatServerMultiDispatch::Disconnected()
|
|
{
|
|
// 접속 IP를 key로 잡아서 삭제한다.
|
|
INET_Addr& remoteAddr = GetSession().GetRemoteAddr();
|
|
|
|
unsigned long dwDispatchID = remoteAddr.get_addr_in().sin_addr.S_un.S_addr;
|
|
GetDispatchTable().RemoveDispatch(dwDispatchID);
|
|
|
|
DETLOG2(g_Log, "this:0x%p/Key:%u/CStatServerMultiDispatch Disconnected", this, dwDispatchID);
|
|
}
|
|
|
|
|
|
bool CStatServerMultiDispatch::DispatchPacket(PktBase* lpPktBase)
|
|
{
|
|
return true;
|
|
} |