Class Account
The account class represents a player's server account.
Assembly: SlipeServer.dll
Syntax
public sealed class Account : IAclObject
Constructors
|
Improve this Doc
View Source
Account(String, String, Boolean)
This function adds an account to the list of registered accounts of the current server.
Declaration
public Account(string name, string password, bool caseSensitive = false)
Parameters
Properties
|
Improve this Doc
View Source
AclIdentifier
Returns the identifiable string user.{name}
Declaration
public string AclIdentifier { get; }
Property Value
|
Improve this Doc
View Source
All
Returns an array of all existing accounts
Declaration
public static Account[] All { get; }
Property Value
|
Improve this Doc
View Source
Data
Returns a dictionary of all the data stored in this account
Declaration
public Dictionary<string, string> Data { get; }
Property Value
|
Improve this Doc
View Source
Id
Get the ID of the account
Declaration
Property Value
|
Improve this Doc
View Source
Ip
Get the IP of the account
Declaration
public string Ip { get; }
Property Value
|
Improve this Doc
View Source
IsGuestAccount
This function checks to see if an account is a guest account.
Declaration
public bool IsGuestAccount { get; }
Property Value
|
Improve this Doc
View Source
Name
Get the username of this account
Declaration
public string Name { get; }
Property Value
|
Improve this Doc
View Source
Player
Get the player currently playing on this account if any
Declaration
public Player Player { get; }
Property Value
|
Improve this Doc
View Source
Serial
Get the serial of this account
Declaration
public string Serial { get; }
Property Value
Methods
|
Improve this Doc
View Source
ClearData(String)
This function removes data under a specific key
Declaration
public bool ClearData(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
CopyFrom(Account)
This function copies all of the data from one account to this account
Declaration
public bool CopyFrom(Account fromAccount)
Parameters
Type |
Name |
Description |
Account |
fromAccount |
|
Returns
|
Improve this Doc
View Source
Get(Int32)
Get an account from an account ID
Declaration
public static Account Get(int ID)
Parameters
Type |
Name |
Description |
Int32 |
ID |
|
Returns
|
Improve this Doc
View Source
Get(String, String, Boolean)
Get an account from some credentials
Declaration
public static Account Get(string username, string password = null, bool caseSensitive = true)
Parameters
Returns
|
Improve this Doc
View Source
GetAccountsByData(String, String)
Returns an array containing all accounts with specified dataName and value (
Declaration
public static Account[] GetAccountsByData(string key, string value)
Parameters
Returns
|
Improve this Doc
View Source
GetAccountsByIP(String)
Returns an array containing all accounts that were logged onto from specified IP-address.
Declaration
public static Account[] GetAccountsByIP(string ip)
Parameters
Type |
Name |
Description |
String |
ip |
|
Returns
|
Improve this Doc
View Source
GetAccountsBySerial(String)
Returns an array of all accounts that were logged onto from a serial
Declaration
public static Account[] GetAccountsBySerial(string serial)
Parameters
Type |
Name |
Description |
String |
serial |
|
Returns
|
Improve this Doc
View Source
GetData(String)
This function retrieves a string that has been stored using SetData.
Declaration
public string GetData(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
|
Improve this Doc
View Source
HasPermissionTo(String, Boolean)
Check if the object has access to a given action
Declaration
public bool HasPermissionTo(string action, bool defaultPermission = true)
Parameters
Returns
|
Improve this Doc
View Source
IsInACLGroup(AclGroup)
Check if the object is in a certain ACL group
Declaration
public bool IsInACLGroup(AclGroup group)
Parameters
Returns
|
Improve this Doc
View Source
Remove()
Removes this account from the server
Declaration
Returns
|
Improve this Doc
View Source
SetData(String, String)
This function sets a string to be stored in an account.
Declaration
public bool SetData(string key, string value)
Parameters
Returns
|
Improve this Doc
View Source
SetName(String, Boolean)
Sets the name of an account
Declaration
public bool SetName(string name, bool caseSensitive = false)
Parameters
Returns
|
Improve this Doc
View Source
SetPassword(String)
Used to set the password of this account, encrypted with sha256
Declaration
public bool SetPassword(string value)
Parameters
Type |
Name |
Description |
String |
value |
|
Returns
|
Improve this Doc
View Source
TryGetData(String, out String)
This function tries to retrieve the data value and returns true if this was succesful
Declaration
public bool TryGetData(string key, out string data)
Parameters
Type |
Name |
Description |
String |
key |
The key at which data is stored
|
String |
data |
The string to which to write the data to
|
Returns
Type |
Description |
Boolean |
True if the data was succesfully retrieved, false otherwise
|
Events
|
Improve this Doc
View Source
OnDataChange
Declaration
public static event Account.OnDataChangeHandler OnDataChange
Event Type
Implements