Clan Channel Password

Results 1 to 13 of 13
  1. #1
    Enthusiast rexo2 is offline
    MemberRank
    Mar 2014 Join Date
    29Posts

    cool Clan Channel Password

    ZChat_Cmds.cpp


    Code:
    void clanchannelpassword(const char* line, const int argc, char **const argv);
    void clanchannelremovepassword(const char* line, const int argc, char **const argv);




    Code:
        _CC_AC("ccpw",    &clanchannelpassword,    CCF_ALL, ARGVNoMin, 1, true, "/ccpw <password>", "");
        _CC_AC("ccnpw",    &clanchannelremovepassword,    CCF_LOBBY, ARGVNoMin, 1, true, "/ccnpw <password>", "");








    void clanchannelpassword(const char* line,const int argc, char **const argv)
    {
    if(argc == 2)
    ZPostClanChannelPassword(argv[1], true);
    else
    ZChatOutput("Usage: /ccpw <password>");
    }


    void clanchannelremovepassword(const char* line,const int argc, char **const argv)
    {
    if(argc == 1)
    ZPostClanChannelPassword("", false);
    else
    ZChatOutput("Usage: /ccnpw");
    }

    ZGameInterface.cpp


    SetListenerWidget("SumbitPassword", ZGetSumbitPassword());




    ZGameClient_OnCommand.cpp


    Code:
            case MC_MATCH_SUMBITPW:
                {
                    char szPassword[32];
                    char szClanName[65];
    
    
                    pCommand->GetParameter(szPassword, 0, MPT_STR, sizeof(szPassword) );
                    CheckMsgAboutChat(szPassword);
                    memcpy(ZGetConfiguration()->GetEtc()->szPassword, szPassword, sizeof(szPassword) + 32);
    
    
                    pCommand->GetParameter(szClanName, 1, MPT_STR, sizeof(szClanName) );
                    memcpy(ZGetConfiguration()->GetEtc()->szClanName, szClanName, sizeof(szClanName) + 65);
    
    
                    MWidget* pFindWidget = ZGetGameInterface()->GetIDLResource()->FindWidget("ClanSumbitPassword");
                    if(pFindWidget != NULL)
                        pFindWidget->Show(true, true);
    
    
                    MEdit* pClanName = (MEdit*)ZGetGameInterface()->GetIDLResource()->FindWidget("ClanName");
                    if(pClanName != NULL)
                        pClanName->SetText(szClanName);
    
    
                    MEdit* pPassEdit = (MEdit*)ZGetGameInterface()->GetIDLResource()->FindWidget("ClanPassword");
                    if(pPassEdit != NULL)
                    {
                        pPassEdit->SetMaxLength(STAGEPASSWD_LENGTH);
                        pPassEdit->SetText("");        
                    }
    
    
                    ZGetConfiguration()->GetEtc()->bEnablePasswordCheck = true;
    
    
                }
                break;

    Zpost.h







    Code:
    inline void ZPostClanChannelPassword(char* szPassword, bool bVal)
    {
        ZPOSTCMD2(MC_MATCH_CCPW, MCmdParamStr(szPassword), MCommandParameterBool(bVal));
    }




    Under




    Code:
            C(MC_MATCH_NOTIFY, "Match.Notify", "Notify Message", MCDT_MACHINE2MACHINE)
                P(MPT_UINT, "nMsgID")

    Add
    Code:
            C(MC_MATCH_CCPW, "Match.Ccpw", "Clan Channel Password", MCDT_MACHINE2MACHINE)
                P(MPT_STR, "Password")
                P(MPT_BOOL, "Value")

    find :
    Code:
    inline void ZPostChannelRequestJoin

    add
    Code:
    inline void ZPostChannelRequestJoin(const MUID& uidChar, const MUID& uidChannel, bool bCorrectPW, char* szPW)
    {
        ZPOSTCMD4(MC_MATCH_CHANNEL_REQUEST_JOIN, MCommandParameterUID(uidChar), MCommandParameterUID(uidChannel), MCommandParameterBool(bCorrectPW), 
            MCommandParameterString(szPW));
    }

    find :
    Code:
    inline void ZPostChannelRequestJoinFromChannelName

    add :
    Code:
    inline void ZPostChannelRequestJoinFromChannelName(const MUID& uidChar, int nChannelType, const char* szChannelName, bool bCorrectPW, char* szPW)
    {
        if (strlen(szChannelName) >= CHANNELNAME_LEN) return;
        ZPOSTCMD5(MC_MATCH_CHANNEL_REQUEST_JOIN_FROM_NAME, MCmdParamUID(uidChar), MCmdParamInt(nChannelType), MCmdParamStr(szChannelName), 
            MCommandParameterBool(bCorrectPW), MCommandParameterString(szPW));
    }

    MSharedCommandTable.h
    add in end :


    Code:
    #define MC_MATCH_CCPW                            50010
    #define MC_MATCH_SUMBITPW                        50011
    #define MC_MATCH_REQUEST_ONLINEPLAYERS            50012
    #endif

    ZInterfaceListener.cpp
    add to line 488
    Code:
    BEGIN_IMPLEMENT_LISTENER(ZGetSumbitPassword, MBTN_CLK_MSG)
        
        bool bVal = ZGetConfiguration()->GetEtc()->bEnablePasswordCheck = true;
        if(bVal)
        {
            MEdit* pPassEdit = (MEdit*)ZGetGameInterface()->GetIDLResource()->FindWidget("ClanPassword");
            if(strcmp(ZGetConfiguration()->GetEtc()->szPassword, pPassEdit->GetText()))
            {
                ZGetGameInterface()->ShowMessage("Incorrect Password!");
            }
            else
            {
                char szPW[123];
                sprintf(szPW, "%s", pPassEdit->GetText());
                MWidget* pFindWidget = ZGetGameInterface()->GetIDLResource()->FindWidget("ClanSumbitPassword");
                    if(pFindWidget != NULL)
                        pFindWidget->Show(false, false);
    
    
                ZPostChannelRequestJoinFromChannelName(ZGetGameClient()->GetPlayerUID(), MCHANNEL_TYPE_CLAN, ZGetConfiguration()->GetEtc()->szClanName, true, szPW);
            }
            Sleep(100);
        }



    ZInterfaceListener.h
    add :
    Code:
    DECLARE_LISTENER(ZGetSumbitPassword);

    Full credit to : to me for mading it and share it. have fun :)



  2. #2
    Apprentice Alex0508106023 is offline
    MemberRank
    Apr 2013 Join Date
    14Posts

    Re: Clan Channel Password

    c:\Users\*****\Desktop\Source\Source_Code\Stable\CSCommon\Include\MSharedCommandTable.h(689): fatal error C1020: unexpected #endif
    c:\users\*****\desktop\source\source_code\stable\cscommon\include\MSharedCommandTable.h(690): fatal error C1070: mismatched #if /#endif pair in file 'c:\users\



    why?

  3. #3
    Enthusiast rexo2 is offline
    MemberRank
    Mar 2014 Join Date
    29Posts

    Re: Clan Channel Password

    Quote Originally Posted by Alex0508106023 View Post
    c:\Users\*****\Desktop\Source\Source_Code\Stable\CSCommon\Include\MSharedCommandTable.h(689): fatal error C1020: unexpected #endif
    c:\users\*****\desktop\source\source_code\stable\cscommon\include\MSharedCommandTable.h(690): fatal error C1070: mismatched #if /#endif pair in file 'c:\users\



    why?
    are you kidding me?.. even copy paste people cant do?..

  4. #4
    Member Sahar is offline
    MemberRank
    Apr 2015 Join Date
    Qiryat Yam, IsrLocation
    80Posts

    Re: Clan Channel Password

    rexo where to put



    SetListenerWidget("SumbitPassword", ZGetSumbitPassword());

    ?

  5. #5
    Member Vonicery is offline
    MemberRank
    Feb 2013 Join Date
    58Posts

    Re: Clan Channel Password

    Quote Originally Posted by Sahar View Post
    rexo where to put



    SetListenerWidget("SumbitPassword", ZGetSumbitPassword());

    ?
    966 line

  6. #6
    Member Sahar is offline
    MemberRank
    Apr 2015 Join Date
    Qiryat Yam, IsrLocation
    80Posts

    Re: Clan Channel Password

    help ?

    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(697): error C2039: 'szPassword' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(701): error C2039: 'szClanName' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZConfiguration.h(111) : see declaration of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(722): error C2039: 'bEnablePasswordCheck' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZConfiguration.h(111) : see declaration of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient.cpp(2233): error C2660: 'ZPostChannelRequestJoin' : function does not take 2 arguments
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient.cpp(2238): error C2660: 'ZPostChannelRequestJoinFromChannelName' : function does not take 3 arguments

  7. #7
    Member Vonicery is offline
    MemberRank
    Feb 2013 Join Date
    58Posts

    Re: Clan Channel Password

    Quote Originally Posted by Sahar View Post
    help ?

    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(697): error C2039: 'szPassword' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(701): error C2039: 'szClanName' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZConfiguration.h(111) : see declaration of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient_OnCommand.cpp(722): error C2039: 'bEnablePasswordCheck' : is not a member of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZConfiguration.h(111) : see declaration of 'ZCONFIG_ETC'
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient.cpp(2233): error C2660: 'ZPostChannelRequestJoin' : function does not take 2 arguments
    c:\Users\Sahar\Desktop\NationalSource\Source\Gunz\ZGameClient.cpp(2238): error C2660: 'ZPostChannelRequestJoinFromChannelName' : function does not take 3 arguments

    Sorry, but maybe you can read a error? I'll help you last time.

    ZConfiguration.h
    Line - 128
    char szPassword;
    char szClanName;
    bool bEnablePasswordCheck;
    Enjoy, this is will help fix some errors.

  8. #8
    Member maorgam300 is offline
    MemberRank
    Oct 2013 Join Date
    69Posts

    Re: Clan Channel Password

    to much bugs.. can u atleast post a fix of them?

  9. #9
    Member Vonicery is offline
    MemberRank
    Feb 2013 Join Date
    58Posts

    Re: Clan Channel Password

    Quote Originally Posted by maorgam300 View Post
    to much bugs.. can u atleast post a fix of them?
    This is source not finished, fix it yourself. If you can't do simple stuff, just leave from it and find a coder. Stop ask there stupid questions.

  10. #10
    Enthusiast rexo2 is offline
    MemberRank
    Mar 2014 Join Date
    29Posts

    Re: Clan Channel Password

    maybe i copied it with buggs.. beacuse for me its work fine.
    im to lazy to give you the fix of that, so do it by ur self and share it here.
    im not gonna fix it, so if you gonna do it - GOOD LUCK.

  11. #11
    Member zavi156 is offline
    MemberRank
    Dec 2012 Join Date
    62Posts

    Re: Clan Channel Password

    WTF
    i did it !!

  12. #12
    Novice PostMe is offline
    MemberRank
    May 2015 Join Date
    4Posts

    Re: Clan Channel Password

    so how to fix it zavi156 ?

  13. #13
    Apprentice Tr0jan is offline
    MemberRank
    Apr 2015 Join Date
    15Posts

    Re: Clan Channel Password

    Good work but this is useless. Everybody needs to have complete access to clan channels,to see who plays and what rank/score they're at.



Advertisement