Skip to content

Commit

Permalink
end of work on constants #2426
Browse files Browse the repository at this point in the history
  • Loading branch information
BastLast committed Mar 11, 2024
1 parent 3735fa6 commit c46b8fb
Show file tree
Hide file tree
Showing 92 changed files with 193 additions and 163 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";

export const commandInfo: ITestCommand = {
name: "glorypoints",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Guild from "../../../../core/database/game/models/Guild";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {Players} from "../../../../core/database/game/models/Player";
import {GuildConstants} from "../../../../core/constants/GuildConstants";
import {GuildConstants} from "../../../../../../Lib/src/constants/GuildConstants";

export const commandInfo: ITestCommand = {
name: "forcejoinguild",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Guild from "../../../../core/database/game/models/Guild";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {GuildConstants} from "../../../../core/constants/GuildConstants";
import {GuildConstants} from "../../../../../../Lib/src/constants/GuildConstants";

export const commandInfo: ITestCommand = {
name: "guildlevel",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Guild from "../../../../core/database/game/models/Guild";
import {GuildDailyConstants} from "../../../../core/constants/GuildDailyConstants";
import {GuildDailyConstants} from "../../../../../../Lib/src/constants/GuildDailyConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

let stringDesc = "Force un gd avec une sortie donnée. Liste des sorties possibles : ";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Guild from "../../../../core/database/game/models/Guild";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {draftBotInstance} from "../../../../index";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Guild from "../../../../core/database/game/models/Guild";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Guild from "../../../../core/database/game/models/Guild";
import {getFoodIndexOf} from "../../../../core/utils/FoodUtils";
import {Constants} from "../../../../core/Constants";
import {Constants} from "../../../../../../Lib/src/constants/Constants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Maps} from "../../../../core/maps/Maps";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {TravelTime} from "../../../../core/maps/TravelTime";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {MapLinkDataController} from "../../../../data/MapLink";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {PlayerMissionsInfos} from "../../../../core/database/game/models/PlayerMissionsInfo";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {PetEntities} from "../../../../core/database/game/models/PetEntity";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";

export const commandInfo: ITestCommand = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ExecuteTestCommandLike, ITestCommand} from "../../../../core/CommandsTest";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";

export const commandInfo: ITestCommand = {
name: "playerkill",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Maps} from "../../../../core/maps/Maps";
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand} from "../../../../core/CommandsTest";
import {TravelTime} from "../../../../core/maps/TravelTime";
import {MapLinkDataController} from "../../../../data/MapLink";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {TravelTime} from "../../../../core/maps/TravelTime";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import Player from "../../../../core/database/game/models/Player";
import {BlockingUtils} from "../../../../core/utils/BlockingUtils";
import {BlockingConstants} from "../../../../core/constants/BlockingConstants";
import {BlockingConstants} from "../../../../../../Lib/src/constants/BlockingConstants";

export const commandInfo: ITestCommand = {
name: "blockplayer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {EffectsConstants} from "../../../../../../Lib/src/constants/EffectsConstants";
import {TravelTime} from "../../../../core/maps/TravelTime";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand, TypeKey} from "../../../../core/CommandsTest";
import {EffectsConstants} from "../../../../../../Lib/src/constants/EffectsConstants";
import {TravelTime} from "../../../../core/maps/TravelTime";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberChangeReason} from "../../../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {ExecuteTestCommandLike, ITestCommand} from "../../../../core/CommandsTest";
import {TravelTime} from "../../../../core/maps/TravelTime";

Expand Down
4 changes: 2 additions & 2 deletions Core/src/commands/player/ProfileCommand.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {PetEntities} from "../../core/database/game/models/PetEntity";
import PlayerMissionsInfo, {PlayerMissionsInfos} from "../../core/database/game/models/PlayerMissionsInfo";
import {InventorySlots} from "../../core/database/game/models/InventorySlot";
import {FightConstants} from "../../core/constants/FightConstants";
import {FightConstants} from "../../../../Lib/src/constants/FightConstants";
import {packetHandler} from "../../core/packetHandlers/PacketHandler";
import {WebsocketClient} from "../../../../Lib/src/instances/WebsocketClient";
import {DraftBotPacket, makePacket, PacketContext} from "../../../../Lib/src/packets/DraftBotPacket";
import {CommandProfilePacketReq, CommandProfilePacketRes} from "../../../../Lib/src/packets/commands/CommandProfilePacket";
import {Campaign} from "../../core/missions/Campaign";
import {Players} from "../../core/database/game/models/Player";
import {Guilds} from "../../core/database/game/models/Guild";
import {Constants} from "../../core/Constants";
import {Constants} from "../../../../Lib/src/constants/Constants";
import {hoursToMilliseconds} from "../../../../Lib/src/utils/TimeUtils";
import {PetDataController} from "../../data/Pet";

