From 195a8c4b7083aa686b854072536791156e70982d Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 6 Nov 2024 14:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clean.bat | 9 ++++++++- close.bat | 6 +++++- data/DB_GiftCard.dat | Bin 57 -> 57 bytes data/DB_PropExchange.dat | Bin 384 -> 384 bytes data/DB_Task.dat | Bin 5519 -> 5519 bytes gen_data.bat | 20 +++++++++++++++++++- gen_go.bat | 13 ++++++++++++- protocol/server/server.proto | 2 +- protocol/webapi/webapi.proto | 2 +- shell/clean.bat | 10 ---------- shell/close.bat | 7 ------- shell/gen_data.bat | 15 --------------- shell/gen_go.bat | 16 ---------------- shell/start.bat | 17 ----------------- shell/update_deploy.bat | 12 ------------ shell/update_public.bat | 14 -------------- startup.bat | 16 +++++++++++++++- update_deploy.bat | 15 ++++++++++++++- update_public.bat | 15 ++++++++++++++- 19 files changed, 89 insertions(+), 100 deletions(-) delete mode 100644 shell/clean.bat delete mode 100644 shell/close.bat delete mode 100644 shell/gen_data.bat delete mode 100644 shell/gen_go.bat delete mode 100644 shell/start.bat delete mode 100644 shell/update_deploy.bat delete mode 100644 shell/update_public.bat diff --git a/clean.bat b/clean.bat index f6c504a..80e5a52 100644 --- a/clean.bat +++ b/clean.bat @@ -1,3 +1,10 @@ @echo off -call shell/clean.bat \ No newline at end of file +for /f "tokens=*" %%a in (shell/programs.txt) do ( + if exist "%%a\*.log" del /q "%%a\*.log" + if exist "%%a\*.log.*" del /q "%%a\*.log.*" + + echo "clean logs: %%a" +) + +echo "clean logs complete!" \ No newline at end of file diff --git a/close.bat b/close.bat index b25d937..25709d5 100644 --- a/close.bat +++ b/close.bat @@ -1,3 +1,7 @@ @echo off -call shell/close.bat \ No newline at end of file +for /f %%i in (shell/programs.txt) do ( + taskkill /F /IM %%i.exe +) + +echo "close complete!" \ No newline at end of file diff --git a/data/DB_GiftCard.dat b/data/DB_GiftCard.dat index 15600367ff42a73b75826e6378f02a3bde3a8661..96640b07f274cbbbda035ee3e52503c8356a73cb 100644 GIT binary patch delta 38 pcmcDtoFJjd$+57PP2j+^jZ8{x92eV|1-P_0AVMv+2JBXh3;@YB39kSE delta 38 pcmcDtoFJjd#&NNYS%6E4lVf2oo4|o-8=15?Aj}q919mG$1^~Z739kSE diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index f7c20832bc27cd9f159e94e610b613e16cc8b70b..d82a96a50ad2d2990640ca9d15e38e5b3423eb15 100644 GIT binary patch literal 384 zcmd-w<6snElw#w!+{O&1uR!UmQ2H8_z7C?5I5-yevI!h$vE|a^U;?YZ0hPZArEfv$ z+i2>;IUweP%>mj6(+5@uMW Vn8WXY9nQ|N24tjIuz_N XpoK7xgB_&A&anvS(J#zg477y+WkNhP diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 09a699fd3967256d6ee5afa59fe15a472c1e9d64..257271850d35ce7db5641289d55bc31b7aea60dc 100644 GIT binary patch delta 205 zcmeCz?$_QhpHYyFV@WTYfQT0d$3h@|p^bU-2F4pKK;cC|E)!IEK`-0pnQY;VlP7bE zOlILQf=V+(r5`L8n(WSD4i#mEX*wjgxu3(GQ4nG@P>~nJROZRgIV&cAs zQF&k%&tygpQ>eZN%Y}gYK=RC!-8sxBZ{QZ$Jc+{vrimG<38-xHbIuB=QCu*iT5LBL maPhKCp3EsYxsOjDDvhLR^EtkCFtb>px)vOg+uSR_#0mg@LpAsS diff --git a/gen_data.bat b/gen_data.bat index 7cc93cc..ecd1d8e 100644 --- a/gen_data.bat +++ b/gen_data.bat @@ -1,3 +1,21 @@ @echo off -call shell/gen_data.bat + +echo "excel to proto and binary" + +set protoc=.\bin\protoc-3.19.4-win64\bin\protoc.exe +set protoc-gen-go-plugin-path=".\bin\protoc-gen-go.exe" + +cd ./tools/xlsx2proto +go build +xlsx2proto.exe + +cd ../../ +%protoc% --proto_path=./protocol/server --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=../../ pbdata.proto + +cd ./tools/xlsx2binary +go build +xlsx2binary.exe + +echo "success" + pause diff --git a/gen_go.bat b/gen_go.bat index 625b36a..de8ec63 100644 --- a/gen_go.bat +++ b/gen_go.bat @@ -1,3 +1,14 @@ @echo off -call shell/gen_go.bat +echo "proto to go" + +set proto_path=.\protocol +set protoc=.\bin\protoc-3.19.4-win64\bin\protoc.exe +set protoc-gen-go-plugin-path=".\bin\protoc-gen-go.exe" + +for /d %%s in (%proto_path%\*) do ( + %protoc% --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=../../../ %%s\*.proto +) + +echo "success" + pause \ No newline at end of file diff --git a/protocol/server/server.proto b/protocol/server/server.proto index f6b9cdc..4966fd2 100644 --- a/protocol/server/server.proto +++ b/protocol/server/server.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package server; option go_package = "mongo.games.com/game/protocol/server"; -import "pbdata.proto"; +import "protocol/server/pbdata.proto"; enum SSPacketID { PACKET_SERVER_ZERO = 0; // 弃用消息号 diff --git a/protocol/webapi/webapi.proto b/protocol/webapi/webapi.proto index 774ae86..63b1076 100644 --- a/protocol/webapi/webapi.proto +++ b/protocol/webapi/webapi.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package webapi; option go_package = "mongo.games.com/game/protocol/webapi"; -import "common.proto"; +import "protocol/webapi/common.proto"; /* * ===================================================== diff --git a/shell/clean.bat b/shell/clean.bat deleted file mode 100644 index c53aa6c..0000000 --- a/shell/clean.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off - -for /f "tokens=*" %%a in (shell/programs.txt) do ( - if exist "%%a\*.log" del /q "%%a\*.log" - if exist "%%a\*.log.*" del /q "%%a\*.log.*" - - echo "clean logs: %%a" -) - -echo "clean logs complete!" \ No newline at end of file diff --git a/shell/close.bat b/shell/close.bat deleted file mode 100644 index 25709d5..0000000 --- a/shell/close.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -for /f %%i in (shell/programs.txt) do ( - taskkill /F /IM %%i.exe -) - -echo "close complete!" \ No newline at end of file diff --git a/shell/gen_data.bat b/shell/gen_data.bat deleted file mode 100644 index cd5895c..0000000 --- a/shell/gen_data.bat +++ /dev/null @@ -1,15 +0,0 @@ -set work_path=%cd% -set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe -set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe" - -cd %work_path%/tools/xlsx2proto -go build -xlsx2proto.exe - -cd ../../protocol/server -%protoc% --proto_path=%GOPATH%\src --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src pbdata.proto - -cd ../../tools/xlsx2binary -go build -xlsx2binary.exe -cd %work_path% \ No newline at end of file diff --git a/shell/gen_go.bat b/shell/gen_go.bat deleted file mode 100644 index c1507b4..0000000 --- a/shell/gen_go.bat +++ /dev/null @@ -1,16 +0,0 @@ -set work_path=%cd% -set proto_path=%work_path%\protocol -set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe -set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe" - -rem echo %protoc3% -cd %proto_path% -for /d %%s in (,*) do ( - cd %%s - for %%b in (,*.proto) do ( -rem echo %%b - %protoc% --proto_path=%GOPATH%\src\mongo.games.com\game --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src %%b - ) - cd .. -) -cd %work_path% \ No newline at end of file diff --git a/shell/start.bat b/shell/start.bat deleted file mode 100644 index 585a90e..0000000 --- a/shell/start.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -for /f "tokens=*" %%a in (shell/programs.txt) do ( - set program=%%a/%%a.exe - - if exist "!program!" ( - pushd %%a - start "%%a" "%%a.exe" - popd - echo "start: !program!" - ) else ( - echo "not found: !program!" - ) -) - -echo "start complete!" \ No newline at end of file diff --git a/shell/update_deploy.bat b/shell/update_deploy.bat deleted file mode 100644 index 9d1ec6c..0000000 --- a/shell/update_deploy.bat +++ /dev/null @@ -1,12 +0,0 @@ -set deployDir="..\deploy" - -xcopy .\data\* %deployDir%\data\ /s /e /y - -for /f "tokens=*" %%a in (shell/programs.txt) do ( - xcopy .\%%a\%%a %deployDir% /y - del .\%%a\%%a -) - -for /f "tokens=*" %%f in (shell/exclude.txt) do ( - if exist "%deployDir%\data\%%f" (del "%deployDir%\data\%%f") -) \ No newline at end of file diff --git a/shell/update_public.bat b/shell/update_public.bat deleted file mode 100644 index 376fa0b..0000000 --- a/shell/update_public.bat +++ /dev/null @@ -1,14 +0,0 @@ -if exist "..\public" ( - cd ..\public - git checkout main - git pull - - xcopy ..\game\data .\data /s /e /y - xcopy ..\game\protocol .\protocol /s /e /y - xcopy ..\game\xlsx .\xlsx /s /e /y - - git add . - git commit -m "update" - git push - cd .. -) \ No newline at end of file diff --git a/startup.bat b/startup.bat index 2bc575e..1785d1a 100644 --- a/startup.bat +++ b/startup.bat @@ -1,4 +1,18 @@ set GODEBUG=gctrace=1 @echo off +setlocal enabledelayedexpansion -call shell/start.bat \ No newline at end of file +for /f "tokens=*" %%a in (shell/programs.txt) do ( + set program=%%a/%%a.exe + + if exist "!program!" ( + pushd %%a + start "%%a" "%%a.exe" + popd + echo "start: !program!" + ) else ( + echo "not found: !program!" + ) +) + +echo "start complete!" \ No newline at end of file diff --git a/update_deploy.bat b/update_deploy.bat index 656a154..b63e3cd 100644 --- a/update_deploy.bat +++ b/update_deploy.bat @@ -1,3 +1,16 @@ @echo off -call shell/update_deploy.bat + +set deployDir=".\deploy" + +xcopy .\data\* %deployDir%\data\ /s /e /y + +for /f "tokens=*" %%a in (shell/programs.txt) do ( + xcopy .\%%a\%%a %deployDir% /y + del .\%%a\%%a +) + +for /f "tokens=*" %%f in (shell/exclude.txt) do ( + if exist "%deployDir%\data\%%f" (del "%deployDir%\data\%%f") +) + pause \ No newline at end of file diff --git a/update_public.bat b/update_public.bat index e7032e6..125310e 100644 --- a/update_public.bat +++ b/update_public.bat @@ -1,3 +1,16 @@ @echo off -call shell/update_public.bat +if exist "..\public" ( + cd ..\public + git checkout main + git pull + + xcopy ..\game\data .\data /s /e /y + xcopy ..\game\protocol .\protocol /s /e /y + xcopy ..\game\xlsx .\xlsx /s /e /y + + git add . + git commit -m "update" + git push + cd .. +) pause \ No newline at end of file