Fix arrival times in FleetManager
This commit is contained in:
parent
b08bb37029
commit
3ccb0f1945
|
@ -172,11 +172,13 @@ export default class FleetManager {
|
|||
else resource.amount += res.amount;
|
||||
}
|
||||
|
||||
const arrival = new Date(this.data.arrivalTime);
|
||||
|
||||
await this.initiateReturn();
|
||||
await sendMail(
|
||||
null,
|
||||
this.data.source instanceof SystemManager ? this.data.source.data.ownedBy.id : this.data.source.system.data.ownedBy.id,
|
||||
this.data.arrivalTime,
|
||||
arrival,
|
||||
"Asteroid mined",
|
||||
`Your fleet has arrived at AS-${this.data.additionalData} asteroid.\n
|
||||
Following resources were added to the cargo inventory:\n${asteroid.resources.map(r => `${r.id} - ${r.amount}`).join('\n')}\n
|
||||
|
@ -238,10 +240,14 @@ export default class FleetManager {
|
|||
}
|
||||
}
|
||||
|
||||
const arrivalTime = new Date(this.data.arrivalTime);
|
||||
|
||||
await this.initiateReturn();
|
||||
|
||||
await sendMail(
|
||||
null,
|
||||
this.data.source instanceof SystemManager ? this.data.source.data.ownedBy.id : this.data.source.system.data.ownedBy.id,
|
||||
this.data.arrivalTime,
|
||||
arrivalTime,
|
||||
"Spy report",
|
||||
`Your fleet has arrived at ${this.data.destination instanceof SystemManager ? `${this.data.destination.data.name} system` : `planet ${this.data.destination.name}`}.\n
|
||||
Following information was gathered:\n\n
|
||||
|
@ -257,14 +263,12 @@ export default class FleetManager {
|
|||
await sendMail(
|
||||
null,
|
||||
this.data.destination instanceof SystemManager ? this.data.destination.data.ownedBy.id : (this.data.destination as Planet).system.data.ownedBy.id,
|
||||
this.data.arrivalTime,
|
||||
arrivalTime,
|
||||
"Spy probe detected",
|
||||
`Your systems have detected enemy spy probe at ${this.data.destination instanceof SystemManager ? `${this.data.destination.data.name} system` : `planet ${this.data.destination.name}`}.\n
|
||||
Probe was identified to belong to ${this.data.source instanceof SystemManager ? this.data.source.data.ownedBy.username : this.data.source.system.data.ownedBy.username}.`
|
||||
);
|
||||
|
||||
await this.initiateReturn();
|
||||
|
||||
return false;
|
||||
case 'COLONIZE':
|
||||
const destination = this.data.destination as Sector | SystemManager;
|
||||
|
|
Loading…
Reference in New Issue