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 1560036..96640b0 100644 Binary files a/data/DB_GiftCard.dat and b/data/DB_GiftCard.dat differ diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index f7c2083..d82a96a 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 09a699f..2572718 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ 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