Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
b336d899
Commit
b336d899
authored
Apr 22, 2022
by
Jaida Wu
Browse files
Integrate MongoDB into C2R
Signed-off-by:
Jaida Wu
<
mlgmxyysd@meowcat.org
>
parent
7bc94454
Changes
1
Hide whitespace changes
Inline
Side-by-side
start.cmd
View file @
b336d899
...
@@ -11,11 +11,12 @@ call :LOG [INFO] To proper exit this console, use [Ctrl + C] and enter N not Y.
...
@@ -11,11 +11,12 @@ call :LOG [INFO] To proper exit this console, use [Ctrl + C] and enter N not Y.
call
:LOG
[
INFO
]
call
:LOG
[
INFO
]
call
:LOG
[
INFO
]
Initializing
...
call
:LOG
[
INFO
]
Initializing
...
@rem TODO: MongoDB integration
set
JAVA_PATH
=
DO_NOT_CHECK_PATH
set
JAVA_PATH
=
DO_NOT_CHECK_PATH
set
MITMDUMP_PATH
=
DO_NOT_CHECK_PATH
set
MITMDUMP_PATH
=
DO_NOT_CHECK_PATH
set
MONGODB_PATH
=
DO_NOT_CHECK_PATH
set
SERVER_JAR_PATH
=
%CUR_PATH%
set
SERVER_JAR_PATH
=
%CUR_PATH%
set
DATABASE_STORAGE_PATH
=
%CUR_PATH%
resources
\Database
set
SERVER_JAR_NAME
=
grasscutter
.jar
set
SERVER_JAR_NAME
=
grasscutter
.jar
set
PROXY_SCRIPT_NAME
=
proxy
set
PROXY_SCRIPT_NAME
=
proxy
...
@@ -98,11 +99,35 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr
...
@@ -98,11 +99,35 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr
reg
add
"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
/v
ProxyServer
/d
"127.0.0.1:8080"
/f
>
nul
2
>
nul
reg
add
"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
/v
ProxyServer
/d
"127.0.0.1:8080"
/f
>
nul
2
>
nul
:SERVER
:SERVER
if
not
"
%MONGODB_PATH%
"
==
"DO_NOT_CHECK_PATH"
(
if
not
exist
"
%MONGODB_PATH%
mongod.exe"
(
call
:LOG
[
WARN
]
MongoDB
daemon
not
found
,
server
only
mode
.
goto
:GAME
)
)
else
set
MONGODB_PATH
=
call
:LOG
[
INFO
]
Starting
MongoDB
daemon
...
set
DATABASE
=
true
mkdir
"
%DATABASE_STORAGE_PATH%
"
>
nul
2
>
nul
echo
set
ws
=
createobject
(
"wscript.shell"
)
>
"
%temp%
\db.vbs"
echo
ws
.currentdirectory
=
"
%MONGODB_PATH%
"
>>
"
%temp%
\db.vbs"
echo
ws
.run
"cmd /c mongod.exe --dbpath "
^&
chr
(
34
)
^&
"
%DATABASE_STORAGE_PATH%
"
^&
chr
(
34
)
^&
""
,
0
>>
"
%temp%
\db.vbs"
"
%temp%
\db.vbs"
del
/f /q
"
%temp%
\db.vbs"
>
nul
2
>
nul
:GAME
call
:LOG
[
INFO
]
Starting
server
...
call
:LOG
[
INFO
]
Starting
server
...
"
%JAVA_PATH%
java.exe"
-jar
"
%SERVER_PATH%
grasscutter.jar"
"
%JAVA_PATH%
java.exe"
-jar
"
%SERVER_PATH%
grasscutter.jar"
call
:LOG
[
INFO
]
Server
stopped
call
:LOG
[
INFO
]
Server
stopped
:EXIT
:EXIT
if
"
%DATABASE%
"
==
""
(
call
:LOG
[
INFO
]
MongoDB
daemon
not
started
,
no
need
to
clean
up
.
)
else
(
call
:LOG
[
INFO
]
Shutting
down
MongoDB
daemon
...
taskkill
/t /f /im
mongod
.exe
>
nul
2
>
nul
)
if
"
%PROXY%
"
==
""
(
if
"
%PROXY%
"
==
""
(
call
:LOG
[
INFO
]
Proxy
daemon
not
started
,
no
need
to
clean
up
.
call
:LOG
[
INFO
]
Proxy
daemon
not
started
,
no
need
to
clean
up
.
)
else
(
)
else
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment