ConnectionRequestAcceptIfKey Method |
Accepts the connection if the first string in the
Data matches the provided key.
Namespace: LiteNetLibAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntaxpublic NetPeer AcceptIfKey(
string key
)
Parameters
- key String
- The required string key to match.
Return Value
NetPeerA new
LiteNetPeer if the key matches and connection is accepted; otherwise,
null.
Remarks
This is a helper method for simple password/key validation.
If the key does not match or data is invalid, the connection is automatically rejected.
See Also