From 06798446a79a69aca996a055aacecc07f19725d3 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 6 Nov 2017 13:55:03 +0800 Subject: [PATCH] phantom --- game/game.js | 6 +++--- game/phantom.js | 27 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/game/game.js b/game/game.js index c438f4579..399d6a012 100644 --- a/game/game.js +++ b/game/game.js @@ -8036,9 +8036,9 @@ ui.css.styles.sheet.insertRule('#window #control{font-family: STHeiti,SimHei,Microsoft JhengHei,Microsoft YaHei,WenQuanYi Micro Hei,Helvetica,Arial,sans-serif}',0); } switch(lib.config.glow_phase){ - case 'yellow':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(235, 239, 59) 0 0 15px, rgb(199, 64, 64) 0 0 15px !important;',0);break; - case 'green':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(10, 155, 67, 1) 0 0 15px, rgba(10, 155, 67, 1) 0 0 15px !important;',0);break; - case 'purple':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(178, 59, 239) 0 0 15px, rgb(199, 64, 101) 0 0 15px !important;',0);break; + case 'yellow':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(235, 239, 59) 0 0 15px, rgb(199, 64, 64) 0 0 15px !important;}',0);break; + case 'green':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(10, 155, 67, 1) 0 0 15px, rgba(10, 155, 67, 1) 0 0 15px !important;}',0);break; + case 'purple':ui.css.styles.sheet.insertRule('#arena .player:not(.selectable):not(.selected).glow_phase {box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgb(178, 59, 239) 0 0 15px, rgb(199, 64, 101) 0 0 15px !important;}',0);break; } }, layout:function(layout,nosave){ diff --git a/game/phantom.js b/game/phantom.js index 6f248308c..c6c668376 100644 --- a/game/phantom.js +++ b/game/phantom.js @@ -1,20 +1,29 @@ -var load=function(id){ - var page = require('webpage').create(); +var fs = require('fs'); +var webpage = require('webpage') +var load = function(id){ + var page = webpage.create(); page.settings.userAgent = 'SpecialAgent'; - page.open('http://localhost/index.html?server='+id, function(status) { + page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) { if(status !== 'success') { + console.log(fs.workingDirectory); console.log('Unable to access network'); } setInterval(function(){ - page.evaluate(function(){ + if(page.evaluate(function(){ if(!lib.node||!lib.node.clients||!lib.node.clients.length){ - game.reload(); + return true; } - }); - },3600000); + else{ + return false; + } + })){ + page.close(); + load(id); + } + },600000); }); } load(1); -// load(2); -// load(3); +load(2); +load(3);