public static void GetNetworkStatus(int networkindex, Player player) { if (networkindex == -1 || FreightCartManager.instance == null || FreightCartManager.instance.Networks == null) { return; } int count = FreightCartManager.instance.Networks.Count; if (networkindex >= count && count > 0) { networkindex = 0; } else if (networkindex >= count) { return; } string networkid = FreightCartManager.instance.Networks[networkindex]; NetworkStatusWrapper wrapper = new NetworkStatusWrapper(FreightCartManager.instance.GetNetworkRegistries(networkid), networkid); // Server is local player making request if (player == WorldScript.mLocalPlayer) { NetworkStatus = wrapper; return; } ModManager.ModSendServerCommToClient("steveman0.NetworkStatus", player, wrapper); }
public static void ReadNetworkStatus(NetIncomingMessage message) { NetworkStatusWrapper wrapper = new NetworkStatusWrapper(); wrapper.Read(message); NetworkStatus = wrapper; SystemMonitorWindow.networkredraw = true; }