....
This commit is contained in:
@ -4,7 +4,7 @@ import { RsaPubKey } from "../crypto/rsa.js";
|
||||
import { PaillierPubKey, ReadOnlyCiphertext } from "../crypto/paillier.js";
|
||||
import { Region } from "./map.js";
|
||||
import { showDefenseDom } from "./dom.js";
|
||||
import { proveRegions, verifyRegions } from "./proofs.js";
|
||||
import { proveRange, proveRegions, verifyRegions } from "./proofs.js";
|
||||
|
||||
// Timeout to consider a player disconnected
|
||||
const TIMEOUT = 30_000;
|
||||
@ -306,10 +306,9 @@ export class Player {
|
||||
// Handle region loss
|
||||
} else {
|
||||
// Prove we still control the region
|
||||
let proof = proveRange(defender.strength.cipherText, 2n ** 32n);
|
||||
}
|
||||
}
|
||||
|
||||
if (this === game.us) {
|
||||
} else if (this === game.us) {
|
||||
if (defender.strength.assumedStrength === 0n) {
|
||||
// Handle region gain
|
||||
defender.owner = this;
|
||||
@ -318,10 +317,10 @@ export class Player {
|
||||
defender.name
|
||||
);
|
||||
}
|
||||
} else {
|
||||
await defender.resolveConflict();
|
||||
}
|
||||
|
||||
await defender.resolveConflict();
|
||||
|
||||
// Reset the promises in case they attack again.
|
||||
defender.owner.defenderPromise = null;
|
||||
defender.owner.defenderAmount = null;
|
||||
|
Reference in New Issue
Block a user