Skip to content

Instantly share code, notes, and snippets.

@ugai
Last active February 8, 2017 11:13
Show Gist options
  • Save ugai/7959006f5db86bf83be884ac7f882cfb to your computer and use it in GitHub Desktop.
Save ugai/7959006f5db86bf83be884ac7f882cfb to your computer and use it in GitHub Desktop.
DoW鯖用
@echo off
echo Start
call "C:\dow\MyDowUpdate.bat"
call "C:\dow\MyLaunchServer.bat"
echo end
@echo off
echo Updating DoW Server 1 ...
cd "C:\steamcmd"
steamcmd.exe +runscript "C:\dow\MyUpdateScript.txt"
@echo "Days of War Server is Running Please Do Not Close This Window!"
@echo off
cd "C:\dow\DaysOfWar\Binaries\Win64"
:START
if exist "update" (
del "update"
)
if exist "shutdown" (
del "shutdown"
exit /b
) else (
DaysOfWarServer-Win64-Shipping.exe dow_carentan Port=7777 QueryPort=27015 -LOG
goto START
)
login anonymous
force_install_dir "C:\dow\"
app_update 541790 validate
quit
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.host) {
var Gamedig = require('gamedig');
Gamedig.query(
{
type: 'protocol-valve',
host: req.query.host,
port: req.query.port | 27015
},
function(state) {
if(state.error) {
res = {
body: "Server is offline"
};
}
else {
console.log(state);
res = {
//body: "Server is online: " + JSON.stringify(state)
body:
state.raw.rules.ONM_s + ', ' +
state.raw.rules.G_s + ', ' +
state.raw.rules.MPN_s + ', ' +
state.raw.numplayers + '/' +
state.maxplayers + ', ' +
state.raw.rules.V_s
};
}
context.done(null, res);
}
);
}
else {
res = {
status: 400,
body: "Please pass a host on the query string"
};
context.done(null, res);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment