-
Notifications
You must be signed in to change notification settings - Fork 2
/
TrackJunctionWindow.cs
36 lines (30 loc) · 1.09 KB
/
TrackJunctionWindow.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 System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class TrackJunctionWindow
{
public const string InterfaceName = "steveman0.TrackJunctionWindow";
public const string InterfaceResetJunction = "ResetJunction";
public static void ResetJunction(FreightTrackJunction junction)
{
junction.ResetJunction();
if (!WorldScript.mbIsServer)
NetworkManager.instance.SendInterfaceCommand(InterfaceName, InterfaceResetJunction, null, null, junction, 0f);
}
public static NetworkInterfaceResponse HandleNetworkCommand(Player player, NetworkInterfaceCommand nic)
{
FreightTrackJunction junction = nic.target as FreightTrackJunction;
string command = nic.command;
if (command != null)
{
if (command == InterfaceResetJunction)
TrackJunctionWindow.ResetJunction(junction);
}
return new NetworkInterfaceResponse
{
entity = junction,
inventory = player.mInventory
};
}
}