Documentation

Alliance
in package

Table of Contents

Constants

MAXLENGTH_DESCRIPTION  = 255
MAXLENGTH_NAME  = 36
RECRUIT_CLOSED  = 'closed'
RECRUIT_OPEN  = 'open'
RECRUIT_PASSWORD  = 'password'
SQL  = 'alliance_id = :alliance_id AND game_id = :game_id'

Properties

$SQLID  : array{alliance_id: int, game_id: int}
$allianceID  : int
$allianceName  : string
$bank  : int
$CACHE_ALLIANCES  : array<int, array<int, self>>
$deaths  : int
$description  : string|null
$discordChannel  : string|null
$discordServer  : string|null
$flagshipID  : int
$gameID  : int
$imgSrc  : string
$ircChannel  : string
$kills  : int
$leaderID  : int
$memberList  : array<string|int, int>
$motd  : string
$password  : string
$recruiting  : bool
$seedlist  : array<string|int, int>

Methods

allRecruitTypes()  : array<string, string>
List of all recruitment types and their descriptions.
clearCache()  : void
createAlliance()  : self
Create an alliance and return the new object.
createDefaultRoles()  : void
Create the default roles for this alliance.
decreaseBank()  : void
getActiveIDs()  : array<string|int, int>
getAlliance()  : self
getAllianceBBLink()  : string
getAllianceByDiscordChannel()  : self
getAllianceByIrcChannel()  : self
getAllianceByName()  : self
getAllianceDisplayName()  : string
getAllianceID()  : int
getAllianceName()  : string
Returns the alliance name.
getBank()  : int
Get the total credits in the alliance bank account.
getDeaths()  : int
getDescription()  : string
Get (HTML-safe) alliance description for display.
getDiscordChannel()  : string|null
getDiscordServer()  : string|null
getFlagshipID()  : int
Get account ID of the player designated as the alliance flagship.
getGame()  : Game
getGameID()  : int
getImageURL()  : string
getIrcChannel()  : string
getJoinRestriction()  : string|false
getKills()  : int
getLeader()  : AbstractPlayer
getLeaderID()  : int
getMemberIDs()  : array<string|int, int>
getMembers()  : array<int, Player>
Returns the members of this alliance as an array of Player objects.
getMotD()  : string
Get (HTML-safe) alliance Message of the Day for display.
getNumMembers()  : int
getNumVeterans()  : int
getPassword()  : string
getPlanets()  : array<string|int, Planet>
Return all planets owned by members of this alliance.
getRecruitType()  : string
getSeedlist()  : array<string|int, int>
Return array of sector_id for sectors in the alliance seedlist.
hasDisbanded()  : bool
hasFlagship()  : bool
hasImageURL()  : bool
hasLeader()  : bool
hasPassword()  : bool
increaseBank()  : int
Increases alliance bank account up to the maximum allowed credits.
isInSeedlist()  : bool
Is the given sector in the alliance seedlist?
isNHA()  : bool
Returns true if the alliance is the Newbie Help Alliance.
isRecruiting()  : bool
setAllianceDescription()  : void
setBank()  : void
setDiscordChannel()  : void
setDiscordServer()  : void
setFlagshipID()  : void
Designate a player as the alliance flagship by their account ID.
setImageURL()  : void
setIrcChannel()  : void
setLeaderID()  : void
setMotD()  : void
setRecruitType()  : void
Set the password and recruiting attributes.
update()  : void
__construct()  : mixed

Constants

MAXLENGTH_DESCRIPTION

public mixed MAXLENGTH_DESCRIPTION = 255

MAXLENGTH_NAME

public mixed MAXLENGTH_NAME = 36

RECRUIT_CLOSED

public mixed RECRUIT_CLOSED = 'closed'

RECRUIT_OPEN

public mixed RECRUIT_OPEN = 'open'

RECRUIT_PASSWORD

public mixed RECRUIT_PASSWORD = 'password'

SQL

public mixed SQL = 'alliance_id = :alliance_id AND game_id = :game_id'

Properties

$SQLID read-only

public array{alliance_id: int, game_id: int} $SQLID

$allianceID read-only

protected int $allianceID

$allianceName

protected string $allianceName

$CACHE_ALLIANCES

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

$description

protected string|null $description

$discordChannel

protected string|null $discordChannel

$discordServer

protected string|null $discordServer

$ircChannel

protected string $ircChannel

$memberList

protected array<string|int, int> $memberList

$seedlist

protected array<string|int, int> $seedlist

Methods

allRecruitTypes()

List of all recruitment types and their descriptions.

public static allRecruitTypes() : array<string, string>

Do not change the order of elements in the list!

Return values
array<string, string>

clearCache()

public static clearCache() : void

createAlliance()

Create an alliance and return the new object.

public static createAlliance(int $gameID, string $name[, bool $allowNHA = false ]) : self

Starts alliance with "closed" recruitment (for safety).

Parameters
$gameID : int
$name : string
$allowNHA : bool = false
Return values
self

createDefaultRoles()

Create the default roles for this alliance.

public createDefaultRoles([string $newMemberPermission = 'basic' ]) : void

This should only be called once after the alliance is created.