Expand Down
12 changes: 6 additions & 6 deletions Core/src/commands/player/ReportCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import {Player, Players} from "../../core/database/game/models/Player";
import {EffectsConstants} from "../../../../Lib/src/constants/EffectsConstants";
import {Maps} from "../../core/maps/Maps";
import {MapLink, MapLinkDataController} from "../../data/MapLink";
import {Constants} from "../../core/Constants";
import {Constants} from "../../../../Lib/src/constants/Constants";
import {getTimeFromXHoursAgo, millisecondsToMinutes, millisecondsToSeconds} from "../../../../Lib/src/utils/TimeUtils";
import {BlockingUtils} from "../../core/utils/BlockingUtils";
import {BlockingConstants} from "../../core/constants/BlockingConstants";
import {BlockingConstants} from "../../../../Lib/src/constants/BlockingConstants";
import {MissionsController} from "../../core/missions/MissionsController";
import {FightController} from "../../core/fights/FightController";
import {PVEConstants} from "../../core/constants/PVEConstants";
import {PVEConstants} from "../../../../Lib/src/constants/PVEConstants";
import {MonsterDataController} from "../../data/Monster";
import {PlayerFighter} from "../../core/fights/fighter/PlayerFighter";
import {NumberChangeReason} from "../../core/constants/LogsConstants";
import {NumberChangeReason} from "../../../../Lib/src/constants/LogsConstants";
import {Guilds} from "../../core/database/game/models/Guild";
import {GuildConstants} from "../../core/constants/GuildConstants";
import {GuildConstants} from "../../../../Lib/src/constants/GuildConstants";
import {draftBotInstance} from "../../index";
import {MonsterFighter} from "../../core/fights/fighter/MonsterFighter";
import {EndCallback, ReactionCollectorInstance} from "../../core/utils/ReactionsCollector";
Expand All @@ -44,7 +44,7 @@ import {
import {MapCache} from "../../core/maps/MapCache";
import {TravelTime} from "../../core/maps/TravelTime";
import {SmallEventDataController, SmallEventFuncs} from "../../data/SmallEvent";
import {ReportConstants} from "../../core/constants/ReportConstants";
import {ReportConstants} from "../../../../Lib/src/constants/ReportConstants";
import {BigEvent, BigEventDataController} from "../../data/BigEvent";
import {
ReactionCollectorBigEvent,
Expand Down
2 changes: 1 addition & 1 deletion Core/src/core/bot/DraftBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PetEntity from "../database/game/models/PetEntity";
import {RandomUtils} from "../utils/RandomUtils";
import {PotionDataController} from "../../data/Potion";
import {getNextDay2AM} from "../../../../Lib/src/utils/TimeUtils";
import {TIMEOUT_FUNCTIONS} from "../constants/TimeoutFunctionsConstants";
import {TIMEOUT_FUNCTIONS} from "../../../../Lib/src/constants/TimeoutFunctionsConstants";
import {MapCache} from "../maps/MapCache";
import {registerAllPacketHandlers} from "../packetHandlers/PacketHandler";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {DataTypes, QueryInterface} from "sequelize";
import {EntityConstants} from "../../../constants/EntityConstants";
import {EntityConstants} from "../../../../../../Lib/src/constants/EntityConstants";
import {entitiesAttributes001} from "./001-initial-database";

export async function up({context}: { context: QueryInterface }): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {DataTypes, QueryInterface} from "sequelize";
import {FightConstants} from "../../../constants/FightConstants";
import {FightConstants} from "../../../../../../Lib/src/constants/FightConstants";

export const leaguesAttributes008 = {
id: {
Expand Down
2 changes: 1 addition & 1 deletion Core/src/core/database/game/models/Guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {DraftBotPacket} from "../../../../../../Lib/src/packets/DraftBotPacket";
import {GuildLevelUpPacket} from "../../../../../../Lib/src/packets/notifications/GuildLevelUpPacket";
import moment = require("moment");
import {TopConstants} from "../../../../../../Lib/src/constants/TopConstants";
import { Constants } from "../../../../../../Lib/src/Constants/Constants";
import { Constants } from "../../../../../../Lib/src/constants/Constants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {GuildConstants} from "../../../../../../Lib/src/constants/GuildConstants";
import {PetEntityConstants} from "../../../../../../Lib/src/constants/PetEntityConstants";
Expand Down
14 changes: 13 additions & 1 deletion Core/src/core/database/game/models/GuildPet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {DataTypes, Model, Sequelize} from "sequelize";
import {CreateOptions, DataTypes, Model, Sequelize} from "sequelize";
import PetEntity from "./PetEntity";
import Guild from "./Guild";
import {draftBotInstance} from "../../../../index";
Expand All @@ -16,6 +16,18 @@ export class GuildPet extends Model {
declare createdAt: Date;
}

// Todo: this needs to be moved
export type ModelType = { create: (values?: unknown, options?: CreateOptions<unknown>) => Promise<Model<unknown, unknown>> };

// Todo: moved the type below here from the constants; maybe somewhere else would be better ?
export type GuildLikeType = {
id: number,
name: string,
creationDate: Date,
chiefId: number,
guildPets: GuildPet[]
}

/**
* This class is used to information about pets that are in a shelter
*/
Expand Down
2 changes: 1 addition & 1 deletion Core/src/core/database/game/models/PetEntity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DataTypes, Model, QueryTypes, Sequelize} from "sequelize";
import {RandomUtils} from "../../../utils/RandomUtils";
import {MissionsController} from "../../../missions/MissionsController";
import {PET_ENTITY_GIVE_RETURN, PetEntityConstants} from "../../../constants/PetEntityConstants";
import {PET_ENTITY_GIVE_RETURN, PetEntityConstants} from "../../../../../../Lib/src/constants/PetEntityConstants";
import {Player, PlayerEditValueParameters} from "./Player";
import {PetConstants} from "../../../../../../Lib/src/constants/PetConstants";
import {Guild, Guilds} from "./Guild";
Expand Down
24 changes: 12 additions & 12 deletions Core/src/core/database/game/models/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,15 @@ import InventorySlot, {InventorySlots} from "./InventorySlot";
import PetEntity from "./PetEntity";
import MissionSlot from "./MissionSlot";
import {InventoryInfos} from "./InventoryInfo";
import {Constants} from "../../../Constants";
import {MissionsController} from "../../../missions/MissionsController";
import {PlayerActiveObjects} from "./PlayerActiveObjects";
import {NumberChangeReason} from "../../../constants/LogsConstants";
import {EffectsConstants} from "../../../../../../Lib/src/constants/EffectsConstants";
import {PlayersConstants} from "../../../constants/PlayersConstants";
import {InventoryConstants} from "../../../constants/InventoryConstants";
import {getOneDayAgo, millisecondsToSeconds, minutesToHours} from "../../../../../../Lib/src/utils/TimeUtils";
import {TravelTime} from "../../../maps/TravelTime";
import {EntityConstants} from "../../../constants/EntityConstants";
import {BlockingConstants} from "../../../constants/BlockingConstants";
import {GuildConstants} from "../../../constants/GuildConstants";
import {FightConstants} from "../../../constants/FightConstants";
import {ItemCategory} from "../../../../../../Lib/src/constants/ItemConstants";
import {Maps} from "../../../maps/Maps";
import {PVEConstants} from "../../../constants/PVEConstants";
import {MapConstants} from "../../../constants/MapConstants";
import {RandomUtils} from "../../../utils/RandomUtils";
import {LeagueInfoConstants} from "../../../constants/LeagueInfoConstants";
import {LogsReadRequests} from "../../logs/LogsReadRequests";
import {ClassInfoConstants} from "../../../constants/ClassInfoConstants";
import {PlayerSmallEvents} from "./PlayerSmallEvent";
import {Guilds} from "./Guild";
import {DraftBotPacket} from "../../../../../../Lib/src/packets/DraftBotPacket";
Expand All @@ -39,6 +27,18 @@ import {BlockingUtils} from "../../../utils/BlockingUtils";
import {League, LeagueDataController} from "../../../../data/League";
import moment = require("moment");
import {TopConstants} from "../../../../../../Lib/src/constants/TopConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {InventoryConstants} from "../../../../../../Lib/src/constants/InventoryConstants";
import { Constants } from "../../../../../../Lib/src/constants/Constants";
import {FightConstants} from "../../../../../../Lib/src/constants/FightConstants";
import {LeagueInfoConstants} from "../../../../../../Lib/src/constants/LeagueInfoConstants";
import {PVEConstants} from "../../../../../../Lib/src/constants/PVEConstants";
import {PlayersConstants} from "../../../../../../Lib/src/constants/PlayersConstants";
import {EntityConstants} from "../../../../../../Lib/src/constants/EntityConstants";
import {ClassInfoConstants} from "../../../../../../Lib/src/constants/ClassInfoConstants";
import {GuildConstants} from "../../../../../../Lib/src/constants/GuildConstants";
import {MapConstants} from "../../../../../../Lib/src/constants/MapConstants";
import {BlockingConstants} from "../../../../../../Lib/src/constants/BlockingConstants";

export type PlayerEditValueParameters = {
player: Player,
Expand Down
2 changes: 1 addition & 1 deletion Core/src/core/database/game/models/PlayerMissionsInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {DataTypes, Model, Sequelize} from "sequelize";
import {datesAreOnSameDay} from "../../../../../../Lib/src/utils/TimeUtils";
import {NumberChangeReason} from "../../../constants/LogsConstants";
import {NumberChangeReason} from "../../../../../../Lib/src/constants/LogsConstants";
import {draftBotInstance} from "../../../../index";
import {Campaign} from "../../../missions/Campaign";
import moment = require("moment");
Expand Down
Loading

0 comments on commit c46b8fb

Please sign in to comment.