IStringTable
Interface IStringTable
Namespace: SwiftlyS2.Shared.StringTable
Assembly: SwiftlyS2.CS2.dll
public interface IStringTableProperties
NumStrings
Gets the number of strings in the string table.
int NumStrings { get; }TableId
Gets the ID of the string table.
int TableId { get; }TableName
Gets the name of the string table.
string TableName { get; }Methods
FindStringIndex(string)
Finds the index of the specified string in the string table.
int? FindStringIndex(string str)- str string — The string to find the index of.
- int? — The index of the string, or null if the string is not found.
GetOrAddString(string)
Gets the index of the specified string in the string table, or adds it if it does not exist.
int GetOrAddString(string str)- str string — The string to get or add.
- int — The index of the string, or new index if the string is not found and added.
GetString(int)
Gets the string at the specified index.
string? GetString(int index)- index int — The index to get the string from.
- string? — The string at the specified index, or null if the index is invalid.
GetStringUserData(int)
Gets the user data for the specified index.
StringTableOutUserData GetStringUserData(int index)- index int — The index to get the user data from.
- StringTableOutUserData — The user data, or invalid if the index is invalid.
GetStringUserData(string)
Gets the user data for the specified string.
StringTableOutUserData GetStringUserData(string str)- str string — The string to get the user data for.
- StringTableOutUserData — The user data, or invalid if the string is not found.
IsStringIndexValid(int)
Checks if the specified index is valid.
bool IsStringIndexValid(int index)- index int — The index to check.
- bool — True if the index is valid, false otherwise.
ReplicateUserData(int, StringTableUserData, in CRecipientFilter)
Replicates the user data for the specified string to the specified recipients.
void ReplicateUserData(int stringIndex, StringTableUserData userData, in CRecipientFilter filter)- stringIndex int — The index of the string to replicate the user data for.
- userData StringTableUserData — The user data to replicate.
- filter CRecipientFilter — The recipients to replicate the user data to.
ReplicateUserData(string, StringTableUserData, in CRecipientFilter)
Replicates the user data for the specified string to the specified recipients. Notice that the string MUST be already added to the string table BEFORE A FEW TICKS. If the string is not added, the replication will fail. If the string is added only 1-2 ticks ago before this call, the server will overwrites the replicated value.
void ReplicateUserData(string str, StringTableUserData userData, in CRecipientFilter filter)- str string — The string to replicate the user data for.
- userData StringTableUserData — The user data to replicate.
- filter CRecipientFilter — The recipients to replicate the user data to.
- ArgumentException — Thrown if the string is not found in the string table.
SetOrAddStringUserData(string, StringTableUserData, bool)
Sets the user data for the specified string, or adds the string and set if it does not exist.
bool SetOrAddStringUserData(string str, StringTableUserData userData, bool forceOverride = true)- str string — The string to set the user data for.
- userData StringTableUserData — The user data to set.
- forceOverride bool — Whether to override the user data if it already exists.
- bool — True if the user data was successfully set or added, false otherwise.
SetStringUserData(int, StringTableUserData, bool)
Sets the user data for the specified index.
bool SetStringUserData(int index, StringTableUserData userData, bool forceOverride = true)- index int — The index to set the user data for.
- userData StringTableUserData — The user data to set.
- forceOverride bool — Whether to override the user data if it already exists.
- bool — True if the user data was successfully set, false otherwise.
- ArgumentException — Thrown if the index is invalid.
SetStringUserData(string, StringTableUserData, bool)
Sets the user data for the specified string.
bool SetStringUserData(string str, StringTableUserData userData, bool forceOverride = true)- str string — The string to set the user data for.
- userData StringTableUserData — The user data to set.
- forceOverride bool — Whether to override the user data if it already exists.
- bool — True if the user data was successfully set, false otherwise.
- ArgumentException — Thrown if the string is not found in the string table.
TryGetStringUserData(int, out StringTableOutUserData)
Tries to get the user data for the specified index.
bool TryGetStringUserData(int index, out StringTableOutUserData result)- index int — The index to get the user data from.
- result StringTableOutUserData — The user data, or invalid if the index is invalid.
- bool — True if the user data was successfully retrieved, false otherwise.
TryGetStringUserData(string, out StringTableOutUserData)
Tries to get the user data for the specified string.
bool TryGetStringUserData(string str, out StringTableOutUserData result)- str string — The string to get the user data for.
- result StringTableOutUserData — The user data, or invalid if the string is not found.
- bool — True if the user data was successfully retrieved, false otherwise.