-
Notifications
You must be signed in to change notification settings - Fork 10
/
CWRNetWork.cs
36 lines (33 loc) · 1.07 KB
/
CWRNetWork.cs
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
using CalamityOverhaul.Content;
using CalamityOverhaul.Content.Events;
using CalamityOverhaul.Content.NPCs.Core;
using System.IO;
using Terraria.ModLoader;
namespace CalamityOverhaul
{
public enum CWRMessageType : byte
{
TungstenRiot,
OverBeatBack,
NPCOverrideAI,
NPCOverrideOtherAI,
}
public class CWRNetWork : ICWRLoader
{
public static void HandlePacket(Mod mod, BinaryReader reader, int whoAmI) {
CWRMessageType type = (CWRMessageType)reader.ReadByte();
if (type == CWRMessageType.TungstenRiot) {
TungstenRiot.EventNetWorkReceive(reader, whoAmI);
}
else if (type == CWRMessageType.OverBeatBack) {
CWRNpc.OtherBeatBackReceive(reader, whoAmI);
}
else if (type == CWRMessageType.NPCOverrideAI) {
NPCOverride.NetAIReceive(reader);
}
else if (type == CWRMessageType.NPCOverrideOtherAI) {
NPCOverride.OtherNetWorkReceiveHander(reader);
}
}
}
}