mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 14:52:46 +02:00
Reinit bestPromise with each proposal.
This commit is contained in:
parent
03244fbeb5
commit
59f1cdfc18
2 changed files with 2 additions and 4 deletions
|
@ -86,9 +86,7 @@ virtualBaton = function virtualBaton(options) {
|
||||||
if (!claimCallback) { return; } // We're not participating.
|
if (!claimCallback) { return; } // We're not participating.
|
||||||
nPromises = 0;
|
nPromises = 0;
|
||||||
nQuorum = Math.floor(AvatarList.getAvatarIdentifiers().length / 2) + 1; // N.B.: ASSUMES EVERY USER IS RUNNING THE SCRIPT!
|
nQuorum = Math.floor(AvatarList.getAvatarIdentifiers().length / 2) + 1; // N.B.: ASSUMES EVERY USER IS RUNNING THE SCRIPT!
|
||||||
bestPromise.proposerId = MyAvatar.sessionUUID;
|
bestPromise = {number: ++bestPromise.number, proposerId: MyAvatar.sessionUUID, winner: claim};
|
||||||
bestPromise.number++;
|
|
||||||
bestPromise.winner = claim;
|
|
||||||
send('prepare!', bestPromise);
|
send('prepare!', bestPromise);
|
||||||
function reclaim() { propose(claim); }
|
function reclaim() { propose(claim); }
|
||||||
electionWatchdog = Script.setTimeout(reclaim, electionTimeout);
|
electionWatchdog = Script.setTimeout(reclaim, electionTimeout);
|
|
@ -12,7 +12,7 @@ var Vec3, Quat, MyAvatar, Entities, Camera, Script, print;
|
||||||
// All participants should run the test script.
|
// All participants should run the test script.
|
||||||
|
|
||||||
|
|
||||||
Script.include("../libraries/virtualBaton.25.js");
|
Script.include("../libraries/virtualBaton.27.js");
|
||||||
var TICKER_INTERVAL = 1000; // ms
|
var TICKER_INTERVAL = 1000; // ms
|
||||||
var baton = virtualBaton({key: 'io.highfidelity.testBaton'});
|
var baton = virtualBaton({key: 'io.highfidelity.testBaton'});
|
||||||
var ticker, countDown;
|
var ticker, countDown;
|
||||||
|
|
Loading…
Reference in a new issue