Commit b465b5e3 authored by Chen Bill's avatar Chen Bill Committed by GitHub

read version from config.h (#85)

parent 21b0b302
...@@ -38,7 +38,7 @@ RUN git clone --branch=server --recursive --depth=1 https://code.mycard.moe/myca ...@@ -38,7 +38,7 @@ RUN git clone --branch=server --recursive --depth=1 https://code.mycard.moe/myca
strip ygopro && \ strip ygopro && \
mkdir replay expansions && \ mkdir replay expansions && \
rm -rf .git* bin obj build ocgcore cmake lua premake* sound textures .travis.yml *.txt appveyor.yml LICENSE README.md *.lua strings.conf system.conf && \ rm -rf .git* bin obj build ocgcore cmake lua premake* sound textures .travis.yml *.txt appveyor.yml LICENSE README.md *.lua strings.conf system.conf && \
ls gframe | sed '/game.cpp/d' | xargs -I {} rm -rf gframe/{} ls gframe | sed '/config.h/d' | xargs -I {} rm -rf gframe/{}
# infos # infos
WORKDIR /ygopro-server WORKDIR /ygopro-server
......
...@@ -412,7 +412,7 @@ init = () -> ...@@ -412,7 +412,7 @@ init = () ->
catch catch
try try
log.info("Reading YGOPro version.") log.info("Reading YGOPro version.")
cppversion = parseInt((await fs.promises.readFile('ygopro/gframe/game.cpp', 'utf8')).match(/PRO_VERSION = ([x\dABCDEF]+)/)[1], '16') cppversion = parseInt((await fs.promises.readFile('ygopro/gframe/config.h', 'utf8')).match(/PRO_VERSION = ([x\dABCDEF]+)/)[1], '16')
await setting_change(settings, "version", cppversion) await setting_change(settings, "version", cppversion)
log.info "ygopro version 0x"+settings.version.toString(16), "(from source code)" log.info "ygopro version 0x"+settings.version.toString(16), "(from source code)"
catch catch
......
...@@ -533,7 +533,7 @@ ...@@ -533,7 +533,7 @@
} }
try { try {
log.info("Reading YGOPro version."); log.info("Reading YGOPro version.");
cppversion = parseInt(((await fs.promises.readFile('ygopro/gframe/game.cpp', 'utf8'))).match(/PRO_VERSION = ([x\dABCDEF]+)/)[1], '16'); cppversion = parseInt(((await fs.promises.readFile('ygopro/gframe/config.h', 'utf8'))).match(/PRO_VERSION = ([x\dABCDEF]+)/)[1], '16');
await setting_change(settings, "version", cppversion); await setting_change(settings, "version", cppversion);
log.info("ygopro version 0x" + settings.version.toString(16), "(from source code)"); log.info("ygopro version 0x" + settings.version.toString(16), "(from source code)");
} catch (error1) { } catch (error1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment