Skip to content

Commit

Permalink
Merge pull request #74 from libxengine/develop
Browse files Browse the repository at this point in the history
V3.14.0.1001 Merge
  • Loading branch information
xengine-qyt authored Sep 20, 2024
2 parents f0b3b3e + 4a14600 commit a4a4a17
Show file tree
Hide file tree
Showing 62 changed files with 746 additions and 318 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/linuxbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ubuntu build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
#- os: ubuntu-24.04
runs-on: ${{ matrix.os }}

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make
run: |
cd XEngine_Source
make
make FLAGS=InstallAll
make FLAGS=CleanAll
make RELEASE=1
make FLAGS=InstallAll
make FLAGS=CleanAll
cd ..
- name: test
run: |
cd XEngine_Release
./XEngine_AuthorizeService -t
64 changes: 64 additions & 0 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: macos build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
matrix:
include:
- os: macos-13
runs-on: ${{ matrix.os }}

steps:
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
- name: brew install
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make debug
run: |
cd XEngine_Source
make PLATFORM=mac
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: make release
run: |
cd XEngine_Source
make PLATFORM=mac RELEASE=1
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: test
run: |
cd XEngine_Release
./XEngine_AuthorizeService -t
77 changes: 77 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: windows build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
configuration: [Debug ,Release]
platform: [x86 ,x64]

runs-on: windows-latest # 最新的 Windows 环境

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: xengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
shell: pwsh

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh

