Page 1 of 1

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

Posted: Tue May 01, 2018 8:58 pm
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?

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

Posted: Wed May 02, 2018 2:30 am
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.