コード例 #1
0
                public JuicedWebSocketBehavior(JuicedRemoteConsole parent, JuicedRconConfig.Profile profile)
                {
                    this.parent = parent;
                    Profile     = profile;

                    IgnoreExtensions = true;
                }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
        /// <summary>
        /// Disable is the logic for disabling the plugin
        /// </summary>
        private void Disable()
        {
            Application.logMessageReceived -= HandleLog;

            if (rcon == null)
            {
                return;
            }

            rcon.Stop();
            rcon = null;
        }
コード例 #4
0
        /// <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
            });
        }