mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
fix bug with redundant play/pause events, fix spec, tweak current moderator css
This commit is contained in:
@@ -66,26 +66,29 @@ class ServerTimer {
|
||||
}
|
||||
|
||||
stopTimer () {
|
||||
this.logger.debug('STOPPING TIMER');
|
||||
if (this.ticking) {
|
||||
this.logger.debug('STOPPING TIMER');
|
||||
clearTimeout(this.ticking);
|
||||
this.ticking = null;
|
||||
}
|
||||
}
|
||||
|
||||
resumeTimer () {
|
||||
this.logger.debug('RESUMING TIMER FOR ' + this.currentTimeInMillis + 'ms');
|
||||
this.start = Date.now();
|
||||
this.totalTime = this.currentTimeInMillis;
|
||||
const expected = Date.now() + this.tickInterval;
|
||||
const instance = this;
|
||||
this.ticking = setTimeout(function () {
|
||||
stepFn(
|
||||
instance,
|
||||
expected
|
||||
);
|
||||
}, this.tickInterval);
|
||||
if (!this.ticking) {
|
||||
this.logger.debug('RESUMING TIMER FOR ' + this.currentTimeInMillis + 'ms');
|
||||
this.start = Date.now();
|
||||
this.totalTime = this.currentTimeInMillis;
|
||||
const expected = Date.now() + this.tickInterval;
|
||||
const instance = this;
|
||||
this.ticking = setTimeout(function () {
|
||||
stepFn(
|
||||
instance,
|
||||
expected
|
||||
);
|
||||
}, this.tickInterval);
|
||||
|
||||
return this.timesUpPromise;
|
||||
return this.timesUpPromise;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class EventManager {
|
||||
try {
|
||||
messageComponents = message.split(';', 3);
|
||||
if (messageComponents[messageComponents.length - 1] === this.instanceId) {
|
||||
this.logger.trace('Disregarding self-authored message');
|
||||
this.logger.debug('Disregarding self-authored message');
|
||||
return;
|
||||
}
|
||||
args = JSON.parse(
|
||||
|
||||
Reference in New Issue
Block a user