Parameters
$newMemberPermission : string = 'basic'

decreaseBank()

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

getActiveIDs()

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

getAlliance()

public static getAlliance(int $allianceID, int $gameID[, bool $forceUpdate = false ][, DatabaseRecord $dbRecord = null ]) : self
Parameters
$allianceID : int
$gameID : int
$forceUpdate : bool = false
$dbRecord : DatabaseRecord = null
Return values
self
public getAllianceBBLink() : string
Return values
string

getAllianceByDiscordChannel()

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

getAllianceByIrcChannel()

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

getAllianceByName()

public static getAllianceByName(string $name, int $gameID[, bool $forceUpdate = false ]) : self
Parameters
$name : string
$gameID : int
$forceUpdate : bool = false
Return values
self

getAllianceDisplayName()

public getAllianceDisplayName([bool $linked = false ][, bool $includeAllianceID = false ]) : string
Parameters
$linked : bool = false
$includeAllianceID : bool = false
Return values
string

getAllianceID()

public getAllianceID() : int
Return values
int

getAllianceName()

Returns the alliance name.

public getAllianceName() : string

Use getAllianceDisplayName for an HTML-safe version.

Return values
string

getBank()

Get the total credits in the alliance bank account.

public getBank() : int
Return values
int

getDeaths()

public getDeaths() : int
Return values
int

getDescription()

Get (HTML-safe) alliance description for display.

public getDescription() : string
Return values
string

getDiscordChannel()

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

getDiscordServer()

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

getFlagshipID()

Get account ID of the player designated as the alliance flagship.

public getFlagshipID() : int

Returns 0 if no flagship.

Return values
int

getGameID()

public getGameID() : int
Return values
int

getImageURL()

public getImageURL() : string
Return values
string

getIrcChannel()

public getIrcChannel() : string
Return values
string

getJoinRestriction()

public getJoinRestriction(AbstractPlayer $player[, bool $doAllianceCheck = true ][, bool $doRecruitingCheck = true ]) : string|false
Parameters
$player : AbstractPlayer
$doAllianceCheck : bool = true
$doRecruitingCheck : bool = true
Return values
string|false

getKills()

public getKills() : int
Return values
int

getLeaderID()

public getLeaderID() : int
Return values
int

getMemberIDs()

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

getMembers()

Returns the members of this alliance as an array of Player objects.

public getMembers() : array<int, Player>
Return values
array<int, Player>

getMotD()

Get (HTML-safe) alliance Message of the Day for display.

public getMotD() : string
Return values
string

getNumMembers()

public getNumMembers() : int
Return values
int

getNumVeterans()

public getNumVeterans() : int
Return values
int

getPassword()

public getPassword() : string
Return values
string

getPlanets()

Return all planets owned by members of this alliance.

public getPlanets() : array<string|int, Planet>
Return values
array<string|int, Planet>

getRecruitType()

public getRecruitType() : string
Return values
string

getSeedlist()

Return array of sector_id for sectors in the alliance seedlist.

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

hasDisbanded()

public hasDisbanded() : bool
Return values
bool

hasFlagship()

public hasFlagship() : bool
Return values
bool

hasImageURL()

public hasImageURL() : bool
Return values
bool

hasLeader()

public hasLeader() : bool
Return values
bool

hasPassword()

public hasPassword() : bool
Return values
bool

increaseBank()

Increases alliance bank account up to the maximum allowed credits.

public increaseBank(int $credits) : int

Returns the amount that was actually added to handle overflow.

Parameters
$credits : int
Return values
int

isInSeedlist()

Is the given sector in the alliance seedlist?

public isInSeedlist(Sector $sector) : bool
Parameters
$sector : Sector
Return values
bool

isNHA()

Returns true if the alliance is the Newbie Help Alliance.

public isNHA() : bool
Return values
bool

isRecruiting()

public isRecruiting() : bool
Return values
bool

setAllianceDescription()

public setAllianceDescription(string $description[, AbstractPlayer $player = null ]) : void
Parameters
$description : string
$player : AbstractPlayer = null

setBank()

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

setDiscordChannel()

public setDiscordChannel(string|null $channelId) : void
Parameters
$channelId : string|null

setDiscordServer()

public setDiscordServer(string|null $serverId) : void
Parameters
$serverId : string|null

setFlagshipID()

Designate a player as the alliance flagship by their account ID.

public setFlagshipID(int $accountID) : void
Parameters
$accountID : int

setImageURL()

public setImageURL(string $url) : void
Parameters
$url : string

setIrcChannel()

public setIrcChannel(string $ircChannel) : void
Parameters
$ircChannel : string

setLeaderID()

public setLeaderID(int $leaderID) : void
Parameters
$leaderID : int

setMotD()

public setMotD(string $motd) : void
Parameters
$motd : string

setRecruitType()

Set the password and recruiting attributes.

public setRecruitType(string $type, string $password) : void

The input $password is ignored except for the "password" $type.

Parameters
$type : string
$password : string

__construct()

protected __construct(int $allianceID, int $gameID[, DatabaseRecord $dbRecord = null ]) : mixed
Parameters
$allianceID : int
$gameID : int
$dbRecord : DatabaseRecord = null

        
On this page

Search results