public JuicedRemoteConsole(JuicedRcon parent) { this.parent = parent; rootProfile = JuicedRconConfig.Profile.CreateRootProfile(); port = Interface.Oxide.Config.Rcon.Port; commands = new Dictionary <string, Func <string[], string> > { { CommandType.CommandJuicedRconEnable, (args) => parent.EnableCommand(args) }, { CommandType.CommandJuicedRconDisable, (args) => parent.DisableCommand(args) }, { CommandType.CommandJuicedRconProfile, (args) => parent.ProfileCommand(args) } }; }
/// <summary> /// OnOpen triggers when a new RCON session is established /// </summary> protected override void OnOpen() { _address = Context.UserEndPoint.Address; JuicedRcon.Log(LogType.Log, $"Established rcon connection {Profile?.DisplayName}[{_address}]"); }
/// <summary> /// OnError triggers when an RCON session has an error /// </summary> /// <param name="e"></param> protected override void OnError(ErrorEventArgs e) { JuicedRcon.Log(LogType.Exception, $"An exception has occurred: {e.Message}"); }
/// <summary> /// OnClose triggers when an RCON session is closed /// </summary> /// <param name="e"></param> protected override void OnClose(CloseEventArgs e) { JuicedRcon.Log(LogType.Log, $"Closed rcon connection {Profile?.DisplayName}[{_address}]"); }