Beispiel #1
0
int LoadModuleData(CServerObject* pServerObject)
{
	g_pServerObject = pServerObject;
	OUR_DEBUG((LM_INFO, "[Base LoadModuleData] Begin.\n"));
	if(g_pServerObject != NULL)
	{
		g_BaseCommand.SetServerObject(pServerObject);	
	}
	else
	{
		OUR_DEBUG((LM_INFO, "[Base LoadModuleData] pServerObject is NULL.\n"));
	}

	IMessageManager* pMessageManager = g_pServerObject->GetMessageManager();
	if(NULL != pMessageManager)
	{
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_HEAD, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_NOHEAD, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_HEADBUFF, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_NOHEADBUFF, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_LOGDATA, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(COMMAND_AUTOTEST_WORKTIMEOUT, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(CLIENT_LINK_CONNECT, &g_BaseCommand, g_szName);
		pMessageManager->AddClientCommand(CLIENT_LINK_CDISCONNET, &g_BaseCommand, g_szName);
	}
	else
	{
		OUR_DEBUG((LM_INFO, "[Base LoadModuleData] pMessageManager = NULL.\n"));
	}

	//显示框架工作线程ID
	OUR_DEBUG((LM_INFO, "[Base LoadModuleData] *********************************.\n"));

	uint32 u4WorkThread = pMessageManager->GetWorkThreadCount();
	OUR_DEBUG((LM_INFO, "[Base LoadModuleData] WorkThreadCount=%d.\n", u4WorkThread));

	for(uint32 u4Index = 0; u4Index < u4WorkThread; u4Index++)
	{
		OUR_DEBUG((LM_INFO, "[Base LoadModuleData] WorkThreadID=%d.\n", pMessageManager->GetWorkThreadByIndex(u4Index)));
	}

	OUR_DEBUG((LM_INFO, "[Base LoadModuleData] *********************************.\n"));

	OUR_DEBUG((LM_INFO, "[Base LoadModuleData] End.\n"));

	return 0;
}
Beispiel #2
0
int LoadModuleData(CServerObject* pServerObject)
{
  g_pServerObject = pServerObject;
  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] Begin.\n"));
  if(g_pServerObject != NULL)
  {
    g_BaseCommand.SetServerObject(pServerObject);	
  }
  else
  {
    OUR_DEBUG((LM_INFO, "[Base LoadModuleData] pServerObject is NULL.\n"));
  }

  IMessageManager* pMessageManager = g_pServerObject->GetMessageManager();
  if(NULL != pMessageManager)
  {
	pMessageManager->AddClientCommand(COMMAND_LOGIC_LG_LOGIN, &g_BaseCommand, g_szName);
	pMessageManager->AddClientCommand(COMMAND_LOGIC_ALIVE, &g_BaseCommand, g_szName);
	pMessageManager->AddClientCommand(COMMAND_LOGIC_LG_LIST, &g_BaseCommand, g_szName);

    pMessageManager->AddClientCommand(CLIENT_LINK_CONNECT, &g_BaseCommand, g_szName);
    pMessageManager->AddClientCommand(CLIENT_LINK_CDISCONNET, &g_BaseCommand, g_szName);
	pMessageManager->AddClientCommand(CLINET_LINK_SENDTIMEOUT, &g_BaseCommand, g_szName);
  }
  else
  {
    OUR_DEBUG((LM_INFO, "[Base LoadModuleData] pMessageManager = NULL.\n"));
  }

  //显示框架工作线程ID
  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] *********************************.\n"));

  uint32 u4WorkThread = pMessageManager->GetWorkThreadCount();
  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] WorkThreadCount=%d.\n", u4WorkThread));

  for(uint32 u4Index = 0; u4Index < u4WorkThread; u4Index++)
  {
	  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] WorkThreadID=%d.\n", pMessageManager->GetWorkThreadByIndex(u4Index)));
  }

  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] *********************************.\n"));
  g_BaseCommand.ReadIniFile(pServerObject->GetModuleInfo()->GetModuleParam(g_szName));
  OUR_DEBUG((LM_INFO, "[Base LoadModuleData] End.\n"));

  return 0;
}