Missing / Wrong configs

Results 1 to 11 of 11
  1. #1
    Account Upgraded | Title Enabled! magraopb is online now
    MemberRank
    May 2007 Join Date
    BrazilLocation
    742Posts

    config Missing / Wrong configs

    Hi all

    i'm looking missing/wrong configs in *.inis

    GlobalMgrSvr.ini have that:
    Code:
    Launagues=38653
    GlobalMgrSvr.log have that
    Code:
    Default Languages[1]: 0

    The correctly is Languages ant not Launagues BUT....

    with - Launagues -> Work fine all channels, no errors) and logs show
    Code:
    Default Languages[1]: 0

    with - Languages -> ERROR-> i can't see channels(not bad editions, if return configuration Launagues works fine) and logs show
    Code:
    Default Languages[1]: 38653
    anyone try these


  2. #2
    RaGEZONER toast2250 is offline
    MemberRank
    Sep 2009 Join Date
    CabalLocation
    638Posts

    Re: Missing / Wrong configs

    Use the default Languages=0, Launagues=38653 must be a typo and is invalid if it gets ignored and defaulted to 0.

    What are the language options and what they exactly do I don't know.

  3. #3
    Account Upgraded | Title Enabled! magraopb is online now
    MemberRank
    May 2007 Join Date
    BrazilLocation
    742Posts

    Re: Missing / Wrong configs

    yes toast, i think too, thanks

  4. #4
    Proficient Member y0cata is offline
    MemberRank
    Jul 2008 Join Date
    190Posts

    Re: Missing / Wrong configs

    Languages=0 is support for all langs :) another numbers is for support only 1 lang just remove any type of configs about langs :)

  5. #5
    Account Upgraded | Title Enabled! magraopb is online now
    MemberRank
    May 2007 Join Date
    BrazilLocation
    742Posts

    Re: Missing / Wrong configs

    yes, now is "Languages=0" in my files :)

  6. #6
    Proficient Member y0cata is offline
    MemberRank
    Jul 2008 Join Date
    190Posts

    Re: Missing / Wrong configs

    u can remove it :) if the config is missing the server will auto set the current settings to 0 just like servertype if the config is not there when startup the server servertype will be 0

  7. #7
    Account Upgraded | Title Enabled! AMD79 is offline
    MemberRank
    Mar 2006 Join Date
    Sabah, MalaysiaLocation
    290Posts

    Re: Missing / Wrong configs

    Care to explain? How do you acctually remove it?

  8. #8
    Proficient Member y0cata is offline
    MemberRank
    Jul 2008 Join Date
    190Posts

    Re: Missing / Wrong configs

    select text pres delete save file :D lol

  9. #9
    Account Upgraded | Title Enabled! AMD79 is offline
    MemberRank
    Mar 2006 Join Date
    Sabah, MalaysiaLocation
    290Posts

    Re: Missing / Wrong configs

    You mean just remove the whole line example :

    Launagues=38653

    Remove that line? Just like that?

  10. #10
    Account Upgraded | Title Enabled! magraopb is online now
    MemberRank
    May 2007 Join Date
    BrazilLocation
    742Posts

    Re: Missing / Wrong configs

    That way dude!
    Quote Originally Posted by magraopb View Post
    yes, now is "Languages=0" in my files :)

  11. #11
    Proficient Member y0cata is offline
    MemberRank
    Jul 2008 Join Date
    190Posts

    Re: Missing / Wrong configs

    Quote Originally Posted by AMD79 View Post
    You mean just remove the whole line example :

    Launagues=38653

    Remove that line? Just like that?
    yes ^^

    if u want to learn how GlobalMgrSvr load configs and if the config is not in ini what GlobalMgrSvr will do check GlobalMgrSvr ep3 source

    Code:
    #include <numeric>
    #include "../NetLib/NetKernel.h"
    #include "../NetLib/Utility.h"
    #include "../NetLib/SystemLog.h"
    #include "../NetLib/ProcessLayer.h"
    #include "../NetLib/IOLayer.h"
    #include "Proc/GKHandler.h"
    #include "Proc/ProcSystem.h"
    #include "../../../Tool/Src/MachineLicense/LicenseHelper/LicenseHelper.h"
    #include "ContextEx.h"
    #include <ace/SV_Semaphore_Complex.h>
    
    #include "ProtodefEx.h"
    #include "ExceptionDumpEx.h"
    
    static void SetLogText()
    {
    #define DefText( x ) //GlobalSystemLog::instance()->SetLogText(x, #x);
    	DefText(LC_GMS_RESPONSE_CONNECT2SVR)
    	DefText(LC_GMS_RESPONSE_CONNECT2SVR_FAIL)
    	DefText(LC_GMS_CLOSE_PROCESS)
    	DefText(LC_GMS_IPC_SYSTEM_MESSAGE)
    	DefText(LC_GMS_ITC_SYSTEM_MESSAGE)
    #undef DefText
    }
    
    void ReloadServerAndChannelTypeCfg()
    {
        g_pServerCtxEx->loadServerAndChannelType = 
            CONFIG_INT(SERVER_NAME, "LoadServerAndChannelType", 0) == 0 ? false: true;
        LOG_TRACE(1, ("LoadServerAndChannelType(%d)", g_pServerCtxEx->loadServerAndChannelType));
    
        if(g_pServerCtxEx->loadServerAndChannelType)
        {       
    	    for(BYTE sIdx = 1; sIdx <= MAX_SERVERNUM; ++sIdx)
    	    {
                static char serverSectionName[256] = {0};
                if(g_pServerCtxEx->loadServerAndChannelType)
                {
                    //ServerType Setting            
                    sprintf(serverSectionName, "Server%.2d", sIdx);
                    if(CONFIG_KEYEXISTS(serverSectionName, "ServerType"))
                    {
                        g_pServerCtxEx->serverType[sIdx] = 
                            static_cast<BYTE>(CONFIG_INT(serverSectionName, "ServerType", SERVER_TYPE::NONE));
                        LOG_TRACE(1, ("serverType[%d]: %d", sIdx, g_pServerCtxEx->serverType[sIdx]));
                    }
                    else if(CONFIG_KEYEXISTS("DefaultServerCfg", "ServerType"))
                    {
                        g_pServerCtxEx->serverType[sIdx] = 
                            static_cast<BYTE>(CONFIG_INT("DefaultServerCfg", "ServerType", SERVER_TYPE::NONE));
                    }                
                }
    
                //ChannelType Setting        
    		    for(BYTE gIdx = 1; gIdx <= MAX_GROUPNUM; ++gIdx)
    		    {
    			    SERVERSTATE& serverState = g_pServerCtxEx->serverNodes[sIdx][gIdx];
                    if(g_pServerCtxEx->loadServerAndChannelType)
                    {
                        static char channelTypeName[256] = {0};
                        sprintf(channelTypeName, "ChannelType%.2d", gIdx);
                        if(CONFIG_KEYEXISTS(serverSectionName, channelTypeName))
                        {
                            serverState.channelData = 
                                static_cast<TChannelData>(CONFIG_INT(serverSectionName, 
                                channelTypeName, CHANNEL_TYPE::NONE));
                            LOG_TRACE(1, ("channelType[%d][%d]: %d", sIdx, gIdx, serverState.channelData));                        
                        }
                        else if(CONFIG_KEYEXISTS("DefaultServerCfg", channelTypeName))
                        {
                            serverState.channelData = 
                                static_cast<TChannelData>(CONFIG_INT("DefaultServerCfg", 
                                channelTypeName, CHANNEL_TYPE::NONE));
                        }
    
                        static char maxUserNumName[256] = {0};
                        sprintf(maxUserNumName, "MaxUserNum%.2d", gIdx);
                        if(CONFIG_KEYEXISTS(serverSectionName, maxUserNumName))
                        {
                            serverState.maxUserNum =
                                static_cast<WORD>(CONFIG_INT(serverSectionName, 
                                maxUserNumName, 100));
                            LOG_TRACE(1, ("maxUserName[%d][%d]: %d", sIdx, gIdx, serverState.maxUserNum));
                        }
                        else if(CONFIG_KEYEXISTS("DefaultServerCfg", maxUserNumName))
                        {
                            serverState.maxUserNum = 
                                static_cast<WORD>(CONFIG_INT("DefaultServerCfg", 
                                maxUserNumName, 100));
                        }
    
                        static char serverOpenName[256] = {0};
                        sprintf(serverOpenName, "ServerOpen%.2d", gIdx);
                        if(CONFIG_KEYEXISTS(serverSectionName, serverOpenName))
                        {
                            serverState.isClosed = 
                                (CONFIG_INT(serverSectionName, serverOpenName, 0) == 0) ? true: false;
                            LOG_TRACE(1, ("ServerOpen[%d][%d]: %d", sIdx, gIdx, (serverState.isClosed == false)));
                        }
                        else if(CONFIG_KEYEXISTS("DefaultServerCfg", serverOpenName))
                        {
                            serverState.isClosed = 
                                (CONFIG_INT("DefaultServerCfg", serverOpenName, 0) == 0) ? true: false;
                        }                    
                    }
                }
            }
        }
    }
    
    static void ReloadCfg(void*)
    {	
        ReloadServerAndChannelTypeCfg();
    
    	int serverCount(0);
    	int allUserCount(0);
           
    	for(BYTE sIdx = 0; sIdx <= MAX_SERVERNUM; ++sIdx)
    	{        
    		for(BYTE gIdx = 0; gIdx <= MAX_GROUPNUM; ++gIdx)
    		{
    			SERVERSTATE& serverState = g_pServerCtxEx->serverNodes[sIdx][gIdx];
                //PrintServerData
    			USERCONTEXT* pUserCtx = serverState.pUserCtx;
    			if(pUserCtx) 
                {
    				USERDATACONTEXT* pUserDataCtx((USERDATACONTEXT*)pUserCtx->pData);                
    				ACE_INET_Addr addr(pUserDataCtx->wPort, ACE_NTOHL(pUserDataCtx->dwIP));
    				WORD userNum = std::accumulate(pUserDataCtx->iUserCount, 
                        pUserDataCtx->iUserCount+MAX_WORLDNUM, (WORD)0);
    
    				LOG_TRACE(1, ("%.2d:%.2d (%s:%d) => %d/%d %s", 
    							pUserDataCtx->bServerIdx, pUserDataCtx->bGroupIdx,
    							addr.get_host_addr(), addr.get_port_number(),
    							userNum, serverState.maxUserNum,
    							serverState.isClosed ? "(closed)":""));
    
    				serverCount++;
    				allUserCount += userNum;
    			}
    		}
    	}
    	LOG_TRACE(1, ("%d servers, %d users", serverCount, allUserCount));
    
    	//user 
    	LOG_TRACE(1, ("%d clients", g_pServerCtxEx->userNodes.size()));
    
    	//reload data
    	g_pServerCtxEx->serverNodes[0][0].maxUserNum
    		= static_cast<WORD>(CONFIG_INT(SERVER_NAME, "WorldMaxUserNum", 250));
    	g_pServerCtxEx->noNotifyTimeLimit 
    		= static_cast<WORD>(CONFIG_INT(SERVER_NAME, "NoNotifyTimeLimit", 60000));
    #ifndef _WIN32
        g_pServerCtxEx->licenseVerified = 
            LH_VerifyLicense(LH_GetCurrentMachineID(), "/etc/cabal/");
        LOG_TRACE(1, ("%d%d userNode", g_pServerCtxEx->userNodes.size(), 
            g_pServerCtxEx->licenseVerified));
    #endif
    }
    
    void RunServer(CNetKernel& sNetKernel)
    {
    	CProcessLayer	sProcessLayer;
    	CIOLayer		sIOLayer(&sProcessLayer);
    	CProcSystem		sProcSystem(&sProcessLayer, &sIOLayer);
    
    	if(	!sProcessLayer.Active() ||
    		!sProcSystem.Active() ||
    		!sIOLayer.Active())
    	{
    		LOG_ERROR(("active fail"));
    		ACE_Reactor::end_event_loop();
    	}
    
    	sNetKernel.Wait();
    }
    
    int main(int argc, char** argv)
    {
    #ifndef _WIN32
        extern ACE_SV_Semaphore_Complex g_mtxProcess;
        char mutex_name[64];
        sprintf(mutex_name, "%s_%d", "ipc_mutex_", NATION_NAME);
        g_mtxProcess.open(mutex_name);
        if (g_mtxProcess.tryacquire() < 0) return -1;
    #endif
        
        INIT_MD5SUM_BINARY()
    
    #if !defined(_WIN32) && !defined(TESTING)
    	g_pServerCtxEx->licenseVerified = 
            LH_VerifyLicense(LH_GetCurrentMachineID(), "/etc/cabal/");
    #else
        g_pServerCtxEx->licenseVerified = true;
    #endif /*_WIN32*/
    
    	CNetKernel sNetKernel;
    	if(!sNetKernel.Initialize(argc, argv)) {
    		return 2;
    	}
    
    	sNetKernel.SetSigHup(ReloadCfg);
    
    	// BootTimeInfo
    	g_pServerCtxEx->bootTick = ACE_OS::gettimeofday().msec();
    
    	SetLogText();    
    	
    	bool isClosed = (CONFIG_INT(SERVER_NAME, "DefaultServerOpen", 0) == 0 ? true : false);
    	for(int i=0; i<=MAX_SERVERNUM; ++i) {
    		for(int j=0; j<=MAX_GROUPNUM; ++j) {
    			g_pServerCtxEx->serverNodes[i][j].isClosed = isClosed;
    		}
    	}
    
        ReloadServerAndChannelTypeCfg();
    
    	RunServer(sNetKernel);
    
    	//cleanup
    	ServerContextSingleton::close();
    #ifdef MEDIAWEB_PCBANG
    	PCBANG::close();
    #endif
    
    	return 0;
    }

    we can learn a lot of stuff from ep3 source :)



Advertisement