protected virtual void MassSetMode(HandlerMode mode) { foreach (var gizmo in AffectedGizmos) { gizmo.comp.Mode = mode; } }
public static void Enable(HandlerMode mode) { _exitOnFailure = mode == HandlerMode.ExitApplication || mode == HandlerMode.ExitAndRestart; _restartOnFailure = mode == HandlerMode.ExitAndRestart; //Application.SetUnhandledExceptionMode(_exitOnFailure ? UnhandledExceptionMode.ThrowException : UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; }
public PacketHandler(string host, int port, HandlerMode mode) { Mode = mode; _tcp = new TcpClient(host, port); _stream = new NetworkStreamMC(_tcp.GetStream()); _packetHandler = new Thread(Worker) { Name = "SC#PacketHandler", IsBackground = true }; _packetHandler.Start(); }
public static PacketBase TagFromId(Packet id, HandlerMode mode) { if (mode == HandlerMode.Client) { if (!ClientPackets.ContainsKey(id)) { throw new NotImplementedException(string.Format("Invalid client packet 0x{0:X2}", (byte)id)); } return ClientPackets[id](); } if (!ServerPackets.ContainsKey(id)) { throw new NotImplementedException(string.Format("Invalid server packet 0x{0:X2}", (byte)id)); } return ServerPackets[id](); }
public static string Label(this HandlerMode mode) => $"Fluffy.AnimalTab.HandlerMode.{mode}".Translate();
public HandlerItem(Type type, object handler, HandlerMode mode) { Type = type; Handler = handler; Mode = mode; }
public void Register <T>(IConsumerOf <T> handler, HandlerMode mode) where T : Message { _handlers.Add(new KeyValuePair <Type, HandlerItem>(typeof(IConsumerOf <T>), new HandlerItem(typeof(T), handler, mode))); }