Description

SBNGProtectPlayerName is an addon for Nexgen and denies a login for a player, if his name is reserved for another player. In this case the player gets the message, that he must use another name, because this one is reserved.
dialog window 'Failed to login'
The name reservation is done by connecting a player's with his Nexgen ClientID. The ClientID is managed by Nexgen and is a worldwide unique ID that identifies an UT installation. See ProtectionInfos for details.

Installation

Put the files from archiv's SYSTEM folder into the SYSTEM folder of your servers's UT installation. You may or may not do the same for the HELP folder. The SOURCECODE folder is for your pleasure only.

Add SBNGProtectPlayerName for example as mutator or as a ServerActor. Example:
File UnrealTournament.ini
[Engine.GameEngine]
ServerActors=SBNGProtectPlayerNameV0.SBNGProtectPlayerName
Make sure that it is started after Nexgen.

It is not intended to send to clients, so don't make an entry in ServerPackages for it.

Then adjust the settings in the INI file to your needs.

SBNGProtectPlayerName ini file

Default SBNGProtectPlayerName.ini file
  [SBNGProtectPlayerNameV0.SBNGProtectPlayerName]
  bDebuglog=false
  bSpawnProtectPlayerNameInfo=false
  ProtectPlayerNameInfoSpawnedEvent="ProtectPlayerNameInfoSpawned"
  MutateCmd_ProtectionState="Sponsorship"
  MutateProtectionMsg_Active="Your name protection is valid until %YYYY%-%MM%-%DD% (format YYYY-MM-DD)"
  MutateProtectionMsg_Inactive="Your name protection has run out at %YYYY%-%MM%-%DD% (format YYYY-MM-DD)"
  MutateProtectionMsg_None="You don't have a name protection"

  ProtectionInfos[0]=(PlayerName="Administrator",EndDate=99999999,NexgenClientID="")
  ProtectionInfos[1]=(PlayerName="Admin",EndDate=99999999,NexgenClientID="")
  ProtectionInfos[2]=(PlayerName="root",EndDate=99999999,NexgenClientID="")
Some settings can be done in the INI file:
bDebuglog
If TRUE, the content of the array ProtectionInfos and some other is written to the log file at startup. With this you can check the correct settings of the member fields.
FALSE turns this off.
Default value is FALSE.
bSpawnProtectPlayerNameInfo
In order to provide the protection info to other components, the Actor ProtectPlayerNameInfo can be spawned when a player with a given ClientID has joined. See class'ProtectPlayerNameInfo' for details.
Valid values: TRUE or FALSE, default is FALSE.
ProtectPlayerNameInfoSpawnedEvent
If bSpawnProtectPlayerNameInfo is TRUE, this Event is risen when a ProtectPlayerNameInfo is spawned.
The value must be an UScript name or an empty string to disable the event.
MutateCmd_ProtectionState
Players can use this MUTATE command to gain their protection status. The default mutate command is Sponsorship.
The following messages are shown then in player's console:

MutateProtectionMsg_Active
Shown when protection is active. Default: Your name protection is valid until %YYYY%-%MM%-%DD% (format YYYY-MM-DD)
MutateProtectionMsg_Inactive
Shown when protection is not active any more. Default: Your name protection has run out at %YYYY%-%MM%-%DD% (format YYYY-MM-DD)
MutateProtectionMsg_None
Shown when player's ClientID is not in list. Default: You don't have a name protection

Within the message you can use format characters for the end date (don't use lower case):
YYYY: The year with four digits.
M: Month with digits.
MM: The month with always two digits (in case of one month digit a leading zero is added).
D: Day with digits.
DD: (Same as MM, but for day.)

ProtectionInfos
The connection between a player's name and Nexgen's ClientID is done with an array ProtectionInfos with 256 members maximum. You may leave gaps in the list; the order of members is irrelevant.
A member consists of the following fields:
PlayerName
Obviously the name that should be protected. Upper or lower case does not matter.
The names "Administrator", "Admin" and "root" are predefined with an empty ClientID so that no login is possible with one of these names.
EndDate
After this date the name is not protected any more. The format of the date is YYYYMMDD (YYYY=year with 4 digits, MM=month with 2 digits, DD=day with 2 digits). Use a high value for a so to say endless duration (e.g. "99999999").
NexgenClientID
The Nexgen Client ID of this player without the hyphens. You can find it in server's log. Example:
          Join succeeded: Barbie
          [NSC-SYS] Login request for Barbie
          [NSC-SYS] IP       = 192.168.1.11
          [NSC-SYS] ClientID = 12345678-90AB-CDEF-1234-567890ABCEDF
          [NSC-SYS] Login accepted.
        
If you leave the ClientID empty, a login with that assigned name will not be possible.

About

Author: Barbie
Contact: SeriousBarbie AT Barbies DOT World
Latest Version: 0

Copyright/Permission

No copyright claimed. Do with it whatever you want.

Changelog

Version 0

First release 2022-09-30

Filelist

NameSizeDateMD5 sum
./Help/SBNGProtectPlayerName.htm80412022-09-30(this file)
./Help/SBNGProtectPlayerName.jpg320952022-09-1813ff749536bf913516e406484375ca17
./Sourcecode/Classes/ProtectPlayerNameInfo.uc1542022-09-29016efb03f6e854cd4933a806ee4889f7
./Sourcecode/Classes/SBNGProtectPlayerName.uc123932022-09-18175048883363515c41f708189b2778a7
./Sourcecode/make.ini3312022-09-18a23f24924411e954e912e0cb948a1935
./Sourcecode/readme.txt692016-01-0965e1642a4cd5f397e424d0521cca2d42
./System/SBNGProtectPlayerName.ini7012022-09-30fdd7715d714b664a287f9e3dd0fb9b83
./System/SBNGProtectPlayerNameV0.u228872022-09-28a945f0aace78cee52109f195ee63d48b