Exemplo n.º 1
0
        // 初始化所有api函数
        void initApis()
        {
            caddBeforeActEvent  = Invoke <ADDACTEVENTFUNC>("addBeforeActListener");
            caddAfterActEvent   = Invoke <ADDACTEVENTFUNC>("addAfterActListener");
            cremoveBeforeAct    = Invoke <ADDACTEVENTFUNC>("removeBeforeActListener");
            cremoveAfterAct     = Invoke <ADDACTEVENTFUNC>("removeAfterActListener");
            csetshareptr        = Invoke <SETSHAREPTRFUNC>("setSharePtr");
            cgetSharePtr        = Invoke <GETSHAREPTRFUNC>("getSharePtr");
            cremoveSharePtr     = Invoke <GETSHAREPTRFUNC>("removeSharePtr");
            csetCommandDescribe = Invoke <SETCOMMANDDESCRIBEFUNC>("setCommandDescribeEx");
            cruncmd             = Invoke <RUNCMDFUNC>("runcmd");
            clogout             = Invoke <LOGOUTFUNC>("logout");
            cgetOnLinePlayers   = Invoke <GETONLINEPLAYERSFUNC>("getOnLinePlayers");
            cgetExtraAPI        = Invoke <GETEXTRAAPI>("getExtraAPI");
            cmcComponentAPI     = Invoke <MCCOMPONENTAPI>("mcComponentAPI");
            creNameByUuid       = Invoke <RENAMEBYUUIDFUNC>("reNameByUuid");
            ctalkAs             = Invoke <RENAMEBYUUIDFUNC>("talkAs");
            cruncmdAs           = Invoke <RENAMEBYUUIDFUNC>("runcmdAs");
            cdisconnectClient   = Invoke <RENAMEBYUUIDFUNC>("disconnectClient");
            csendSimpleForm     = Invoke <SENDSIMPLEFORMFUNC>("sendSimpleForm");
            csendModalForm      = Invoke <SENDMODALFORMFUNC>("sendModalForm");
            csendCustomForm     = Invoke <SENDCUSTOMFORMFUNC>("sendCustomForm");
            creleaseForm        = Invoke <RELEASEFORMFUNC>("releaseForm");
            cselectPlayer       = Invoke <GETPLAYERABILITIESFUNC>("selectPlayer");
            caddPlayerItem      = Invoke <ADDPLAYERITEMFUNC>("addPlayerItem");
            cgetscoreboardValue = Invoke <GETSCOREBOARDVALUEFUNC>("getscoreboardValue");
            ccshook             = Invoke <CSHOOKFUNC>("cshook");
            ccsunhook           = Invoke <CSUNHOOKFUNC>("csunhook");
            cdlsym           = Invoke <DLSYMFUNC>("dlsym");
            creadHardMemory  = Invoke <READHARDMEMORY>("readHardMemory");
            cwriteHardMemory = Invoke <READHARDMEMORY>("writeHardMemory");

            #region 非社区部分内容
            if (COMMERCIAL)
            {
                cgetStructure            = ConvertExtraFunc <GETSTRUCTUREFUNC>("getStructure");
                csetStructure            = ConvertExtraFunc <SETSTRUCTUREFUNC>("setStructure");
                cgetPlayerAbilities      = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerAbilities");
                csetPlayerAbilities      = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerAbilities");
                cgetPlayerAttributes     = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerAttributes");
                csetPlayerTempAttributes = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerTempAttributes");
                cgetPlayerMaxAttributes  = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerMaxAttributes");
                csetPlayerMaxAttributes  = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerMaxAttributes");
                cgetPlayerItems          = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerItems");
                csetPlayerItems          = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerItems");
                cgetPlayerSelectedItem   = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerSelectedItem");
                caddPlayerItemEx         = ConvertExtraFunc <RENAMEBYUUIDFUNC>("addPlayerItemEx");
                cgetPlayerEffects        = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerEffects");
                csetPlayerEffects        = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerEffects");
                csetPlayerBossBar        = ConvertExtraFunc <SETPLAYERBOSSBARFUNC>("setPlayerBossBar");
                cremovePlayerBossBar     = ConvertExtraFunc <RUNCMDFUNC>("removePlayerBossBar");
                ctransferserver          = ConvertExtraFunc <TRANSFERSERVERFUNC>("transferserver");
                cteleport                       = ConvertExtraFunc <TELEPORTFUNC>("teleport");
                csetPlayerSidebar               = ConvertExtraFunc <SETPLAYERSIDEBARFUNC>("setPlayerSidebar");
                cremovePlayerSidebar            = ConvertExtraFunc <RUNCMDFUNC>("removePlayerSidebar");
                cgetPlayerPermissionAndGametype = ConvertExtraFunc <GETPLAYERABILITIESFUNC>("getPlayerPermissionAndGametype");
                csetPlayerPermissionAndGametype = ConvertExtraFunc <RENAMEBYUUIDFUNC>("setPlayerPermissionAndGametype");
            }
            #endregion
        }
Exemplo n.º 2
0
 // 初始化所有api函数
 void initApis()
 {
     ccshook          = Invoke <CSHOOKFUNC>("cshook");
     ccsunhook        = Invoke <CSUNHOOKFUNC>("csunhook");
     cdlsym           = Invoke <DLSYMFUNC>("dlsym");
     creadHardMemory  = Invoke <READHARDMEMORY>("readHardMemory");
     cwriteHardMemory = Invoke <READHARDMEMORY>("writeHardMemory");
 }