Give types to all functions in OsuPacketWriter
This commit is contained in:
parent
39f6669f94
commit
5e1106e488
8 changed files with 84 additions and 25 deletions
5
server/interfaces/ChannelData.ts
Normal file
5
server/interfaces/ChannelData.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export default interface ChannelData {
|
||||
channelName: string,
|
||||
channelTopic: string,
|
||||
channelUserCount: number
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
import ChannelData from "./ChannelData"
|
||||
import MatchData from "./MatchData"
|
||||
import MatchScoreData from "./MatchScoreData"
|
||||
import MessageData from "./MessageData"
|
||||
import SpectateFramesData from "./SpectateFramesData"
|
||||
import StatusUpdateData from "./StatusUpdateData"
|
||||
import UserPresenceData from "./UserPresenceData"
|
||||
import UserQuitData from "./UserQuitData"
|
||||
|
||||
export default interface OsuPacketWriter {
|
||||
// Functions
|
||||
|
@ -9,36 +13,36 @@ export default interface OsuPacketWriter {
|
|||
CommandError() : OsuPacketWriter,
|
||||
SendMessage(data:MessageData) : OsuPacketWriter,
|
||||
Ping() : OsuPacketWriter,
|
||||
HandleIrcChangeUsername(data:any) : OsuPacketWriter,
|
||||
HandleIrcChangeUsername(data:string) : OsuPacketWriter,
|
||||
HandleIrcQuit() : OsuPacketWriter,
|
||||
HandleOsuUpdate(data:StatusUpdateData) : OsuPacketWriter,
|
||||
HandleUserQuit(data:any) : OsuPacketWriter,
|
||||
SpectatorJoined(data:any) : OsuPacketWriter,
|
||||
SpectatorLeft(data:any) : OsuPacketWriter,
|
||||
SpectateFrames(data:any) : OsuPacketWriter,
|
||||
HandleUserQuit(data:UserQuitData) : OsuPacketWriter,
|
||||
SpectatorJoined(data:number) : OsuPacketWriter,
|
||||
SpectatorLeft(data:number) : OsuPacketWriter,
|
||||
SpectateFrames(data:SpectateFramesData) : OsuPacketWriter,
|
||||
VersionUpdate() : OsuPacketWriter,
|
||||
SpectatorCantSpectate(data:any) : OsuPacketWriter,
|
||||
SpectatorCantSpectate(data:number) : OsuPacketWriter,
|
||||
GetAttention() : OsuPacketWriter,
|
||||
Announce(data:string) : OsuPacketWriter,
|
||||
MatchUpdate(data:MatchData) : OsuPacketWriter,
|
||||
MatchNew(data:MatchData) : OsuPacketWriter,
|
||||
MatchDisband(data:any) : OsuPacketWriter,
|
||||
MatchDisband(data:number) : OsuPacketWriter,
|
||||
MatchJoinSuccess(data:MatchData) : OsuPacketWriter,
|
||||
MatchJoinFail() : OsuPacketWriter,
|
||||
FellowSpectatorJoined(data:number) : OsuPacketWriter,
|
||||
FellowSpectatorLeft(data:number) : OsuPacketWriter,
|
||||
MatchStart(data:MatchData) : OsuPacketWriter,
|
||||
MatchScoreUpdate(data:MatchScoreData) : OsuPacketWriter,
|
||||
MatchTransferHost(data:any) : OsuPacketWriter,
|
||||
MatchTransferHost() : OsuPacketWriter,
|
||||
MatchAllPlayersLoaded() : OsuPacketWriter,
|
||||
MatchPlayerFailed(data:any) : OsuPacketWriter,
|
||||
MatchPlayerFailed(data:number) : OsuPacketWriter,
|
||||
MatchComplete() : OsuPacketWriter,
|
||||
MatchSkip() : OsuPacketWriter,
|
||||
Unauthorised() : OsuPacketWriter,
|
||||
ChannelJoinSuccess(data:any) : OsuPacketWriter,
|
||||
ChannelAvailable(data:any) : OsuPacketWriter,
|
||||
ChannelRevoked(data:any) : OsuPacketWriter,
|
||||
ChannelAvailableAutojoin(data:any) : OsuPacketWriter,
|
||||
ChannelJoinSuccess(data:string) : OsuPacketWriter,
|
||||
ChannelAvailable(data:ChannelData) : OsuPacketWriter,
|
||||
ChannelRevoked(data:string) : OsuPacketWriter,
|
||||
ChannelAvailableAutojoin(data:ChannelData) : OsuPacketWriter,
|
||||
BeatmapInfoReply() : OsuPacketWriter,
|
||||
LoginPermissions(data:number) : OsuPacketWriter,
|
||||
FriendsList(data:Array<number>) : OsuPacketWriter,
|
||||
|
@ -46,22 +50,22 @@ export default interface OsuPacketWriter {
|
|||
TitleUpdate(data:string) : OsuPacketWriter,
|
||||
Monitor() : OsuPacketWriter,
|
||||
MatchPlayerSkipped(data:number) : OsuPacketWriter,
|
||||
UserPresence(data:any) : OsuPacketWriter,
|
||||
UserPresence(data:UserPresenceData) : OsuPacketWriter,
|
||||
Restart(data:number) : OsuPacketWriter,
|
||||
Invite(data:any) : OsuPacketWriter,
|
||||
Invite(data:MessageData) : OsuPacketWriter,
|
||||
ChannelListingComplete() : OsuPacketWriter,
|
||||
MatchChangePassword(data:any) : OsuPacketWriter,
|
||||
BanInfo(data:any) : OsuPacketWriter,
|
||||
UserSilenced(data:any) : OsuPacketWriter,
|
||||
UserPresenceSingle(data:any) : OsuPacketWriter,
|
||||
UserPresenceBundle(data:any) : OsuPacketWriter,
|
||||
UserPMBlocked(data:any) : OsuPacketWriter,
|
||||
TargetIsSilenced(data:any) : OsuPacketWriter,
|
||||
MatchChangePassword(data:string) : OsuPacketWriter,
|
||||
BanInfo(data:number) : OsuPacketWriter,
|
||||
UserSilenced(data:number) : OsuPacketWriter,
|
||||
UserPresenceSingle(data:number) : OsuPacketWriter,
|
||||
UserPresenceBundle(data:Array<number>) : OsuPacketWriter,
|
||||
UserPMBlocked(data:MessageData) : OsuPacketWriter,
|
||||
TargetIsSilenced(data:MessageData) : OsuPacketWriter,
|
||||
VersionUpdateForced() : OsuPacketWriter,
|
||||
SwitchServer(data:any) : OsuPacketWriter,
|
||||
SwitchServer(data:number) : OsuPacketWriter,
|
||||
AccountRestricted() : OsuPacketWriter,
|
||||
RTX(data:string) : OsuPacketWriter,
|
||||
SwitchTourneyServer(data:any) : OsuPacketWriter
|
||||
SwitchTourneyServer(data:string) : OsuPacketWriter
|
||||
|
||||
toBuffer : Buffer
|
||||
}
|
7
server/interfaces/ReplayFrameData.ts
Normal file
7
server/interfaces/ReplayFrameData.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default interface ReplayFrameData {
|
||||
buttonState: number,
|
||||
bt: number,
|
||||
mouseX: number,
|
||||
mouseY: number,
|
||||
time: number
|
||||
}
|
17
server/interfaces/ScoreFrameData.ts
Normal file
17
server/interfaces/ScoreFrameData.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
export default interface ScoreFrameData {
|
||||
time: number,
|
||||
id: number,
|
||||
count300: number,
|
||||
count100: number,
|
||||
count50: number,
|
||||
countGeki: number,
|
||||
countKatu: number,
|
||||
countMiss: number,
|
||||
totalScore: number,
|
||||
maxCombo: number,
|
||||
currentCombo: number,
|
||||
perfect: boolean,
|
||||
currentHp: number,
|
||||
tagByte: number,
|
||||
usingScoreV2: boolean,
|
||||
}
|
10
server/interfaces/SpectateFramesData.ts
Normal file
10
server/interfaces/SpectateFramesData.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import MatchScoreData from "./MatchScoreData";
|
||||
import ReplayFrameData from "./ReplayFrameData";
|
||||
import ScoreFrameData from "./ScoreFrameData";
|
||||
|
||||
export default interface SpectateFramesData {
|
||||
extra: number,
|
||||
replayFrames: Array<ReplayFrameData>,
|
||||
action: number,
|
||||
scoreFrame: ScoreFrameData
|
||||
}
|
12
server/interfaces/UserPresenceData.ts
Normal file
12
server/interfaces/UserPresenceData.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Permissions } from "../enums/Permissions";
|
||||
|
||||
export default interface UserPresenceData {
|
||||
userId: number,
|
||||
username: string,
|
||||
timezone: number,
|
||||
countryId: number,
|
||||
permissions: Permissions,
|
||||
longitude: number,
|
||||
latitude: number,
|
||||
rank: number
|
||||
}
|
4
server/interfaces/UserQuitData.ts
Normal file
4
server/interfaces/UserQuitData.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default interface UserQuitData {
|
||||
userId: number,
|
||||
state: number
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { minify } from "terser";
|
||||
|
||||
const DISABLE = true;
|
||||
const DISABLE = false;
|
||||
writeFileSync("./build/.MANGLED", `${DISABLE}`);
|
||||
|
||||
if (DISABLE) {
|
||||
|
|
Loading…
Reference in a new issue