OnPlayerIncomingConnection: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Warning|This feature is currently unavailable in the current branch of Rage Multiplayer. This feature will be available in 1.0.}}
This event is triggered when an player establishes a connection with the server before loading the resources.
This event is triggered when an player establishes a connection with the server before loading the resources.


Line 14: Line 12:
*'''rgscName:''' parameter input should be in '''string''' type
*'''rgscName:''' parameter input should be in '''string''' type
*'''rgscId:''' parameter input should be in '''ulong''' type
*'''rgscId:''' parameter input should be in '''ulong''' type
*'''gameType:''' parameter input should be in '''GameTypes''' type
*'''cancel:''' parameter input should be in '''CancelEventArgs''' type
*'''cancel:''' parameter input should be in '''CancelEventArgs''' type


Line 19: Line 18:
{{#tag:syntaxhighlight|
{{#tag:syntaxhighlight|
[ServerEvent(Event.IncomingConnection)]
[ServerEvent(Event.IncomingConnection)]
public void OnIncomingConnection(string ip, string serial, string rgscName, ulong rgscId, CancelEventArgs cancel)
public void OnIncomingConnection(string ip, string serial, string rgscName, ulong rgscId, GameTypes gameType, CancelEventArgs cancel)
{
{
NAPI.Util.ConsoleOutput($"Connecting: {rgscName} - {ip} - {serial} - {rgscId}");
NAPI.Util.ConsoleOutput($"Connecting: {rgscName} - {ip} - {serial} - {rgscId} - {gameType}");
}
}
|lang=csharp}}
|lang=csharp}}

Latest revision as of 15:06, 23 December 2022

This event is triggered when an player establishes a connection with the server before loading the resources.


C# Syntax

[ServerEvent(Event.IncomingConnection)]

Parameters

  • ip: parameter input should be in string type
  • serial: parameter input should be in string type
  • rgscName: parameter input should be in string type
  • rgscId: parameter input should be in ulong type
  • gameType: parameter input should be in GameTypes type
  • cancel: parameter input should be in CancelEventArgs type

Example

[ServerEvent(Event.IncomingConnection)]
public void OnIncomingConnection(string ip, string serial, string rgscName, ulong rgscId, GameTypes gameType, CancelEventArgs cancel)
{
	NAPI.Util.ConsoleOutput($"Connecting: {rgscName} - {ip} - {serial} - {rgscId} - {gameType}");
}