-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimeLimitMod.cs
61 lines (41 loc) · 1.23 KB
/
TimeLimitMod.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.IO;
using ModLibsCore.Libraries.TModLoader.Mods;
using Terraria;
using Terraria.ModLoader;
using Terraria.UI;
using TimeLimit.Logic;
using TimeLimit.NetProtocol;
namespace TimeLimit {
partial class TimeLimitMod : Mod {
public static TimeLimitMod Instance { get; private set; }
////////////////
public TimeLimitConfig Config => ModContent.GetInstance<TimeLimitConfig>();
public ModLogic Logic = new ModLogic();
////////////////
public TimeLimitMod() {
TimeLimitMod.Instance = this;
}
public override void Load() {
}
public override void Unload() {
TimeLimitMod.Instance = null;
}
////////////////
public override object Call( params object[] args ) {
return ModBoilerplateLibraries.HandleModCall( typeof( TimeLimitAPI ), args );
}
////////////////
public override void HandlePacket( BinaryReader reader, int playerWho ) {
TimeLimitProtocolTypes protocol = (TimeLimitProtocolTypes)reader.ReadByte();
if( RequestPackets.HandlePacket( protocol, reader, playerWho ) ) {
return;
}
if( SendPackets.HandlePacket( protocol, reader ) ) {
return;
}
throw new InvalidOperationException( "Unrecognized packet" );
}
}
}