|
|
@ -22,6 +22,11 @@ class UserAPI extends AcediaObject |
|
|
|
|
|
|
|
|
|
|
|
var private config string userdataDBLink; |
|
|
|
var private config string userdataDBLink; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Active `Users_Feature`, remember it along with life version to avoid |
|
|
|
|
|
|
|
// taking up a reference |
|
|
|
|
|
|
|
var private int usersFeatureLifeVersion; |
|
|
|
|
|
|
|
var private Users_Feature usersFeature; |
|
|
|
|
|
|
|
|
|
|
|
// Database where user's data (persistent data and user groups) is stored |
|
|
|
// Database where user's data (persistent data and user groups) is stored |
|
|
|
var private Database persistentDatabase; |
|
|
|
var private Database persistentDatabase; |
|
|
|
|
|
|
|
|
|
|
@ -35,6 +40,23 @@ protected function Constructor() |
|
|
|
SetupUserDataDatabase(); |
|
|
|
SetupUserDataDatabase(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DO NOT CALL MANUALLY |
|
|
|
|
|
|
|
public function _reloadFeature() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if ( usersFeature != none |
|
|
|
|
|
|
|
&& usersFeature.GetLifeVersion() == usersFeatureLifeVersion) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
usersFeature = none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
usersFeature = |
|
|
|
|
|
|
|
Users_Feature(class'Users_Feature'.static.GetEnabledInstance()); |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
usersFeatureLifeVersion = usersFeature.GetLifeVersion(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_.memory.Free(usersFeature); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Loads persistent user database, specified by the AcediaCore's config and |
|
|
|
// Loads persistent user database, specified by the AcediaCore's config and |
|
|
|
// creates a basic skeleton for storing its data |
|
|
|
// creates a basic skeleton for storing its data |
|
|
|
private function SetupUserDataDatabase() |
|
|
|
private function SetupUserDataDatabase() |
|
|
@ -233,11 +255,12 @@ public final function User FetchByKey(int userKey) |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns names of all available groups that users can belong to. |
|
|
|
* Returns names of all available groups that users can belong to. |
|
|
|
* |
|
|
|
* |
|
|
|
* In case this feature is configured to load user groups from a database |
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* (either local or remote), the returned value is a locally cached one. |
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
* This helps us avoid having to query database each time we want to check |
|
|
|
* groups from a database (either local or remote), the returned value is |
|
|
|
* something about user groups, but it also means we might have an outdated |
|
|
|
* a locally cached one. This helps us avoid having to query database each time |
|
|
|
* information. |
|
|
|
* we want to check something about user groups, but it also means we might |
|
|
|
|
|
|
|
* have an outdated information. |
|
|
|
* |
|
|
|
* |
|
|
|
* @return Array with names of all available groups. |
|
|
|
* @return Array with names of all available groups. |
|
|
|
* All array elements are guaranteed to be not-`none`, unique and in |
|
|
|
* All array elements are guaranteed to be not-`none`, unique and in |
|
|
@ -245,22 +268,296 @@ public final function User FetchByKey(int userKey) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function array<Text> GetAvailableGroups() |
|
|
|
public final function array<Text> GetAvailableGroups() |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<Text> emptyResult; |
|
|
|
local array<Text> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetAvailableGroups(); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetAvailableGroups(); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
} |
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Adds a new user group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), the returned value is |
|
|
|
|
|
|
|
* a locally cached one. This helps us avoid having to query database each time |
|
|
|
|
|
|
|
* we want to check something about user groups, but it also means we might |
|
|
|
|
|
|
|
* have an outdated information. |
|
|
|
|
|
|
|
* Changes will always persist for the duration of the match, but writing |
|
|
|
|
|
|
|
* them into the (non-config) source might fail, leading to changes being reset |
|
|
|
|
|
|
|
* after the level switch. For non-database (config) sources changes will |
|
|
|
|
|
|
|
* always be saved. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param groupName Name of the group to add. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if group was added and `false` otherwise (including if it |
|
|
|
|
|
|
|
* already existed). |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool AddGroup(BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.AddGroup(groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes existing user group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), the returned value is |
|
|
|
|
|
|
|
* a locally cached one. This helps us avoid having to query database each time |
|
|
|
|
|
|
|
* we want to check something about user groups, but it also means we might |
|
|
|
|
|
|
|
* have an outdated information. |
|
|
|
|
|
|
|
* Changes will always persist for the duration of the match, but writing |
|
|
|
|
|
|
|
* them into the (non-config) source might fail, leading to changes being reset |
|
|
|
|
|
|
|
* after the level switch. For non-database (config) sources changes will |
|
|
|
|
|
|
|
* always be saved. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param groupName Name of the group to remove. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if group was removed and `false` otherwise (including if it |
|
|
|
|
|
|
|
* didn't exist in the first place). |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool RemoveGroup(BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.RemoveGroup(groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Checks whether group with specified name exists. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), the returned value is |
|
|
|
|
|
|
|
* a locally cached one. This helps us avoid having to query database each time |
|
|
|
|
|
|
|
* we want to check something about user groups, but it also means we might |
|
|
|
|
|
|
|
* have an outdated information. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param groupName Name of the group to check existence of. |
|
|
|
|
|
|
|
* Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if group exists and `false` otherwise. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool IsGroupExisting(BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.IsGroupExisting(groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Adds user with the given SteamID into the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param steamID SteamID of the user to add to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to add user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was added to the group (including if her was already |
|
|
|
|
|
|
|
* added to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool AddSteamIDToGroup( |
|
|
|
|
|
|
|
BaseText steamID, |
|
|
|
|
|
|
|
BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.AddSteamIDToGroup(steamID, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Adds user with the given SteamID into the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param steamID SteamID of the user to add to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to add user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was added to the group (including if her was already |
|
|
|
|
|
|
|
* added to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final /*unreal*/ function bool AddSteamIDToGroup_S( |
|
|
|
|
|
|
|
string steamID, |
|
|
|
|
|
|
|
string groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.AddSteamIDToGroup_S(steamID, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Adds user (given by the `UserID`) into the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id `UserID` of the user to add to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to add user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was added to the group (including if her was already |
|
|
|
|
|
|
|
* added to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool AddUserIDToGroup( |
|
|
|
|
|
|
|
UserID id, |
|
|
|
|
|
|
|
BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.AddUserIDToGroup(id, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Adds given user into the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param user User to add to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to add user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was added to the group (including if her was already |
|
|
|
|
|
|
|
* added to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool AddUserToGroup(User user, BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.AddUserToGroup(user, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes user with the given SteamID from the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param steamID SteamID of the user to remove to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to remove user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was removed to the group (including if her was |
|
|
|
|
|
|
|
* already removed to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool RemoveSteamIDFromGroup( |
|
|
|
|
|
|
|
BaseText steamID, |
|
|
|
|
|
|
|
BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.RemoveSteamIDFromGroup(steamID, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes user with the given SteamID from the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param steamID SteamID of the user to remove to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to remove user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was removed to the group (including if her was |
|
|
|
|
|
|
|
* already removed to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final /*unreal*/ function bool RemoveSteamIDFromGroup_S( |
|
|
|
|
|
|
|
string steamID, |
|
|
|
|
|
|
|
string groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.RemoveSteamIDFromGroup_S(steamID, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes user (given by the `UserID`) from the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id `UserID` of the user to remove to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to remove user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was removed to the group (including if her was |
|
|
|
|
|
|
|
* already removed to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool RemoveUserIDFromGroup( |
|
|
|
|
|
|
|
UserID id, |
|
|
|
|
|
|
|
BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.RemoveUserIDFromGroup(id, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes user from the specified group. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
|
|
|
|
* In case active config of `Users_Feature` is configured to load user |
|
|
|
|
|
|
|
* groups from a database (either local or remote), changes are guaranteed to |
|
|
|
|
|
|
|
* be made to the locally cached copy that will persist for the duration of |
|
|
|
|
|
|
|
* the game. Method will also attempt to change the database value, but that is |
|
|
|
|
|
|
|
* not guaranteed to succeed, meaning that changes might not be saved for |
|
|
|
|
|
|
|
* later matches. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param user User to remove to the group. |
|
|
|
|
|
|
|
* @param groupName Name of the group to remove user to. Case-insensitive. |
|
|
|
|
|
|
|
* @return `true` if user was removed to the group (including if her was |
|
|
|
|
|
|
|
* already removed to it) and `false` in any other case. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function bool RemoveUserFromGroup(User user, BaseText groupName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (usersFeature != none) { |
|
|
|
|
|
|
|
return usersFeature.RemoveUserFromGroup(user, groupName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns names of all groups available for the user given by the SteamID. |
|
|
|
* Returns names of all groups available for the user given by the SteamID. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -280,22 +577,18 @@ public final function array<Text> GetAvailableGroups() |
|
|
|
public final function array<Text> GetGroupsForSteamID( |
|
|
|
public final function array<Text> GetGroupsForSteamID( |
|
|
|
BaseText steamID) |
|
|
|
BaseText steamID) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<Text> emptyResult; |
|
|
|
local array<Text> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetGroupsForSteamID(steamID); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetGroupsForSteamID(steamID); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns names of all groups available for the user given by the SteamID. |
|
|
|
* Returns names of all groups available for the user given by the SteamID. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -314,23 +607,19 @@ public final function array<Text> GetGroupsForSteamID( |
|
|
|
public final /*unreal*/ function array<Text> GetGroupsForSteamID_S( |
|
|
|
public final /*unreal*/ function array<Text> GetGroupsForSteamID_S( |
|
|
|
string steamID) |
|
|
|
string steamID) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<Text> emptyResult; |
|
|
|
local array<Text> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetGroupsForSteamID_S(steamID); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetGroupsForSteamID_S(steamID); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns names of all groups available for the user given by the `UserID`. |
|
|
|
* Returns names of all groups available for the user given by the `UserID`. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -347,22 +636,18 @@ public final /*unreal*/ function array<Text> GetGroupsForSteamID_S( |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function array<Text> GetGroupsForUserID(UserID id) |
|
|
|
public final function array<Text> GetGroupsForUserID(UserID id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<Text> emptyResult; |
|
|
|
local array<Text> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetGroupsForUserID(id); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetGroupsForUserID(id); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns names of all groups available for the user. |
|
|
|
* Returns names of all groups available for the user. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -380,22 +665,18 @@ public final function array<Text> GetGroupsForUserID(UserID id) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function array<Text> GetGroupsForUser(User user) |
|
|
|
public final function array<Text> GetGroupsForUser(User user) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<Text> emptyResult; |
|
|
|
local array<Text> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetGroupsForUser(user); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetGroupsForUser(user); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns `UserID`s of all users that belong into the group named `groupName`. |
|
|
|
* Returns `UserID`s of all users that belong into the group named `groupName`. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -410,23 +691,19 @@ public final function array<Text> GetGroupsForUser(User user) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function array<UserID> GetGroupMembers(BaseText groupName) |
|
|
|
public final function array<UserID> GetGroupMembers(BaseText groupName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
local array<UserID> emptyResult; |
|
|
|
local array<UserID> result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
if (usersFeature != none) { |
|
|
|
.GetEnabledInstance()); |
|
|
|
return usersFeature.GetGroupMembers(groupName); |
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.GetGroupMembers(groupName); |
|
|
|
return emptyResult; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Checks whether user given by the `UserID` belongs to the group named |
|
|
|
* Checks whether user given by the `UserID` belongs to the group named |
|
|
|
* `groupName`. |
|
|
|
* `groupName`. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -441,22 +718,16 @@ public final function array<UserID> GetGroupMembers(BaseText groupName) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function bool IsUserIDInGroup(UserID id, Text groupName) |
|
|
|
public final function bool IsUserIDInGroup(UserID id, Text groupName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
if (usersFeature != none) { |
|
|
|
local bool result; |
|
|
|
return usersFeature.IsUserIDInGroup(id, groupName); |
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
|
|
|
|
.GetEnabledInstance()); |
|
|
|
|
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.IsUserIDInGroup(id, groupName); |
|
|
|
return false; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Checks whether user belongs to the given group. |
|
|
|
* Checks whether user belongs to the given group. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* In case active config of `Users_Feature` is set up to load user groups |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* from a database (either local or remote), the returned value is a locally |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
|
* cached one. This helps us avoid having to query database each time we want |
|
|
@ -472,23 +743,17 @@ public final function bool IsUserIDInGroup(UserID id, Text groupName) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function bool IsUserInGroup(User user, Text groupName) |
|
|
|
public final function bool IsUserInGroup(User user, Text groupName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
if (usersFeature != none) { |
|
|
|
local bool result; |
|
|
|
return usersFeature.IsUserInGroup(user, groupName); |
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
|
|
|
|
.GetEnabledInstance()); |
|
|
|
|
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.IsUserInGroup(user, groupName); |
|
|
|
return false; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Checks whether user groups' data was already loaded from the source |
|
|
|
* Checks whether user groups' data was already loaded from the source |
|
|
|
* (either config file or local/remote database). |
|
|
|
* (either config file or local/remote database). |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Will only work if `Users_Feature` is active. |
|
|
|
* Data loaded once is cached and this method returning `true` does not |
|
|
|
* Data loaded once is cached and this method returning `true` does not |
|
|
|
* guarantee that is isn't outdated. Additional, asynchronous queries must be |
|
|
|
* guarantee that is isn't outdated. Additional, asynchronous queries must be |
|
|
|
* made to check for that. |
|
|
|
* made to check for that. |
|
|
@ -497,17 +762,10 @@ public final function bool IsUserInGroup(User user, Text groupName) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function bool IsUserGroupDataLoaded() |
|
|
|
public final function bool IsUserGroupDataLoaded() |
|
|
|
{ |
|
|
|
{ |
|
|
|
local Users_Feature usersFeature; |
|
|
|
if (usersFeature != none) { |
|
|
|
local bool result; |
|
|
|
return usersFeature.IsUserGroupDataLoaded(); |
|
|
|
|
|
|
|
|
|
|
|
usersFeature = Users_Feature(class'Users_Feature'.static |
|
|
|
|
|
|
|
.GetEnabledInstance()); |
|
|
|
|
|
|
|
if (usersFeature == none) { |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
result = usersFeature.IsUserGroupDataLoaded(); |
|
|
|
return false; |
|
|
|
usersFeature.FreeSelf(); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defaultproperties |
|
|
|
defaultproperties |
|
|
|