• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Command ban player

Newbie Spellweaver
Joined
Sep 5, 2011
Messages
46
Reaction score
2
hello, I did everything and what the tutorial says etropulus but an error showed up:

Error:
MMatchServer_Stage.cpp(2770): error C2601: 'MMatchServer::Ban' : local function definitions are illegal

Code:
void MMatchServer::Ban(const MUID& uidAdmin, const char* pszTargetName)
 
Joined
Apr 18, 2010
Messages
674
Reaction score
393
I'm going to just go ahead and say it. Google the error code, the very first link is MSDN which will include examples of what caused the error, and sometimes how to resolve it.

Local in the scope means inside a body of a function, therefore you are attempting to declare a function inside a function.
In short, you missed a } or two.
 
Upvote 0
Newbie Spellweaver
Joined
Sep 5, 2011
Messages
46
Reaction score
2
I'm going to just go ahead and say it. Google the error code, the very first link is MSDN which will include examples of what caused the error, and sometimes how to resolve it.

Local in the scope means inside a body of a function, therefore you are attempting to declare a function inside a function.
In short, you missed a } or two.

please help me, do not know much about it sorry

Code:
void MMatchServer::Ban(const MUID& uidAdmin, const char* pszTargetName)
{
    MMatchObject* pObj = GetObject(uidAdmin);
    if( 0 == pObj )
        return;

    if (!IsEnabledObject(pObj)) return;

    MMatchStage* pStage = FindStage(pObj->GetStageUID());
    if (pStage == NULL) return;

    // °ü¸®ÀÚ ±ÇÇÑÀ» °¡Áø »ç¶÷ÀÌ ¾Æ´Ï¸é ¿¬°áÀ» ²÷´Â´Ù.
    if (!IsAdminGrade(pObj))
    {
        return;
    }
    
    MMatchObject* pTargetObj = GetPlayerByName(pszTargetName);
    if (pTargetObj == NULL) return;            // ¾îµå¹Î ´ë»óÀ¸·Î ¯ºÒ°¡

    pTargetObj->GetAccountInfo()->m_nUGrade = MMUG_BLOCKED;

    if (m_MatchDBMgr.Ban(pTargetObj->GetAccountInfo()->m_nAID, true)) {
        MMatchObjectCacheBuilder CacheBuilder;
        CacheBuilder.AddObject(pTargetObj);
        MCommand* pCmdCacheUpdate = CacheBuilder.GetResultCmd(MATCHCACHEMODE_REPLACE, this);
        RouteToStage(pStage->GetUID(), pCmdCacheUpdate);

        MCommand* pCmdUIUpdate = CreateCommand(MC_BAN, MUID(0,0));
        pCmdUIUpdate->AddParameter(new MCommandParameterUID(pTargetObj->GetUID()));
        pCmdUIUpdate->AddParameter(new MCommandParameterBool(false));
        RouteToStage(pStage->GetUID(), pCmdUIUpdate);
    }
}
 
Upvote 0
Back
Top