forked from Bitcoindefi/OpenAO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandleIncomingGamePacket.ts
More file actions
40 lines (34 loc) · 1.02 KB
/
Copy pathhandleIncomingGamePacket.ts
File metadata and controls
40 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { handleIncomingAdminPacket } from "./incomingAdminPackets";
import { handleIncomingCharacterPacket } from "./incomingCharacterPackets";
import type {
IncomingPacketHandlerArgs,
IncomingPacketHandlerContext,
} from "./incomingPacketTypes";
import { handleIncomingUiPacket } from "./incomingUiPackets";
import { handleIncomingWorldPacket } from "./incomingWorldPackets";
export type { IncomingPacketHandlerContext } from "./incomingPacketTypes";
export async function handleIncomingGamePacket(
packet: any,
engine: any,
renderedMapNumber: number,
ctx: IncomingPacketHandlerContext,
): Promise<void> {
const args: IncomingPacketHandlerArgs = {
packet,
engine,
renderedMapNumber,
ctx,
};
if (await handleIncomingCharacterPacket(args)) {
return;
}
if (await handleIncomingWorldPacket(args)) {
return;
}
if (await handleIncomingAdminPacket(args)) {
return;
}
if (await handleIncomingUiPacket(args)) {
return;
}
}