Class ClientNamingSystem
The ClientNamingSystem class is responsible for managing the mapping between character and object IDs and their corresponding names in the FishMMO game client. It handles the registration and unregistration of naming broadcasts, as well as the storage and retrieval of name-ID mappings.
public static class ClientNamingSystem
- Inheritance
-
ClientNamingSystem
- Inherited Members
Methods
Destroy()
Cleans up the naming system, unregisters broadcast handlers, and saves cached names to disk (outside Unity Editor).
public static void Destroy()
GetCharacterID(string, Action<long>)
Gets the character ID for a given name. If not cached, requests it from the server and invokes the callback when available.
public static void GetCharacterID(string name, Action<long> action)
Parameters
namestringThe character name to resolve to an ID.
actionAction<long>Callback to invoke with the resolved ID.
Initialize(Client)
Initializes the naming system, registers broadcast handlers, and loads cached names from disk (outside Unity Editor).
public static void Initialize(Client client)
Parameters
clientClientThe client instance to use for network operations.
SetName(NamingSystemType, long, Action<string>)
Checks if the name matching the ID and type is known. If not, requests it from the server and invokes the callback when available. Values learned this way are saved to disk when the game closes and loaded when the game loads.
public static void SetName(NamingSystemType type, long id, Action<string> action)
Parameters
typeNamingSystemTypeThe naming system type.
idlongThe unique ID to resolve to a name.
actionAction<string>Callback to invoke with the resolved name.