⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serversessionmanager.cpp

📁 奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码
💻 CPP
字号:
#include "stdafx.h"
#include ".\serversessionmanager.h"
#include "ServerSession.h"
#include <Macro.h>

ServerSessionManager::ServerSessionManager()
{
}

ServerSessionManager::~ServerSessionManager()
{
}

VOID ServerSessionManager::AddServer( ServerSession * pServer )
{
	ASSERT( FindServer( pServer->GetSessionIndex() ) == NULL );

	m_mapSessions.insert( SERVER_SESSION_PAIR( pServer->GetSessionIndex(), pServer ) );
}

ServerSession *	ServerSessionManager::FindServer( DWORD dwSessionIndex )
{
	SERVER_SESSION_MAP_ITER it = m_mapSessions.find( dwSessionIndex );

	if( it == m_mapSessions.end() ) return NULL;

	return it->second;
}

VOID ServerSessionManager::RemoveServer( DWORD dwSessionIndex )
{
#ifdef _DEBUG
	SERVER_SESSION_MAP_ITER it = m_mapSessions.find( dwSessionIndex );
	ASSERT( it != m_mapSessions.end() );
#endif

	m_mapSessions.erase( dwSessionIndex );
}

VOID ServerSessionManager::Update()
{
	SERVER_SESSION_MAP_ITER it;

	for( it = m_mapSessions.begin(); it != m_mapSessions.end(); ++it )
	{
		it->second->Update();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -