Field | Type/Length | Description |
cVer | unsigned char(1) | Version number. Enter 1 . |
wOpenIDLen | unsigned short(2) | User account length |
strOpenID | string | User account's characters |
dwSdkAppid | unsigned short(4) | SDKappid of the developer |
dwReserved1 | unsigned int(4) | Enter 0 . |
dwExpTime | unsigned int(4) | Expiration time (current time + validity period) in seconds. 300 is recommended. |
dwReserved2 | unsigned int(4) | Enter -1 or 0xFFFFFFFF . |
dwReserved3 | unsigned int(4) | Enter 0 . |
wRoomIDLen | unsigned short(2) | Length of the ID of the room to enter. Enter 0 for the voice messaging service. |
strRoomID | string | Characters of the ID of the room to enter |
Scheme | Pros | Cons |
Backend deployment | High security | Backend development and joint testing required |
Client deployment | Quick integration | Low security |
authBuffer
field in the parameters for room entering.APPID
.symmetry_encrypt
function is the permission encryption string.unsigned char pInBuf[512]={0};xel::byte_writer bw(pInBuf, sizeof(pInBuf));char cVer = 1;unsigned short wOpenIDLen = (unsigned short)strlen((const char *)strOpenID);if (wOpenIDLen > 127) wOpenIDLen = 127;unsigned short wRoomIDLen = (unsigned short)strlen((const char *)strRoomID);if (wRoomIDLen > 127) wRoomIDLen = 127;bw.write_byte(cVer);bw.write_int16(wOpenIDLen);bw.write_bytes(strOpenID, wOpenIDLen);bw.write_int32(dwSdkAppId);bw.write_int32(0 /*dwRoomID*/);bw.write_int32(expTime);bw.write_int32(nAuthBits);bw.write_int32(0 /*dwAccountType*/);bw.write_int16(wRoomIDLen);bw.write_bytes(strRoomID, wRoomIDLen);int pInLen = bw.bytes_write();unsigned char pEncryptOutBuf[512] = { 0 };int iEncrptyLen = 0;symmetry_encrypt((const unsigned char*)pInBuf, pInLen, (const unsigned char*)key, (unsigned char*)pEncryptOutBuf, &iEncrptyLen);
この記事はお役に立ちましたか?