IncomingConnection: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "{{ServersideJsEvent}} __TOC__ This event is triggered when an player establishes a connection with the server before loading the resources. {{JSContainer| {{Parameters}} *...")
 
No edit summary
 
Line 11: Line 11:
* '''rgscName''': {{RageType|String}} - player's social club username.
* '''rgscName''': {{RageType|String}} - player's social club username.
* '''rgscId''': {{RageType|String}} - player's social club ID.
* '''rgscId''': {{RageType|String}} - player's social club ID.
* '''gameType''': {{RageType|String}} - game types:
**''steam''
**''rgsc''
**''egs''


{{Example}}
{{Example}}
Line 16: Line 20:
const rgscIdBlackList = [123];
const rgscIdBlackList = [123];


mp.events.add('incomingConnection', (ip, serial, rgscName, rgscId) => { // This event checks whether the specified social club ID (123) or social club username includes (kemperrr), therefore, cancels connection on match.   
mp.events.add('incomingConnection', (ip, serial, rgscName, rgscId, gameType) => { // This event checks whether the specified social club ID (123) or social club username includes (kemperrr), therefore, cancels connection on match.   
     return rgscIdBlackList.includes(rgscId) || rgscName.includes('kemperrr');
     return rgscIdBlackList.includes(rgscId) || rgscName.includes('kemperrr');
});
});

Latest revision as of 19:55, 17 August 2020

Server-Side
Event

 JavaScript



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

JavaScript Syntax

Parameters

  • ip: String - player's IP
  • serial: String - player's serial
  • rgscName: String - player's social club username.
  • rgscId: String - player's social club ID.
  • gameType: String - game types:
    • steam
    • rgsc
    • egs

Example

const rgscIdBlackList = [123];

mp.events.add('incomingConnection', (ip, serial, rgscName, rgscId, gameType) => { // This event checks whether the specified social club ID (123) or social club username includes (kemperrr), therefore, cancels connection on match.  
    return rgscIdBlackList.includes(rgscId) || rgscName.includes('kemperrr');
});


See also