public JuicedWebSocketBehavior(JuicedRemoteConsole parent, JuicedRconConfig.Profile profile) { this.parent = parent; Profile = profile; IgnoreExtensions = true; }
/// <summary> /// Enable is the logic for enabling the plugin /// </summary> private void Enable() { // handler for all log messages received in Oxide Application.logMessageReceived += HandleLog; rcon = new JuicedRemoteConsole(this); rcon.Start(); }
/// <summary> /// Disable is the logic for disabling the plugin /// </summary> private void Disable() { Application.logMessageReceived -= HandleLog; if (rcon == null) { return; } rcon.Stop(); rcon = null; }
/// <summary> /// HandleLog is the handler for all received log messages /// </summary> /// <param name="message"></param> /// <param name="stackTrace"></param> /// <param name="type"></param> private static void HandleLog(string message, string stackTrace, LogType type) { if (string.IsNullOrEmpty(message)) { return; } var remoteType = RemoteMessageType.Generic; if (RemoteMessageType.IsChat(message)) { remoteType = RemoteMessageType.Chat; } JuicedRemoteConsole.Broadcast(new RemoteMessage { Message = message, Identifier = -1, Type = remoteType, Stacktrace = stackTrace }); }