DLL - Currency System
by StreamUP
DLLUser Points Management
Adds points to a user by their ID.
long AddUserPointsById(
string userId,
Platform platform,
long pointsToAdd,
string varName = "points"
)Adds points to a user by their username.
long AddUserPointsByUser(
string user,
Platform platform,
long pointsToAdd,
string varName = "points"
)Sets the points for a user by their ID.
void SetUserPointsById(
string userId,
Platform platform,
long points,
string varName = "points"
)Sets the points for a user by their username.
void SetUserPointsByUser(
string user,
Platform platform,
long points,
string varName = "points"
)Data Classes
Represents a user on the leaderboard.
public class LeaderboardUser
{
public string UserId { get; set; }
public string UserName { get; set; }
public string UserType { get; set; }
public long Points { get; set; }
public int Position { get; set; }
}Represents a YouTube user.
public class YouTubeUser
{
public string UserId { get; set; }
public string UserName { get; set; }
}Represents a currency user.
[Serializable()]
public class CurrencyUser
{
public string UserName {get; set;}
public string UserId {get; set;}
public Platform Platform {get; set;}
}Bet and Prize Calculation
Calculates the bet size based on input and constraints.
long GetBetSize(
string input,
long currentPoints,
long minBet,
long maxBet,
long defaultBet,
bool rangeError
)Calculates the prize size based on input and constraints.
long GetPrizeSize(
string input,
long minPrize,
long maxPrize,
long defaultPrize,
bool rangeError
)Affordability Checks
Checks if a user can afford a cost by their ID.
bool CanUserAffordById(
string userId,
long cost,
Platform platform,
string varName = "points"
)Checks if a user can afford a cost by their username.
bool CanUserAffordByName(
string user,
long cost,
Platform platform,
string varName = "points"
)User Points Retrieval
Gets the points for a user by their ID.
long GetUserPointsById(string userId, Platform platform, string varName = "points")Gets the points for a user by their username.
long GetUserPointsByUser(string user, Platform platform, string varName = "points")User Lists and Leaderboards
Gets all users with points for a given variable name.
List<UserVariableValue<string>> GetAllPointUsers(string varName = "points")Gets leaderboard users, excluding specified users.
List<LeaderboardUser> GetLeaderboardUsers(
List<UserVariableValue<long>> currentUsers,
List<GroupUser> excludedUsers
)Gets YouTube users for a given input and variable name.
List<YouTubeUser> GetYouTubeUsers(string input, string varName = "points")Bulk Points Operations
Adds points to all users.
int AddPointsToAllUsers(long pointsToAdd, string varName = "points")Sets points to all users.
int SetPointsToAllUsers(long pointsToSet, string varName = "points")Resets group users' points.
void ResetGroupUsers(List<GroupUser> users, string varName = "points")Timed and Default Handlers
Adds timed points to users for a platform.
bool AddTimedPoints(
long pointsToAdd,
string platformString,
string varName = "points"
)Handles default point logic for a user.
bool DefaultPointHandler(
string userId,
Platform platform,
long points,
out long newPoints,
string varName = "points"
)