From 877592bb9470be4d38403af00dc2b18235f3f376 Mon Sep 17 00:00:00 2001 From: Holly Date: Fri, 6 Oct 2023 11:19:08 +0100 Subject: [PATCH] Move all packet interfaces to a better location --- server/BanchoServer.ts | 2 +- server/MultiplayerManager.ts | 4 ++-- server/SpectatorManager.ts | 2 +- server/interfaces/OsuPacketWriter.ts | 16 ++++++++-------- server/interfaces/PlayerScore.ts | 2 +- .../interfaces/{ => packetTypes}/ChannelData.ts | 0 server/interfaces/{ => packetTypes}/MatchData.ts | 0 .../{ => packetTypes}/MatchDataSlot.ts | 0 .../{ => packetTypes}/MatchJoinData.ts | 0 .../{ => packetTypes}/MatchStartSkipData.ts | 0 .../interfaces/{ => packetTypes}/MessageData.ts | 0 .../interfaces/{ => packetTypes}/PresenceData.ts | 0 .../{ => packetTypes}/ReplayFrameData.ts | 0 .../{ => packetTypes}/ScoreFrameData.ts | 0 .../{ => packetTypes}/SpectateFramesData.ts | 0 .../{ => packetTypes}/StatusUpdateData.ts | 0 .../{ => packetTypes}/UserPresenceData.ts | 2 +- .../interfaces/{ => packetTypes}/UserQuitData.ts | 0 server/objects/Match.ts | 6 +++--- server/objects/User.ts | 2 +- server/packets/ChangeAction.ts | 2 +- server/packets/PrivateMessage.ts | 2 +- server/packets/SendPublicMessage.ts | 2 +- 23 files changed, 21 insertions(+), 21 deletions(-) rename server/interfaces/{ => packetTypes}/ChannelData.ts (100%) rename server/interfaces/{ => packetTypes}/MatchData.ts (100%) rename server/interfaces/{ => packetTypes}/MatchDataSlot.ts (100%) rename server/interfaces/{ => packetTypes}/MatchJoinData.ts (100%) rename server/interfaces/{ => packetTypes}/MatchStartSkipData.ts (100%) rename server/interfaces/{ => packetTypes}/MessageData.ts (100%) rename server/interfaces/{ => packetTypes}/PresenceData.ts (100%) rename server/interfaces/{ => packetTypes}/ReplayFrameData.ts (100%) rename server/interfaces/{ => packetTypes}/ScoreFrameData.ts (100%) rename server/interfaces/{ => packetTypes}/SpectateFramesData.ts (100%) rename server/interfaces/{ => packetTypes}/StatusUpdateData.ts (100%) rename server/interfaces/{ => packetTypes}/UserPresenceData.ts (78%) rename server/interfaces/{ => packetTypes}/UserQuitData.ts (100%) diff --git a/server/BanchoServer.ts b/server/BanchoServer.ts index bc6c0c6..9cf41cc 100644 --- a/server/BanchoServer.ts +++ b/server/BanchoServer.ts @@ -5,7 +5,7 @@ import LoginProcess from "./LoginProcess"; import { IncomingMessage, ServerResponse } from "http"; import { Packets } from "./enums/Packets"; import { RedisClientType, createClient } from "redis"; -import MessageData from "./interfaces/MessageData"; +import MessageData from "./interfaces/packetTypes/MessageData"; import PrivateMessage from "./packets/PrivateMessage"; import Shared from "./objects/Shared"; import SpectatorManager from "./SpectatorManager"; diff --git a/server/MultiplayerManager.ts b/server/MultiplayerManager.ts index 488e837..e7aa01b 100644 --- a/server/MultiplayerManager.ts +++ b/server/MultiplayerManager.ts @@ -8,8 +8,8 @@ import StatusUpdate from "./packets/StatusUpdate"; import UserPresence from "./packets/UserPresence"; import UserPresenceBundle from "./packets/UserPresenceBundle"; import MatchArray from "./objects/MatchArray"; -import MatchJoinData from "./interfaces/MatchJoinData"; -import MatchData from "./interfaces/MatchData"; +import MatchJoinData from "./interfaces/packetTypes/MatchJoinData"; +import MatchData from "./interfaces/packetTypes/MatchData"; import osu from "../osuTyping"; import TourneyMatchSpecialInfo from "./packets/TourneyMatchSpecialInfo"; diff --git a/server/SpectatorManager.ts b/server/SpectatorManager.ts index 7d9eae1..69f6ceb 100644 --- a/server/SpectatorManager.ts +++ b/server/SpectatorManager.ts @@ -2,7 +2,7 @@ import DataStream from "./objects/DataStream"; import Shared from "./objects/Shared"; import User from "./objects/User"; import osu from "../osuTyping"; -import SpectateFramesData from "./interfaces/SpectateFramesData"; +import SpectateFramesData from "./interfaces/packetTypes/SpectateFramesData"; export default class SpectatorManager { private shared:Shared; diff --git a/server/interfaces/OsuPacketWriter.ts b/server/interfaces/OsuPacketWriter.ts index 21ffc63..a12c428 100644 --- a/server/interfaces/OsuPacketWriter.ts +++ b/server/interfaces/OsuPacketWriter.ts @@ -1,11 +1,11 @@ -import ChannelData from "./ChannelData" -import MatchData from "./MatchData" -import MessageData from "./MessageData" -import ScoreFrameData from "./ScoreFrameData" -import SpectateFramesData from "./SpectateFramesData" -import StatusUpdateData from "./StatusUpdateData" -import UserPresenceData from "./UserPresenceData" -import UserQuitData from "./UserQuitData" +import ChannelData from "./packetTypes/ChannelData" +import MatchData from "./packetTypes/MatchData" +import MessageData from "./packetTypes/MessageData" +import ScoreFrameData from "./packetTypes/ScoreFrameData" +import SpectateFramesData from "./packetTypes/SpectateFramesData" +import StatusUpdateData from "./packetTypes/StatusUpdateData" +import UserPresenceData from "./packetTypes/UserPresenceData" +import UserQuitData from "./packetTypes/UserQuitData" export default interface OsuPacketWriter { // Functions diff --git a/server/interfaces/PlayerScore.ts b/server/interfaces/PlayerScore.ts index 0dee2ee..b78f441 100644 --- a/server/interfaces/PlayerScore.ts +++ b/server/interfaces/PlayerScore.ts @@ -1,6 +1,6 @@ import Slot from "../objects/Slot"; import User from "../objects/User"; -import ScoreFrameData from "./ScoreFrameData"; +import ScoreFrameData from "./packetTypes/ScoreFrameData"; export default interface PlayerScore { player: User, diff --git a/server/interfaces/ChannelData.ts b/server/interfaces/packetTypes/ChannelData.ts similarity index 100% rename from server/interfaces/ChannelData.ts rename to server/interfaces/packetTypes/ChannelData.ts diff --git a/server/interfaces/MatchData.ts b/server/interfaces/packetTypes/MatchData.ts similarity index 100% rename from server/interfaces/MatchData.ts rename to server/interfaces/packetTypes/MatchData.ts diff --git a/server/interfaces/MatchDataSlot.ts b/server/interfaces/packetTypes/MatchDataSlot.ts similarity index 100% rename from server/interfaces/MatchDataSlot.ts rename to server/interfaces/packetTypes/MatchDataSlot.ts diff --git a/server/interfaces/MatchJoinData.ts b/server/interfaces/packetTypes/MatchJoinData.ts similarity index 100% rename from server/interfaces/MatchJoinData.ts rename to server/interfaces/packetTypes/MatchJoinData.ts diff --git a/server/interfaces/MatchStartSkipData.ts b/server/interfaces/packetTypes/MatchStartSkipData.ts similarity index 100% rename from server/interfaces/MatchStartSkipData.ts rename to server/interfaces/packetTypes/MatchStartSkipData.ts diff --git a/server/interfaces/MessageData.ts b/server/interfaces/packetTypes/MessageData.ts similarity index 100% rename from server/interfaces/MessageData.ts rename to server/interfaces/packetTypes/MessageData.ts diff --git a/server/interfaces/PresenceData.ts b/server/interfaces/packetTypes/PresenceData.ts similarity index 100% rename from server/interfaces/PresenceData.ts rename to server/interfaces/packetTypes/PresenceData.ts diff --git a/server/interfaces/ReplayFrameData.ts b/server/interfaces/packetTypes/ReplayFrameData.ts similarity index 100% rename from server/interfaces/ReplayFrameData.ts rename to server/interfaces/packetTypes/ReplayFrameData.ts diff --git a/server/interfaces/ScoreFrameData.ts b/server/interfaces/packetTypes/ScoreFrameData.ts similarity index 100% rename from server/interfaces/ScoreFrameData.ts rename to server/interfaces/packetTypes/ScoreFrameData.ts diff --git a/server/interfaces/SpectateFramesData.ts b/server/interfaces/packetTypes/SpectateFramesData.ts similarity index 100% rename from server/interfaces/SpectateFramesData.ts rename to server/interfaces/packetTypes/SpectateFramesData.ts diff --git a/server/interfaces/StatusUpdateData.ts b/server/interfaces/packetTypes/StatusUpdateData.ts similarity index 100% rename from server/interfaces/StatusUpdateData.ts rename to server/interfaces/packetTypes/StatusUpdateData.ts diff --git a/server/interfaces/UserPresenceData.ts b/server/interfaces/packetTypes/UserPresenceData.ts similarity index 78% rename from server/interfaces/UserPresenceData.ts rename to server/interfaces/packetTypes/UserPresenceData.ts index 0958374..a30a4d0 100644 --- a/server/interfaces/UserPresenceData.ts +++ b/server/interfaces/packetTypes/UserPresenceData.ts @@ -1,4 +1,4 @@ -import { Permissions } from "../enums/Permissions"; +import { Permissions } from "../../enums/Permissions"; export default interface UserPresenceData { userId: number, diff --git a/server/interfaces/UserQuitData.ts b/server/interfaces/packetTypes/UserQuitData.ts similarity index 100% rename from server/interfaces/UserQuitData.ts rename to server/interfaces/packetTypes/UserQuitData.ts diff --git a/server/objects/Match.ts b/server/objects/Match.ts index 420ffba..fa6cb2a 100644 --- a/server/objects/Match.ts +++ b/server/objects/Match.ts @@ -5,14 +5,14 @@ import Slot from "./Slot"; import User from "./User"; import StatusUpdate from "../packets/StatusUpdate"; import { SlotStatus } from "../enums/SlotStatus"; -import MatchData from "../interfaces/MatchData"; +import MatchData from "../interfaces/packetTypes/MatchData"; import { Team } from "../enums/Team"; -import MatchStartSkipData from "../interfaces/MatchStartSkipData"; +import MatchStartSkipData from "../interfaces/packetTypes/MatchStartSkipData"; import { Mods } from "../enums/Mods"; import PlayerScore from "../interfaces/PlayerScore"; import { enumHasFlag } from "../Util"; import osu from "../../osuTyping"; -import ScoreFrameData from "../interfaces/ScoreFrameData"; +import ScoreFrameData from "../interfaces/packetTypes/ScoreFrameData"; // Mods which need to be applied to the match during freemod. const matchFreemodGlobalMods:Array = [ diff --git a/server/objects/User.ts b/server/objects/User.ts index 8963527..7fe2cf8 100644 --- a/server/objects/User.ts +++ b/server/objects/User.ts @@ -6,7 +6,7 @@ import StatusUpdate from "../packets/StatusUpdate"; import Shared from "../objects/Shared"; import Slot from "./Slot"; import Channel from "./Channel"; -import PresenceData from "../interfaces/PresenceData"; +import PresenceData from "../interfaces/packetTypes/PresenceData"; import { Permissions } from "../enums/Permissions"; const rankingModes = [ diff --git a/server/packets/ChangeAction.ts b/server/packets/ChangeAction.ts index 40149e9..70bc114 100644 --- a/server/packets/ChangeAction.ts +++ b/server/packets/ChangeAction.ts @@ -1,4 +1,4 @@ -import PresenceData from "../interfaces/PresenceData"; +import PresenceData from "../interfaces/packetTypes/PresenceData"; import User from "../objects/User"; import StatusUpdate from "./StatusUpdate"; diff --git a/server/packets/PrivateMessage.ts b/server/packets/PrivateMessage.ts index 69b3d78..fe84a4c 100644 --- a/server/packets/PrivateMessage.ts +++ b/server/packets/PrivateMessage.ts @@ -1,4 +1,4 @@ -import MessageData from "../interfaces/MessageData"; +import MessageData from "../interfaces/packetTypes/MessageData"; import Shared from "../objects/Shared"; import PrivateChannel from "../objects/PrivateChannel"; import User from "../objects/User"; diff --git a/server/packets/SendPublicMessage.ts b/server/packets/SendPublicMessage.ts index 9a6c99d..98ceee1 100644 --- a/server/packets/SendPublicMessage.ts +++ b/server/packets/SendPublicMessage.ts @@ -1,5 +1,5 @@ import { Channel } from "diagnostics_channel"; -import MessageData from "../interfaces/MessageData"; +import MessageData from "../interfaces/packetTypes/MessageData"; import User from "../objects/User"; export default function SendPublicMessage(user:User, message:MessageData) {