From 010f9ac414a8ebe98c66d520f266ebd1a9a9c52c Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Wed, 12 Jan 2022 02:10:29 +0700 Subject: [PATCH] Add `GetOriginalName()` method to `EPlayer` --- sources/Players/EPlayer.uc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sources/Players/EPlayer.uc b/sources/Players/EPlayer.uc index b098478..fb65b09 100644 --- a/sources/Players/EPlayer.uc +++ b/sources/Players/EPlayer.uc @@ -219,6 +219,21 @@ public final function User GetIdentity() return identity; } +/** + * Returns player's original name - the one he joined the game with. + * + * @return `Text` containing original name of the caller player. + * Guaranteed to not be `none`. + */ +public final function Text GetOriginalName() +{ + local ConnectionService service; + local ConnectionService.Connection myConnection; + service = ConnectionService(class'ConnectionService'.static.Require()); + myConnection = service.GetConnection(GetController()); + return _.text.FromString(myConnection.originalName); +} + /** * Returns current displayed name of the caller player. *