Skip to content

OnRconConnection

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnRconConnection( System.Net.IPAddress ClientIpAddress )
{
    Puts( "OnRconConnection works!" );
    return null;
}
csharp
private object OnRconConnection( System.Net.IPAddress Address )
{
    Puts( "OnRconConnection works!" );
    return null;
}

Location

  • Facepunch.Rcon.Listener/<>c__DisplayClass30_0::<Start>b__0(Fleck.IWebSocketConnection socket)
  • Facepunch.RCon/RConListener::ProcessConnections()
csharp
//---
			Debug.Log($"RCON: CRITICAL - Banned IP {CS$<>8__locals55.address} supplied the correct password. Access was still denied.");
		}
		CS$<>8__locals55.socket.Close();
		return;
	}
	if (Interface.CallHook("OnRconConnection", socket.ConnectionInfo.ClientIpAddress) == null)
	{
		if (!(CS$<>8__locals55.socket.ConnectionInfo.Path != requiredPath))
		{
			CS$<>8__locals55.id = Interlocked.Increment(ref <>4__this.nextClientId);
			CS$<>8__locals55.ipString = CS$<>8__locals55.address.ToString();
//---
csharp
//---
	}
	Socket socket = server.AcceptSocket();
	if (socket != null)
	{
		IPEndPoint iPEndPoint = socket.RemoteEndPoint as IPEndPoint;
		if (Interface.CallHook("OnRconConnection", iPEndPoint.Address) != null)
		{
			socket.Close();
		}
		else if (IsBanned(iPEndPoint.Address))
		{
//---

Released under the MIT License.