From f5fa8a4ca9d05a1612a0e9126bc3ca4fe953e8ae Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Tue, 30 Jan 2018 07:53:11 +0100 Subject: [PATCH] Cache getMac --- client.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 25d00e9f..9b365107 100644 --- a/client.js +++ b/client.js @@ -581,7 +581,8 @@ function instanceManagement() { playerCount: instanceInfo.playerCount || 0, instanceName: instance, } - getMac(function (err, mac) { + //remote.call('clusterio','setWorldID',1234) + function callback(err, mac) { if (err) { console.log("##### getMac crashed, but we don't really give a shit because we are probably closing down #####"); } else { @@ -597,7 +598,12 @@ function instanceManagement() { } }); } - }); + } + if(global.mac){ + getMac(callback); + } else { + callback(undefined, global.mac); + } },1000)}); } });