调整腾讯网吧特权组件位置
This commit is contained in:
@@ -4,6 +4,10 @@ project(dnf-utils)
|
|||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
|
||||||
|
set(TENCENT_NETBAR_SDK ${CMAKE_CURRENT_SOURCE_DIR}/tencent_netbar)
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(bsdiff)
|
add_subdirectory(bsdiff)
|
||||||
add_subdirectory(bzip2)
|
add_subdirectory(bzip2)
|
||||||
add_subdirectory(libnpk)
|
add_subdirectory(libnpk)
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ PRIVATE
|
|||||||
${WTL_DIR}/include
|
${WTL_DIR}/include
|
||||||
${CYCLONE_DIR}/include
|
${CYCLONE_DIR}/include
|
||||||
${GAME_PROTO_DIR}
|
${GAME_PROTO_DIR}
|
||||||
|
${TENCENT_NETBAR_SDK}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_directories(aClient
|
target_link_directories(aClient
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "NetbarInterface.h"
|
#include "NetbarInterface.h"
|
||||||
#include "iigw_api_client.h"
|
|
||||||
#include "GameProto.h"
|
#include "GameProto.h"
|
||||||
#include "GameProto.pb.h"
|
#include "GameProto.pb.h"
|
||||||
#include "GameClient.h"
|
#include "GameClient.h"
|
||||||
|
|
||||||
|
#include <iigw_api_client.h>
|
||||||
|
|
||||||
TencentNetbarInterface::TencentNetbarInterface()
|
TencentNetbarInterface::TencentNetbarInterface()
|
||||||
{
|
{
|
||||||
m_requestStatus.store(RS_NotRequest);
|
m_requestStatus.store(RS_NotRequest);
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
# 腾讯网吧特权组件
|
||||||
|
|
||||||
|
前端对接:https://iwiki.woa.com/p/4008054268
|
||||||
|
后端对接(腾讯内网): https://iwiki.woa.com/p/1440190556
|
||||||
|
后端对接: https://iwiki.woa.com/p/4008196267
|
||||||
|
|
||||||
|
# 示例代码
|
||||||
|
```cpp
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "iigw_api_client.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
HMODULE hModule = ::LoadLibraryW(L"iigw_client_api.dll");
|
||||||
|
if (hModule) {
|
||||||
|
char* open_id = "979591";// "4724195171999796436";
|
||||||
|
unsigned int game_id = 1;// 16300;
|
||||||
|
iepm_qqwb::IQQNetbarIIGWPlugin *plugin =
|
||||||
|
iepm_qqwb::CreateQQNetbarIIGWPlugin(hModule);
|
||||||
|
if (plugin) {
|
||||||
|
unsigned int zone_id = 0;
|
||||||
|
char* tick_buff = nullptr;// "27A50B44430AAD6BFFBE09BA875E48BB";
|
||||||
|
int tick_buflen = 0;// sizeof(tick_buff);
|
||||||
|
iepm_qqwb::NetbarLv netbarlv = {0};
|
||||||
|
|
||||||
|
int ret = plugin->ReqNetbarLv2(
|
||||||
|
20, // game_id=1(DNF的game_id)
|
||||||
|
101, // zone_id=0(目前不重要的参数,暂时设置为0)
|
||||||
|
"979591", // open_id (DNF目前还是使用的QQ号登录,这里传入用户的QQ号)
|
||||||
|
iepm_qqwb::at_qq, // type (open_id的类型,这里使用qq号类型)
|
||||||
|
nullptr, // ticketBuff, 传入空
|
||||||
|
0, // ticketLen, 传入0
|
||||||
|
&netbarlv, // netbarlv, 输出参数
|
||||||
|
3000
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (ret == 0 && netbarlv.tokenLen > 0) {
|
||||||
|
// do something
|
||||||
|
printf("ret=%d, tokenLen=%d\n", ret, netbarlv.tokenLen);
|
||||||
|
printf("ip=%s\n", netbarlv.ip);
|
||||||
|
printf("token=%s\n", netbarlv.tokenBuff);
|
||||||
|
printf("macSize=%d, macs='%s'\n", netbarlv.macSize, netbarlv.macs);
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = plugin->IsNetbarMachine(1, "979591", iepm_qqwb::at_qq);
|
||||||
|
if(ret==IIGW_MSG_STATUS_NOT_IN_NETBAR)
|
||||||
|
printf("IsNetbarMachine ret='IIGW_MSG_STATUS_NOT_IN_NETBAR'\n");
|
||||||
|
else if (ret == IIGW_MSG_STATUS_NETBAR_PC)
|
||||||
|
printf("IsNetbarMachine ret='IIGW_MSG_STATUS_NETBAR_PC'\n");
|
||||||
|
else
|
||||||
|
printf("IsNetbarMachine ret=%d\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
::FreeLibrary(hModule);
|
||||||
|
} else {
|
||||||
|
DWORD err = ::GetLastError();
|
||||||
|
printf("LoadLibraryW fail, err=%d\n", err);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
Binary file not shown.
Reference in New Issue
Block a user