C# Class Aura.Channel.World.Guilds.GuildManager

Inheritance: Aura.Shared.Database.AbstractGuildManager
Show file Open project: aura-project/aura

Public Methods

Method Description
Apply ( Creature creature, Guild guild, string application ) : void

Adds creature to the guild as applicant.

ChangeStone ( Guild guild, GuildStoneType stoneType ) : void

Changes the look of the guild's stone.

ConvertPlayPoints ( Creature creature, Guild guild ) : void

Gives all of creature's play points to guild as guild points.

CreateGuild ( Party party, string name, GuildType type, GuildVisibility visibility ) : void

Creates new guild with the members from the party.

DestroyStone ( Guild guild ) : void

Destroy's guild's stone.

DonateGold ( Creature creature, Guild guild, int amount ) : void

Donates the given amount of gold from the creature to guild.

DonateItem ( Creature creature, Guild guild, Item item ) : void

Donates the given item from the creature to guild. The item is converted to its worth, e.g. Gold and checks add their actual amounts, while other items use their sell price.

While it's seemingly pointless to make a dedicated DonateItem method, maybe we can use this for something at some point, e.g. donating items that other members can retrieve?

GuildManager ( ) : Aura.Channel.Network.Sending

Creates new manager instance.

Initialize ( ) : void

Initializes manager, loading all guilds from database and subscribing to relevant events.

PlaceStone ( Guild guild ) : void

Places stone for guild in world.

SetGuildForCharacter ( Creature character ) : void

Sets the character's Guild and GuildMember properties if they're in a guild.

SetStone ( Guild guild ) : void

Places stone and saves its location to database.

Protected Methods

Method Description
LoadGuild ( Guild guild ) : void

Loads given guild.

OnSyncGuildAdded ( Guild guild ) : void

Called when a guild is added during synchronization.

As long as guilds are only created by players at run-time this should generally never do anything, because all members that need to be updated will be on the channel where the guild was created.

OnSyncGuildMemberAccepted ( Guild guild, GuildMember member ) : void

Called when a member's rank changes from Applied to !Declined during synchronization.

OnSyncGuildMemberAdded ( Guild guild, GuildMember member ) : void

Called when a guild member is added during synchronization.

Shouldn't happen during normal game-play, as the member is added to the guild when they apply.

OnSyncGuildMemberDeclined ( Guild guild, GuildMember member ) : void

Called when a member's rank changes from Applied to Declined during synchronization.

OnSyncGuildMemberRemoved ( Guild guild, GuildMember member ) : void

Called when a guild member is removed during synchronization.

Happens when a member leaves, is kicked, or is removed from the db on another channel.

OnSyncGuildMemberUpdated ( Guild guild, GuildMember member ) : void

Called when a member's rank changed during synchronization.

For example, when the leader changed their rank.

OnSyncGuildRemoved ( Guild guild ) : void

Called when a guild is removed during synchronization.

This will happen if a guild is disbanded from this or another channel.

Private Methods

Method Description
AddGold ( Guild guild, int amount ) : void

Adds gold and saves guild's resources to db.

ForOnlineMembers ( Guild guild, Action action ) : void

Executes the given action for all members of guild that are online.

GetStone ( long guildId ) : Prop

Returns stone prop of the given guild.

OnCreatureConnected ( Creature creature ) : void

Called when a creature connected to the channel.

OnMabiTick ( ErinnTime now ) : void

Called every 5 minutes to synchronize guild information.

OnStoneTouch ( Creature creature, Prop prop ) : void

Prop behavior for guild stones.

UpdateStoneLocation ( Guild guild ) : void

Updates the guild stone's location for all members.

Method Details

Apply() public method

Adds creature to the guild as applicant.
public Apply ( Creature creature, Guild guild, string application ) : void
creature Aura.Channel.World.Entities.Creature
guild Guild
application string
return void

ChangeStone() public method

Changes the look of the guild's stone.
public ChangeStone ( Guild guild, GuildStoneType stoneType ) : void
guild Guild
stoneType GuildStoneType
return void

