say what constraints exactly
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build / build (pull_request) Successful in 1m9s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build / build (pull_request) Successful in 1m9s
				
			This commit is contained in:
		
							parent
							
								
									2054a56620
								
							
						
					
					
						commit
						d0792fbf8e
					
				@ -1038,13 +1038,13 @@ const pushVoidStorms = (arr: IVoidStorm[], hour: number): void => {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface ITimeConstraint {
 | 
					interface ITimeConstraint {
 | 
				
			||||||
    //name: string;
 | 
					    name: string;
 | 
				
			||||||
    isValidTime: (timeSecs: number) => boolean;
 | 
					    isValidTime: (timeSecs: number) => boolean;
 | 
				
			||||||
    getIdealTimeBefore: (timeSecs: number) => number;
 | 
					    getIdealTimeBefore: (timeSecs: number) => number;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const eidolonDayConstraint: ITimeConstraint = {
 | 
					const eidolonDayConstraint: ITimeConstraint = {
 | 
				
			||||||
    //name: "eidolon day",
 | 
					    name: "eidolon day",
 | 
				
			||||||
    isValidTime: (timeSecs: number): boolean => {
 | 
					    isValidTime: (timeSecs: number): boolean => {
 | 
				
			||||||
        const eidolonEpoch = 1391992660;
 | 
					        const eidolonEpoch = 1391992660;
 | 
				
			||||||
        const eidolonCycle = Math.trunc((timeSecs - eidolonEpoch) / 9000);
 | 
					        const eidolonCycle = Math.trunc((timeSecs - eidolonEpoch) / 9000);
 | 
				
			||||||
@ -1062,7 +1062,7 @@ const eidolonDayConstraint: ITimeConstraint = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const eidolonNightConstraint: ITimeConstraint = {
 | 
					const eidolonNightConstraint: ITimeConstraint = {
 | 
				
			||||||
    //name: "eidolon night",
 | 
					    name: "eidolon night",
 | 
				
			||||||
    isValidTime: (timeSecs: number): boolean => {
 | 
					    isValidTime: (timeSecs: number): boolean => {
 | 
				
			||||||
        const eidolonEpoch = 1391992660;
 | 
					        const eidolonEpoch = 1391992660;
 | 
				
			||||||
        const eidolonCycle = Math.trunc((timeSecs - eidolonEpoch) / 9000);
 | 
					        const eidolonCycle = Math.trunc((timeSecs - eidolonEpoch) / 9000);
 | 
				
			||||||
@ -1089,7 +1089,7 @@ const eidolonNightConstraint: ITimeConstraint = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const venusColdConstraint: ITimeConstraint = {
 | 
					const venusColdConstraint: ITimeConstraint = {
 | 
				
			||||||
    //name: "venus cold",
 | 
					    name: "venus cold",
 | 
				
			||||||
    isValidTime: (timeSecs: number): boolean => {
 | 
					    isValidTime: (timeSecs: number): boolean => {
 | 
				
			||||||
        const vallisEpoch = 1541837628;
 | 
					        const vallisEpoch = 1541837628;
 | 
				
			||||||
        const vallisCycle = Math.trunc((timeSecs - vallisEpoch) / 1600);
 | 
					        const vallisCycle = Math.trunc((timeSecs - vallisEpoch) / 1600);
 | 
				
			||||||
@ -1115,7 +1115,7 @@ const venusColdConstraint: ITimeConstraint = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const venusWarmConstraint: ITimeConstraint = {
 | 
					const venusWarmConstraint: ITimeConstraint = {
 | 
				
			||||||
    //name: "venus warm",
 | 
					    name: "venus warm",
 | 
				
			||||||
    isValidTime: (timeSecs: number): boolean => {
 | 
					    isValidTime: (timeSecs: number): boolean => {
 | 
				
			||||||
        const vallisEpoch = 1541837628;
 | 
					        const vallisEpoch = 1541837628;
 | 
				
			||||||
        const vallisCycle = Math.trunc((timeSecs - vallisEpoch) / 1600);
 | 
					        const vallisCycle = Math.trunc((timeSecs - vallisEpoch) / 1600);
 | 
				
			||||||
@ -1321,7 +1321,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            constraints.push({
 | 
					            constraints.push({
 | 
				
			||||||
                //name: `duviri ${config.worldState.duviriOverride}`,
 | 
					                name: `duviri ${config.worldState.duviriOverride}`,
 | 
				
			||||||
                isValidTime: (timeSecs: number): boolean => {
 | 
					                isValidTime: (timeSecs: number): boolean => {
 | 
				
			||||||
                    const moodIndex = Math.trunc(timeSecs / 7200);
 | 
					                    const moodIndex = Math.trunc(timeSecs / 7200);
 | 
				
			||||||
                    return moodIndex % 5 == desiredMood;
 | 
					                    return moodIndex % 5 == desiredMood;
 | 
				
			||||||
@ -1339,7 +1339,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
 | 
				
			|||||||
    if (constraints.length != 0) {
 | 
					    if (constraints.length != 0) {
 | 
				
			||||||
        const delta = Math.trunc(Date.now() / 1000) - timeSecs;
 | 
					        const delta = Math.trunc(Date.now() / 1000) - timeSecs;
 | 
				
			||||||
        if (delta != 0) {
 | 
					        if (delta != 0) {
 | 
				
			||||||
            logger.debug(`reported time is ${delta} seconds behind real time to satisfy selected constraints`);
 | 
					            logger.debug(
 | 
				
			||||||
 | 
					                `reported time is ${delta} seconds behind real time to satisfy selected constraints (${constraints.map(x => x.name).join(", ")})`
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const timeMs = timeSecs * 1000;
 | 
					    const timeMs = timeSecs * 1000;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user