Documentation

Account
in package

Table of Contents

Constants

SQL  = 'account_id = :account_id'
DEFAULT_HOTKEYS  = ['MoveUp' => ['w', 'up'], 'ScanUp' => ['shift+w', 'shift+up'], 'MoveLeft' => ['a', 'left'], 'ScanLeft' => ['shift+a', 'shift+left'], 'MoveRight' => ['d', 'right'], 'ScanRight' => ['shift+d', 'shift+right'], 'MoveDown' => ['s', 'down'], 'ScanDown' => ['shift+s', 'shift+down'], 'MoveWarp' => ['e', '0'], 'ScanWarp' => ['shift+e', 'shift+0'], 'ScanCurrent' => ['shift+1'], 'CurrentSector' => ['1'], 'LocalMap' => ['2'], 'PlotCourse' => ['3'], 'CurrentPlayers' => ['4'], 'EnterPort' => ['q'], 'AttackTrader' => ['f']]
USER_RANKINGS_EACH_STAT_POW  = 0.9
USER_RANKINGS_SCORE  = [ // [Stat, a, b] // Used as: pow(Stat * a, USER_RANKINGS_EACH_STAT_POW) * b [['Trade', 'Experience', 'Total'], 0.1, 0.5], [['Trade', 'Money', 'Profit'], 5.0E-5, 0.5], [['Killing', 'Kills'], 1000, 1], ]

Properties

$accountID  : int
$CACHE_ACCOUNTS  : array<int, self>
$centerGalaxyMapOnPlayer  : bool
$colourScheme  : string
$credits  : int
$cssLink  : string|null
$dateFormat  : string
$defaultCSSEnabled  : bool
$discordId  : string|null
$email  : string
$enemyColour  : string
$fontSize  : int
$friendlyColour  : string
$hasChanged  : bool
$HOF  : array<string, float>
$hofName  : string
$hotkeys  : array<string, array<string|int, string>>
$images  : bool
$individualScores  : array<int, array<string|int, array{Stat: string[], Score: float}>>
$ircNick  : string|null
$last_login  : int
$logging  : bool
$login  : string
$mailBanned  : int
$maxRankAchieved  : int
$messageNotifications  : array<int, int>|null
$neutralColour  : string
$npc  : bool
$offset  : int
$oldAccountIDs  : array<string, int|null>
$passwordHash  : string
$passwordReset  : string|null
$permissions  : array<int, bool>
$points  : int
$referrerID  : int
$rewardCredits  : int
$score  : int
$SQLID  : array{account_id: int}
$template  : string
$timeFormat  : string
$useAJAX  : bool
$validated  : bool
$validation_code  : string
$veteranForced  : bool

Methods

addAuthMethod()  : void
addPoints()  : int|false
banAccount()  : void
changeEmail()  : void
Change e-mail address, unvalidate the account, and resend validation code
checkEmail()  : void
Perform basic sanity checks on the usability of an email address.
checkPassword()  : bool
Check if the given (plain-text) password is correct.
clearCache()  : void
createAccount()  : self
decreaseMessageNotifications()  : void
decreaseSmrCredits()  : void
decreaseTotalSmrCredits()  : void
doMessageSendingToBox()  : void
equals()  : bool
generatePasswordReset()  : void
getAccount()  : self
getAccountByDiscordId()  : self
getAccountByEmail()  : self
getAccountByHofName()  : self
getAccountByIrcNick()  : self
getAccountByLogin()  : self
getAccountBySocialId()  : self
getAccountID()  : int
getColourScheme()  : string
getCssColourUrl()  : string
getCssLink()  : string|null
getCssUrl()  : string
getDateFormat()  : string
getDateTimeFormat()  : string
Get the epoch format string including both date and time.
getDateTimeFormatSplit()  : string
Get the (HTML-only) epoch format string including both date and time, split across two lines.
getDefaultHotkeys()  : array<string, array<string|int, string>>
getDiscordId()  : string|null
getEmail()  : string
getEnemyColour()  : string
getFontSize()  : int
getFriendlyColour()  : string
getHOF()  : float
getHofDisplayName()  : string
The Hall Of Fame name is not html-escaped in the database, so to display it correctly we must escape html entities.
getHofName()  : string
getHotkeys()  : mixed
getIndividualScores()  : array<string|int, array{Stat: string[], Score: float}>
getIrcNick()  : string|null
getLastLogin()  : int
getLogin()  : string
getMailBanned()  : int
getMessageNotifications()  : int
getNeutralColour()  : string
getOffset()  : int
getOldAccountID()  : int
Return the ID associated with this account in the given history database.
getPasswordReset()  : string
getPermissions()  : array<int, bool>
getPersonalHofHREF()  : string
getPoints()  : int
getRank()  : UserRanking
getReferralLink()  : string
getReferrer()  : self
getReferrerID()  : int
getScore()  : int
getSmrCredits()  : int
getSmrRewardCredits()  : int
getTemplate()  : string
getTimeFormat()  : string
getTotalSmrCredits()  : int
getUserScoreCaseStatement()  : array{CASE: string, IN: string[]}
getValidationCode()  : string
hasPermission()  : bool
hasReferrer()  : bool
increaseMailBanned()  : void
increaseMessageNotifications()  : void
increaseSmrCredits()  : void
increaseSmrRewardCredits()  : void
isActive()  : bool
isCenterGalaxyMapOnPlayer()  : bool
isDefaultCSSEnabled()  : bool
isDisabled()  : array{Time: int, Reason: string, ReasonID: int}|false
Check if the account is disabled.
isDisplayShipImages()  : bool
isLoggingEnabled()  : bool
isMailBanned()  : bool
isNPC()  : bool
isReceivingMessageNotifications()  : bool
isUseAJAX()  : bool
isValidated()  : bool
isVeteran()  : bool
isVeteranForced()  : bool
log()  : void
removePoints()  : void
sendMessageToBox()  : void
sendValidationEmail()  : void
setCenterGalaxyMapOnPlayer()  : void
setColourScheme()  : void
setCssLink()  : void
setDateFormat()  : void
setDefaultCSSEnabled()  : void
setDiscordId()  : void
setDisplayShipImages()  : void
setEnemyColour()  : void
setFontSize()  : void
setFriendlyColour()  : void
setHofName()  : void
setHotkey()  : void
setIrcNick()  : void
setLoggingEnabled()  : void
setMailBanned()  : void
setMessageNotifications()  : void
setNeutralColour()  : void
setPassword()  : void
Set the (plain-text) password for this account.
setPoints()  : void
setSmrCredits()  : void
setSmrRewardCredits()  : void
setTemplate()  : void
setTimeFormat()  : void
setUseAJAX()  : void
setValidated()  : void
unbanAccount()  : void
update()  : void
updateIP()  : void
updateLastLogin()  : void
__construct()  : mixed
getHOFData()  : void
getSmrCreditsData()  : void
setEmail()  : void
setPasswordReset()  : void
setValidationCode()  : void
updateMaxRankAchieved()  : void

Constants

SQL

public mixed SQL = 'account_id = :account_id'

DEFAULT_HOTKEYS

protected mixed DEFAULT_HOTKEYS = ['MoveUp' => ['w', 'up'], 'ScanUp' => ['shift+w', 'shift+up'], 'MoveLeft' => ['a', 'left'], 'ScanLeft' => ['shift+a', 'shift+left'], 'MoveRight' => ['d', 'right'], 'ScanRight' => ['shift+d', 'shift+right'], 'MoveDown' => ['s', 'down'], 'ScanDown' => ['shift+s', 'shift+down'], 'MoveWarp' => ['e', '0'], 'ScanWarp' => ['shift+e', 'shift+0'], 'ScanCurrent' => ['shift+1'], 'CurrentSector' => ['1'], 'LocalMap' => ['2'], 'PlotCourse' => ['3'], 'CurrentPlayers' => ['4'], 'EnterPort' => ['q'], 'AttackTrader' => ['f']]

USER_RANKINGS_EACH_STAT_POW

protected mixed USER_RANKINGS_EACH_STAT_POW = 0.9

USER_RANKINGS_SCORE

protected mixed USER_RANKINGS_SCORE = [ // [Stat, a, b] // Used as: pow(Stat * a, USER_RANKINGS_EACH_STAT_POW) * b [['Trade', 'Experience', 'Total'], 0.1, 0.5], [['Trade', 'Money', 'Profit'], 5.0E-5, 0.5], [['Killing', 'Kills'], 1000, 1], ]

Properties

$accountID read-only

protected int $accountID

$CACHE_ACCOUNTS

protected static array<int, self> $CACHE_ACCOUNTS = []

$centerGalaxyMapOnPlayer

protected bool $centerGalaxyMapOnPlayer

$colourScheme

protected string $colourScheme
protected string|null $cssLink

$dateFormat

protected string $dateFormat

$defaultCSSEnabled

protected bool $defaultCSSEnabled

$discordId

protected string|null $discordId

$enemyColour

protected string $enemyColour

$friendlyColour

protected string $friendlyColour

$hasChanged

protected bool $hasChanged

$HOF

protected array<string, float> $HOF

$hotkeys

protected array<string, array<string|int, string>> $hotkeys

$individualScores

protected array<int, array<string|int, array{Stat: string[], Score: float}>> $individualScores

$ircNick

protected string|null $ircNick

$last_login

protected int $last_login

$mailBanned

protected int $mailBanned

$maxRankAchieved

protected int $maxRankAchieved

$messageNotifications

protected array<int, int>|null $messageNotifications

$neutralColour

protected string $neutralColour

$oldAccountIDs

protected array<string, int|null> $oldAccountIDs = []

$passwordHash

protected string $passwordHash

$passwordReset

protected string|null $passwordReset

$permissions

protected array<int, bool> $permissions

$referrerID

protected int $referrerID

$rewardCredits

protected int $rewardCredits

$SQLID read-only

protected array{account_id: int} $SQLID

$template

protected string $template

$timeFormat

protected string $timeFormat

$validated

protected bool $validated

$validation_code

protected string $validation_code

$veteranForced

protected bool $veteranForced

Methods

addPoints()

public addPoints(int $numPoints, self $admin, int $reasonID, string $suspicion) : int|false
Parameters
$numPoints : int
$admin : self
$reasonID : int
$suspicion : string
Return values
int|false

banAccount()

public banAccount(int $expireTime, self $admin, int $reasonID, string $suspicion[, bool $removeExceptions = false ]) : void
Parameters
$expireTime : int
$admin : self
$reasonID : int
$suspicion : string
$removeExceptions : bool = false

changeEmail()

Change e-mail address, unvalidate the account, and resend validation code

public changeEmail(string $email) : void
Parameters
$email : string

checkEmail()

Perform basic sanity checks on the usability of an email address.

public static checkEmail(string $email[, self $owner = null ]) : void
Parameters
$email : string
$owner : self = null

checkPassword()

Check if the given (plain-text) password is correct.

public checkPassword(string $password) : bool

Updates the password hash if necessary.

Parameters
$password : string
Return values
bool

clearCache()

public static clearCache() : void

createAccount()

public static createAccount(string $login, string $password, string $email, int $timez, int $referral) : self
Parameters
$login : string
$password : string
$email : string
$timez : int
$referral : int
Return values
self

decreaseMessageNotifications()

public decreaseMessageNotifications(int $messageTypeID, int $num) : void
Parameters
$messageTypeID : int
$num : int

decreaseSmrCredits()

public decreaseSmrCredits(int $credits) : void
Parameters
$credits : int

decreaseTotalSmrCredits()

public decreaseTotalSmrCredits(int $totalCredits) : void
Parameters
$totalCredits : int

doMessageSendingToBox()

public static doMessageSendingToBox(int $senderID, int $boxTypeID, string $message[, int $gameID = 0 ]) : void
Parameters
$senderID : int
$boxTypeID : int
$message : string
$gameID : int = 0

equals()

public equals(self $other) : bool
Parameters
$other : self
Return values
bool

generatePasswordReset()

public generatePasswordReset() : void

getAccount()

public static getAccount(int $accountID[, bool $forceUpdate = false ]) : self
Parameters
$accountID : int
$forceUpdate : bool = false
Return values
self

getAccountByDiscordId()

public static getAccountByDiscordId(string|null $id[, bool $forceUpdate = false ]) : self
Parameters
$id : string|null
$forceUpdate : bool = false
Return values
self

getAccountByEmail()

public static getAccountByEmail(string|null $email[, bool $forceUpdate = false ]) : self
Parameters
$email : string|null
$forceUpdate : bool = false
Return values
self

getAccountByHofName()

public static getAccountByHofName(string $hofName[, bool $forceUpdate = false ]) : self
Parameters
$hofName : string
$forceUpdate : bool = false
Return values
self

getAccountByIrcNick()

public static getAccountByIrcNick(string|null $nick[, bool $forceUpdate = false ]) : self
Parameters
$nick : string|null
$forceUpdate : bool = false
Return values
self

getAccountByLogin()

public static getAccountByLogin(string $login[, bool $forceUpdate = false ]) : self
Parameters
$login : string
$forceUpdate : bool = false
Return values
self

getAccountBySocialId()

public static getAccountBySocialId(SocialIdentity $social[, bool $forceUpdate = false ]) : self
Parameters
$social : SocialIdentity
$forceUpdate : bool = false
Return values
self

getAccountID()

public getAccountID() : int
Return values
int

getColourScheme()

public getColourScheme() : string
Return values
string

getCssColourUrl()

public getCssColourUrl() : string
Return values
string
public getCssLink() : string|null
Return values
string|null

getCssUrl()

public getCssUrl() : string
Return values
string

getDateFormat()

public getDateFormat() : string
Return values
string

getDateTimeFormat()

Get the epoch format string including both date and time.

public getDateTimeFormat() : string
Return values
string

getDateTimeFormatSplit()

Get the (HTML-only) epoch format string including both date and time, split across two lines.

public getDateTimeFormatSplit() : string
Return values
string

getDefaultHotkeys()

public static getDefaultHotkeys() : array<string, array<string|int, string>>
Return values
array<string, array<string|int, string>>

getDiscordId()

public getDiscordId() : string|null
Return values
string|null

getEmail()

public getEmail() : string
Return values
string

getEnemyColour()

public getEnemyColour() : string
Return values
string

getFontSize()

public getFontSize() : int
Return values
int

getFriendlyColour()

public getFriendlyColour() : string
Return values
string

getHOF()

public getHOF(array<string|int, string> $typeList) : float
Parameters
$typeList : array<string|int, string>
Return values
float

getHofDisplayName()

The Hall Of Fame name is not html-escaped in the database, so to display it correctly we must escape html entities.

public getHofDisplayName([bool $linked = false ]) : string
Parameters
$linked : bool = false
Return values
string

getHofName()

public getHofName() : string
Return values
string

getHotkeys()

public getHotkeys([string $hotkeyType = null ]) : mixed
Parameters
$hotkeyType : string = null

getIndividualScores()

public getIndividualScores([Player $player = null ]) : array<string|int, array{Stat: string[], Score: float}>
Parameters
$player : Player = null
Return values
array<string|int, array{Stat: string[], Score: float}>

getIrcNick()

public getIrcNick() : string|null
Return values
string|null

getLastLogin()

public getLastLogin() : int
Return values
int

getLogin()

public getLogin() : string
Return values
string

getMailBanned()

public getMailBanned() : int
Return values
int

getMessageNotifications()

public getMessageNotifications(int $messageTypeID) : int
Parameters
$messageTypeID : int
Return values
int

getNeutralColour()

public getNeutralColour() : string
Return values
string

getOffset()

public getOffset() : int
Return values
int

getOldAccountID()

Return the ID associated with this account in the given history database.

public getOldAccountID(string $dbName) : int
Parameters
$dbName : string
Return values
int

getPasswordReset()

public getPasswordReset() : string
Return values
string

getPermissions()

public getPermissions() : array<int, bool>
Return values
array<int, bool>

getPersonalHofHREF()

public getPersonalHofHREF() : string
Return values
string

getPoints()

public getPoints() : int
Return values
int
public getReferralLink() : string
Return values
string

getReferrer()

public getReferrer() : self
Return values
self

getReferrerID()

public getReferrerID() : int
Return values
int

getScore()

public getScore() : int
Return values
int

getSmrCredits()

public getSmrCredits() : int
Return values
int

getSmrRewardCredits()

public getSmrRewardCredits() : int
Return values
int

getTemplate()

public getTemplate() : string
Return values
string

getTimeFormat()

public getTimeFormat() : string
Return values
string

getTotalSmrCredits()

public getTotalSmrCredits() : int
Return values
int

getUserScoreCaseStatement()

public static getUserScoreCaseStatement() : array{CASE: string, IN: string[]}
Return values
array{CASE: string, IN: string[]}

getValidationCode()

public getValidationCode() : string
Return values
string

hasPermission()

public hasPermission([int $permissionID = null ]) : bool
Parameters
$permissionID : int = null
Return values
bool

hasReferrer()

public hasReferrer() : bool
Return values
bool

increaseMailBanned()

public increaseMailBanned(int $increaseTime) : void
Parameters
$increaseTime : int

increaseMessageNotifications()

public increaseMessageNotifications(int $messageTypeID, int $num) : void
Parameters
$messageTypeID : int
$num : int

increaseSmrCredits()

public increaseSmrCredits(int $credits) : void
Parameters
$credits : int

increaseSmrRewardCredits()

public increaseSmrRewardCredits(int $credits) : void
Parameters
$credits : int

isActive()

public isActive() : bool
Return values
bool

isCenterGalaxyMapOnPlayer()

public isCenterGalaxyMapOnPlayer() : bool
Return values
bool

isDefaultCSSEnabled()

public isDefaultCSSEnabled() : bool
Return values
bool

isDisabled()

Check if the account is disabled.

public isDisabled() : array{Time: int, Reason: string, ReasonID: int}|false
Return values
array{Time: int, Reason: string, ReasonID: int}|false

isDisplayShipImages()

public isDisplayShipImages() : bool
Return values
bool

isLoggingEnabled()

public isLoggingEnabled() : bool
Return values
bool

isMailBanned()

public isMailBanned() : bool
Return values
bool

isNPC()

public isNPC() : bool
Return values
bool

isReceivingMessageNotifications()

public isReceivingMessageNotifications(int $messageTypeID) : bool
Parameters
$messageTypeID : int
Return values
bool

isUseAJAX()

public isUseAJAX() : bool
Return values
bool

isValidated()

public isValidated() : bool
Return values
bool

isVeteran()

public isVeteran() : bool
Return values
bool

isVeteranForced()

public isVeteranForced() : bool
Return values
bool

log()

public log(int $log_type_id, string $msg[, int $sector_id = 0 ]) : void
Parameters
$log_type_id : int
$msg : string
$sector_id : int = 0

removePoints()

public removePoints(int $numPoints[, int|null $lastUpdate = null ]) : void
Parameters
$numPoints : int
$lastUpdate : int|null = null

sendMessageToBox()

public sendMessageToBox(int $boxTypeID, string $message) : void
Parameters
$boxTypeID : int
$message : string

sendValidationEmail()

public sendValidationEmail() : void

setCenterGalaxyMapOnPlayer()

public setCenterGalaxyMapOnPlayer(bool $bool) : void
Parameters
$bool : bool

setColourScheme()

public setColourScheme(string $colourScheme) : void
Parameters
$colourScheme : string
public setCssLink(string $link) : void
Parameters
$link : string

setDateFormat()

public setDateFormat(string $format) : void
Parameters
$format : string

setDefaultCSSEnabled()

public setDefaultCSSEnabled(bool $bool) : void
Parameters
$bool : bool

setDiscordId()

public setDiscordId(string|null $id) : void
Parameters
$id : string|null

setDisplayShipImages()

public setDisplayShipImages(bool $bool) : void
Parameters
$bool : bool

setEnemyColour()

public setEnemyColour(string $colour) : void
Parameters
$colour : string

setFontSize()

public setFontSize(int $size) : void
Parameters
$size : int

setFriendlyColour()

public setFriendlyColour(string $colour) : void
Parameters
$colour : string

setHofName()

public setHofName(string $name) : void
Parameters
$name : string

setHotkey()

public setHotkey(string $hotkeyType, array<string|int, string> $bindings) : void
Parameters
$hotkeyType : string
$bindings : array<string|int, string>

setIrcNick()

public setIrcNick(string|null $nick) : void
Parameters
$nick : string|null

setLoggingEnabled()

public setLoggingEnabled(bool $bool) : void
Parameters
$bool : bool

setMailBanned()

public setMailBanned(int $time) : void
Parameters
$time : int

setMessageNotifications()

public setMessageNotifications(int $messageTypeID, int $num) : void
Parameters
$messageTypeID : int
$num : int

setNeutralColour()

public setNeutralColour(string $colour) : void
Parameters
$colour : string

setPassword()

Set the (plain-text) password for this account.

public setPassword(string $password) : void
Parameters
$password : string

setPoints()

public setPoints(int $numPoints[, int|null $lastUpdate = null ]) : void
Parameters
$numPoints : int
$lastUpdate : int|null = null

setSmrCredits()

public setSmrCredits(int $credits) : void
Parameters
$credits : int

setSmrRewardCredits()

public setSmrRewardCredits(int $credits) : void
Parameters
$credits : int

setTemplate()

public setTemplate(string $template) : void
Parameters
$template : string

setTimeFormat()

public setTimeFormat(string $format) : void
Parameters
$format : string

setUseAJAX()

public setUseAJAX(bool $bool) : void
Parameters
$bool : bool

setValidated()

public setValidated(bool $bool) : void
Parameters
$bool : bool

unbanAccount()

public unbanAccount([self $admin = null ][, string $currException = null ]) : void
Parameters
$admin : self = null
$currException : string = null

updateIP()

public updateIP() : void

updateLastLogin()

public updateLastLogin() : void

__construct()

protected __construct(int $accountID) : mixed
Parameters
$accountID : int

getHOFData()

protected getHOFData() : void

getSmrCreditsData()

protected getSmrCreditsData() : void

setEmail()

protected setEmail(string $email) : void
Parameters
$email : string

setPasswordReset()

protected setPasswordReset(string $passwordReset) : void
Parameters
$passwordReset : string

setValidationCode()

protected setValidationCode(string $code) : void
Parameters
$code : string

updateMaxRankAchieved()

protected updateMaxRankAchieved(int $rank) : void
Parameters
$rank : int

        
On this page

Search results