ConvertPlayPoints() public method

Gives all of creature's play points to guild as guild points.
public ConvertPlayPoints ( Creature creature, Guild guild ) : void
creature Aura.Channel.World.Entities.Creature
guild Guild
return void

CreateGuild() public method

Creates new guild with the members from the party.
/// Thrown if one of the party members already is in a guild. ///
public CreateGuild ( Party party, string name, GuildType type, GuildVisibility visibility ) : void
party Party
name string
type GuildType
visibility GuildVisibility
return void

DestroyStone() public method

Destroy's guild's stone.
public DestroyStone ( Guild guild ) : void
guild Guild
return void

DonateGold() public method

Donates the given amount of gold from the creature to guild.
public DonateGold ( Creature creature, Guild guild, int amount ) : void
creature Aura.Channel.World.Entities.Creature
guild Guild
amount int
return void

DonateItem() public method

Donates the given item from the creature to guild. The item is converted to its worth, e.g. Gold and checks add their actual amounts, while other items use their sell price.
While it's seemingly pointless to make a dedicated DonateItem method, maybe we can use this for something at some point, e.g. donating items that other members can retrieve?
public DonateItem ( Creature creature, Guild guild, Item item ) : void
creature Aura.Channel.World.Entities.Creature
guild Guild
item Item
return void

GuildManager() public method

Creates new manager instance.
public GuildManager ( ) : Aura.Channel.Network.Sending
return Aura.Channel.Network.Sending

Initialize() public method

Initializes manager, loading all guilds from database and subscribing to relevant events.
public Initialize ( ) : void
return void

LoadGuild() protected method

Loads given guild.
protected LoadGuild ( Guild guild ) : void
guild Guild
return void

OnSyncGuildAdded() protected method

Called when a guild is added during synchronization.
As long as guilds are only created by players at run-time this should generally never do anything, because all members that need to be updated will be on the channel where the guild was created.
protected OnSyncGuildAdded ( Guild guild ) : void
guild Guild
return void

OnSyncGuildMemberAccepted() protected method

Called when a member's rank changes from Applied to !Declined during synchronization.
protected OnSyncGuildMemberAccepted ( Guild guild, GuildMember member ) : void
guild Guild
member GuildMember
return void

OnSyncGuildMemberAdded() protected method

Called when a guild member is added during synchronization.
Shouldn't happen during normal game-play, as the member is added to the guild when they apply.
protected OnSyncGuildMemberAdded ( Guild guild, GuildMember member ) : void
guild Guild
member GuildMember
return void

OnSyncGuildMemberDeclined() protected method

Called when a member's rank changes from Applied to Declined during synchronization.
protected OnSyncGuildMemberDeclined ( Guild guild, GuildMember member ) : void
guild Guild
member GuildMember
return void

OnSyncGuildMemberRemoved() protected method

Called when a guild member is removed during synchronization.
Happens when a member leaves, is kicked, or is removed from the db on another channel.
protected OnSyncGuildMemberRemoved ( Guild guild, GuildMember member ) : void
guild Guild
member GuildMember
return void

OnSyncGuildMemberUpdated() protected method

Called when a member's rank changed during synchronization.
For example, when the leader changed their rank.
protected OnSyncGuildMemberUpdated ( Guild guild, GuildMember member ) : void
guild Guild
member GuildMember
return void

OnSyncGuildRemoved() protected method

Called when a guild is removed during synchronization.
This will happen if a guild is disbanded from this or another channel.
protected OnSyncGuildRemoved ( Guild guild ) : void
guild Guild
return void

PlaceStone() public method

Places stone for guild in world.
public PlaceStone ( Guild guild ) : void
guild Guild
return void

SetGuildForCharacter() public method

Sets the character's Guild and GuildMember properties if they're in a guild.
public SetGuildForCharacter ( Creature character ) : void
character Creature
return void

SetStone() public method

Places stone and saves its location to database.
public SetStone ( Guild guild ) : void
guild Guild
return void