# 配置 MSBuild 的路径,准备构建 VC++ 项目
- name: Setup MSBuild
uses: microsoft/[email protected]
#编译
- name: Build Solution
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
#测试
- name: Conditional Step for x86 Release
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Release/*.dll XEngine_Release/
cp -r XEngine_Source/Release/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_AuthorizeService.exe -t
shell: pwsh
- name: Conditional Step for x86 Debug
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_AuthorizeService.exe -t
shell: pwsh
38 changes: 38 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
XEngine_Authorize V3.14.0.1001

增加:支持无限制多端登录了
增加:工作流CI支持
增加:当tcp或者websocket登录的时候会返回token了
增加:普通用户token开关支持
修改:websocket支持解析token字段了
修改:现在http post方法不在需要验证用户,使用token替代
修改:可以通过token获取用户过期时间
修改:公告和动态码合并到token任务中
修改:注册管理界面默认设置5次次数验证了
修改:多端登录序列类型进行了验证
修正:删除用户需要验证用户了
修正:某些时候崩溃
修正:公告信息可以为NULL的情况
修正:快速验证不允许硬件码为NULL了
修正:子模块状态错误
修正:在MACOS构建运行失败的问题
删除:XEngine_AuthorizeHTTP_Announcement列举处理方法函数

added:unlimited login type with multi supported now
added:workflow
added:reply token handle when tcp and websocket login
added:token auth for normal user of switch
modify:web socket support parse token field
modify:The post method processing flow now only requires token instead of verifying user and password
modify:get user left time by token
modify:merge notice and dynamic code and token task
modify:set time 5 default value with cdkey init and choice time add serial for management app
modify:multi login serial type is verification now
fixed:verification user information for delete user
fixed:some crashed
fixed:the problem that notice can be set null
fixed:does not allow code is null when fast verification
fixed:sub module status is incorrect
fixed:build error on mac
delete:XEngine_AuthorizeHTTP_Announcement list process from get method
================================================================
XEngine_Authorize V3.13.0.1001

增加:管理程序支持CDKEY创建,打开,授权,初始化
Expand Down
6 changes: 3 additions & 3 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ feature list:

#### XEngine Evn
you must install XEngine,need V8.15 or above,install XEngine can be refer to xengine Readme docment
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
GITEE:https://gitee.com/libxengine/libxengine
GITHUB:https://github.com/libxengine/libxengine

##### fast to deployment
git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git
git clone https://gitee.com/libxengine/libxengine.git or git clone https://github.com/libxengine/libxengine.git
window Exection XEngine_WINEnv.bat
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
Macos Exection:./XEngine_LINEnv.sh -i 3
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ XEngine_Authorize

#### XEngine环境
必须安装XEngine,版本需要V8.15或者以上版本,安装XEngine可以参考其Readme文档
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
GITEE:https://gitee.com/libxengine/libxengine
GITHUB:https://github.com/libxengine/libxengine

###### 快速部署
git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git
git clone https://gitee.com/libxengine/libxengine.git 或者 git clone https://github.com/libxengine/libxengine.git
window执行XEngine_WINEnv.bat 脚本.
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
macos执行:./XEngine_LINEnv.sh -i 3
Expand All @@ -72,7 +72,7 @@ macos执行:./XEngine_LINEnv.sh -i 3
由于依赖的子模块,在你checkout仓库后,在仓库目录下执行下面的命令拉取子模块
git submodule init
git submodule update
如果github访问失败,也可以在XEngine_Source\XEngine_Depend 下直接clone项目:git clone https://gitee.com/xengine/XEngine_OPenSource.git
如果github访问失败,你也可以clone该项目,在主目录下使用命令:git clone https://gitee.com/xengine/XEngine_OPenSource.git XEngine_Source/XEngine_Depend

#### Windows
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
Expand Down
21 changes: 12 additions & 9 deletions XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ XHTHREAD AuthClient_Thread()
if (0 == st_ProtocolHdr.wReserve)
{
printf(_X("登录成功\n"));
xhToken = st_ProtocolHdr.xhToken;
}
else
{
Expand Down Expand Up @@ -182,7 +183,7 @@ int AuthClient_Pay()
}
int AuthClient_DynamicCode()
{
LPCXSTR lpszUrl = _X("http://127.0.0.1:5302/api?function=dcode&user=get");
LPCXSTR lpszUrl = _X("http://127.0.0.1:5302/api?function=dcode");

int nMsgLen = 0;
XCHAR* ptszMsgBuffer = NULL;
Expand Down Expand Up @@ -284,7 +285,8 @@ int AuthClient_Login()
}
int AuthClient_Notice()
{
LPCXSTR lpszUrl = _X("http://127.0.0.1:5302/api?function=notice");
XCHAR tszURLStr[MAX_PATH] = {};
_xstprintf(tszURLStr, _T("http://127.0.0.1:5302/api?function=notice&token=%lld"), xhToken);

int nMsgLen = 0;
XCHAR* ptszMsgBuffer = NULL;
Expand All @@ -294,7 +296,7 @@ int AuthClient_Notice()
Json::CharReaderBuilder st_ReaderBuilder;
std::unique_ptr<Json::CharReader> const pSt_JsonReader(st_ReaderBuilder.newCharReader());

APIClient_Http_Request(_X("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nMsgLen);
APIClient_Http_Request(_X("GET"), tszURLStr, NULL, NULL, &ptszMsgBuffer, &nMsgLen);
if (bEncrypto)
{
XCHAR tszDEBuffer[2048] = {};
Expand Down Expand Up @@ -373,7 +375,8 @@ int AuthClient_GetTime()
{
Json::Value st_JsonRoot;
Json::Value st_JsonObject;
LPCXSTR lpszUrl = _X("http://127.0.0.1:5302/auth/user/time");
XCHAR tszURLStr[MAX_PATH] = {};
_xstprintf(tszURLStr, _T("http://127.0.0.1:5302/api?function=time&token=%lld"),xhToken);

st_JsonObject["tszUserName"] = lpszUser;
st_JsonObject["tszUserPass"] = lpszPass;
Expand All @@ -389,15 +392,15 @@ int AuthClient_GetTime()

nMsgLen = st_JsonRoot.toStyledString().length();
OPenSsl_XCrypto_Encoder(st_JsonRoot.toStyledString().c_str(), &nMsgLen, (XBYTE*)tszENBuffer, lpszPass);
APIClient_Http_Request(_X("POST"), lpszUrl, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen);
APIClient_Http_Request(_X("GET"), tszURLStr, tszENBuffer, NULL, &ptszMsgBuffer, &nMsgLen);

OPenSsl_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszDEBuffer, lpszPass);
printf("AuthClient_GetTime:\n%s\n", tszDEBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
}
else
{
APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen);
APIClient_Http_Request(_X("GET"), tszURLStr, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBuffer, &nMsgLen);
printf("AuthClient_GetTime:\n%s\n", ptszMsgBuffer);
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
}
Expand Down Expand Up @@ -449,8 +452,8 @@ int AuthClient_Try()
LPCXSTR lpszSerialNet = _X("cpuid:112233"); //通过此可以做临时网络验证,安全性比本地临时验证高
LPCXSTR lpszUrl = _X("http://127.0.0.1:5302/auth/user/try");

st_JsonObject["tszSerial"] = lpszSerialNet;
st_JsonRoot["st_UserTry"] = st_JsonObject;
st_JsonObject["tszVSerial"] = lpszSerialNet;
st_JsonRoot["st_VERTemp"] = st_JsonObject;

int nMsgLen = 0;
XCHAR* ptszMsgBuffer = NULL;
Expand Down Expand Up @@ -502,7 +505,7 @@ int main()
AuthClient_GetPass();
AuthClient_GetTime();

std::this_thread::sleep_for(std::chrono::seconds(600));
std::this_thread::sleep_for(std::chrono::seconds(10));
AuthClient_Delete();
AuthClient_Try();

Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
3 changes: 2 additions & 1 deletion XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"bSwitchDCode":false,
"bSwitchMulti":true,
"bSwitchTry":true,
"bSwitchBanned":true
"bSwitchBanned":true,
"bSwitchTokenLogin":true
}
1 change: 1 addition & 0 deletions XEngine_Release/XEngine_Config/XEngine_VersionConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"XVer":[
"V3.14.0.1001 Build20240920",
"V3.13.0.1001 Build20240715",
"V3.12.1.1001 Build20240621",
"V3.12.0.1001 Build20240513",
Expand Down
Loading

0 comments on commit a4a4a17

Please sign in to comment.