How to get a player's Nexgen ID via UScript?

Discussions about Coding and Scripting
nullbyte
Novice
Posts: 27
Joined: Sat Sep 03, 2016 3:40 am

How to get a player's Nexgen ID via UScript?

Post by nullbyte »

Hi all

I use Nexgen on my server and I would like to get the Nexgen ID of a PlayerPawn in UScript.

I tried many things including accessing Nexgen class directly but I can't figure it out.

Does anyone know how to get this, please?
User avatar
Barbie
Godlike
Posts: 2536
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: How to get a player's Nexgen ID via UScript?

Post by Barbie »

I always wanted to do the same but have not tested it yet. So the following is only an assumption.

Have a look at NexgenPlayerInfo (version 112 here):

Code: Select all

class NexgenPlayerInfo extends Info;

var NexgenPlayerInfo nextPlayer;                  // Next player in the linked list.

var int playerNum;                                // Player num.
var string playerName;                            // Name used by the player.
var string playerTitle;                           // Title of the players account.
var string ipAddress;                             // IP Address.
var string clientID;                              // Client identification code.
...
This record connects the playerNum with the clientID. You can iterate over all Class'NexgenPlayerInfo' to get the clientID for a specific playerNum.

Another approach is to use the function getClientByNum of NexgenController:

Code: Select all

class NexgenController extends Mutator config(Nexgen);
...
/***************************************************************************************************
 *  $DESCRIPTION  Locates the NexgenClient instance for the given player code.
 *  $PARAM        playerNum  The player code of the client handler instance that is to be found.
 *  $REQUIRE      playerNum >= 0
 *  $RETURN       The client handler for the given player code.
 *  $ENSURE       (result != none ? result.playerNum == playerNum : true)
 **************************************************************************************************/
function NexgenClient getClientByNum(int playerNum) {
...
NexgenClient also has the playerID.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett