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_BASE, &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"));
  }		

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

  return 0;
}
Beispiel #2
0
int UnLoadModuleData()
{
  OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] Begin.\n"));
  if(g_pServerObject != NULL)
  {
    IMessageManager* pMessageManager = g_pServerObject->GetMessageManager();
    if(NULL != pMessageManager)
    {
      pMessageManager->DelClientCommand(COMMAND_BASE, &g_BaseCommand);
      pMessageManager->DelClientCommand(CLIENT_LINK_CONNECT, &g_BaseCommand);
      pMessageManager->DelClientCommand(CLIENT_LINK_CDISCONNET, &g_BaseCommand);
      pMessageManager = NULL;
    }
  }
  OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] End.\n"));
  return 0;
}
Beispiel #3
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;
}
Beispiel #4
0
int UnLoadModuleData()
{
  OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] Begin.\n"));
  if(g_pServerObject != NULL)
  {
    IMessageManager* pMessageManager = g_pServerObject->GetMessageManager();
    if(NULL != pMessageManager)
    {
      pMessageManager->DelClientCommand(COMMAND_LOGIN, &g_BaseCommand);
	  pMessageManager->DelClientCommand(COMMAND_LOGOUT, &g_BaseCommand);
	  pMessageManager->DelClientCommand(COMMAND_FILELIST, &g_BaseCommand);
	  pMessageManager->DelClientCommand(COMMAND_FILE_DOWNLOAD, &g_BaseCommand);
	  pMessageManager->DelClientCommand(COMMAND_FILE_UPLOAD, &g_BaseCommand);
      pMessageManager->DelClientCommand(CLIENT_LINK_CONNECT, &g_BaseCommand);
      pMessageManager->DelClientCommand(CLIENT_LINK_CDISCONNET, &g_BaseCommand);
      pMessageManager = NULL;
    }
  }

  g_BaseCommand.ClearUserList();
  OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] End.\n"));
  return 0;
}
int UnLoadModuleData()
{
    OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] Begin.\n"));
    if(g_pServerObject != NULL)
    {
        IMessageManager* pMessageManager = g_pServerObject->GetMessageManager();
        if(NULL != pMessageManager)
        {
            pMessageManager->DelClientCommand(COMMAND_ENTERROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_EXITROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_BEGINROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_ENDROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_SETCARDROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_OUTOLAYER, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_CHANGEROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_CLEARROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_INITROOM, &g_BaseCommand);
            pMessageManager->DelClientCommand(COMMAND_SETROOM, &g_BaseCommand);
            pMessageManager = NULL;
        }
    }
    OUR_DEBUG((LM_INFO, "[Base UnLoadModuleData] End.\n"));
    return 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_ENTERROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_EXITROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_BEGINROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_ENDROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_SETCARDROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_OUTOLAYER, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_CHANGEROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_CLEARROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_INITROOM, &g_BaseCommand, g_szName);
        pMessageManager->AddClientCommand(COMMAND_SETROOM, &g_BaseCommand, g_szName);
    }
    else
    {
        OUR_DEBUG((LM_INFO, "[Base LoadModuleData] pMessageManager = NULL.\n"));
    }

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

    //运行Command初始化
    g_BaseCommand.Init(pServerObject->GetTimerManager());

    return 0;
}
Beispiel #7
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;
}