Skip to content
Snippets Groups Projects
Commit 3069ef33 authored by mcmlxxix's avatar mcmlxxix
Browse files

load settings from file instead of hardcoding in service.js

(this only affects people who might be running a synchronetris server)
parent 6e19010a
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ load("sbbsdefs.js");
var game_id = "synchronetris";
var timer = new Timer();
var client = new JSONClient("localhost",10088);
var settings = loadSettings();
var data = {
games:client.read(game_id,"games",1),
......@@ -15,17 +16,6 @@ var data = {
timers:{}
};
var settings = {
garbage:true,
min_players:1,
max_players:3,
pause:1000,
pause_reduction:0.7,
base_points:5,
lines:10,
start_delay:5000
};
var status={
WAITING:-1,
STARTING:0,
......@@ -234,6 +224,14 @@ function init() {
log(LOG_INFO,"Synchronetris background service initialized");
}
function loadSettings() {
var file=new File(root + "synchronetris.ini");
file.open('r',true);
var data=file.iniGetObject(null);
file.close();
return data;
}
/* main loop */
function main() {
while(!js.terminated && !parent_queue.poll()) {
......
garbage=true
min_players=1
max_players=3
pause=1250
pause_reduction=0.85
base_points=5
lines=10
start_delay=5000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment