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

📄 masinfomanager.cpp

📁 墨香最新私服
💻 CPP
字号:
// MASInfoManager.cpp: implementation of the CMASInfoManager class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DS_RMTool.h"
#include "MASInfoManager.h"
#include "MHFile.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

GLOBALTON(CMASInfoManager)

CMASInfoManager::CMASInfoManager()
{
	memset( m_MASInfo, 0, sizeof(MASINFO)*10 );
	m_nCurMasInfo = -1;
	m_nMaxMasInfo = 0;
}

CMASInfoManager::~CMASInfoManager()
{
}

BOOL CMASInfoManager::ReadMasInfo( char* filename )
{
	CMHFile file;
	char temp[256];

	if( !file.Init( filename, "rt" ) )
		return FALSE;

	while( !file.IsEOF() )
	{
		strcpy( temp, strupr(file.GetString()) );

		if( temp[0] == '/' ) 
		{
			file.GetLine( temp, 256 );
			continue;
		}
		
		if( strcmp( temp, "*MASINFO" ) == 0 )
		{
			int index = file.GetInt();
			file.GetString( m_MASInfo[index].strIP );
			m_MASInfo[index].nPort = file.GetInt();
			m_MASInfo[index].nServerSet = file.GetInt();
			file.GetStringInQuotation( m_MASInfo[index].strServerName );
			++m_nMaxMasInfo;
		}
	}

	file.Release();

	return TRUE;	
}

⌨️ 快捷键说明

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