Convert UniqueNetId hex values in Unrealscript

I’m currently working with Steam sockets to expand on the networking support for my game.

When I retrieve the unique id of the current server, i get it back as a UniqueNetId type.

When I convert this value to a string using:



class'OnlineSubsystem'.static.UniqueNetIdToString(serverUID)


I get a hex value (like this: 0x01402E4FDF81F007). When I put this through a hex-to-decimal converter, I get the expected int value.

But how can i do this in unrealscript?

Thanks in advance.

I created a simple function to do the hex to a string of the base 10 conversion:

The problem is, I can’t keep total of the value using an integer due to it’s max value of 2147483647. And I can’t total it using a float due to the minor inaccuracy of the floating point compounding.

I’m surprised I’m having this much trouble figuring this out. Any help would be much appreciated.

Finally found in OnlineSubsystemSteamworks:



/**
 * Converts the specified UID, into a string representing a 64bit int
 * NOTE: Primarily for use with 'open Steam.#', when P2P sockets are enabled
 *
 * @param UID        The players UID
 * @result        The string representation of the 64bit integer, made from the UID
 */
native function string UniqueNetIdToInt64(const out UniqueNetId UID);