Class GuildController
Character guild controller. Manages guild membership, events, and synchronization for a character.
public class GuildController : CharacterBehaviour, IGuildController, ICharacterBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourNetworkBehaviourGuildController
- Implements
- Inherited Members
-
NetworkBehaviour.IsSpawnedNetworkBehaviour.ComponentIndexNetworkBehaviour.NetworkObjectNetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURSNetworkBehaviour.UNSET_NETWORKBEHAVIOUR_IDNetworkBehaviour.ToString()NetworkBehaviour.Reset()NetworkBehaviour.OnValidate()NetworkBehaviour.IsBehaviourReconcilingNetworkBehaviour.ClearReplicateCache()NetworkBehaviour.CreateReconcile()NetworkBehaviour.Reconcile_Reader<T>(PooledReader, ref T)NetworkBehaviour.OnStartServerCalledNetworkBehaviour.OnStartClientCalledNetworkBehaviour.WritePayload(NetworkConnection, Writer)NetworkBehaviour.ReadPayload(NetworkConnection, Reader)NetworkBehaviour.OnStartNetwork()NetworkBehaviour.OnStopNetwork()NetworkBehaviour.OnStartServer()NetworkBehaviour.OnStopServer()NetworkBehaviour.OnOwnershipServer(NetworkConnection)NetworkBehaviour.OnSpawnServer(NetworkConnection)NetworkBehaviour.OnDespawnServer(NetworkConnection)NetworkBehaviour.OnStartClient()NetworkBehaviour.OnStopClient()NetworkBehaviour.OnOwnershipClient(NetworkConnection)NetworkBehaviour.ClearBuffedRpcs()NetworkBehaviour.ExcludeOwnerFromUnbufferedObserversRpcsNetworkBehaviour.IsClientOnlyNetworkBehaviour.IsServerOnlyNetworkBehaviour.IsHostNetworkBehaviour.IsClientNetworkBehaviour.IsServerNetworkBehaviour.IsDeinitializingNetworkBehaviour.NetworkManagerNetworkBehaviour.ServerManagerNetworkBehaviour.ClientManagerNetworkBehaviour.ObserverManagerNetworkBehaviour.TransportManagerNetworkBehaviour.TimeManagerNetworkBehaviour.SceneManagerNetworkBehaviour.PredictionManagerNetworkBehaviour.RollbackManagerNetworkBehaviour.NetworkObserverNetworkBehaviour.IsClientInitializedNetworkBehaviour.IsClientStartedNetworkBehaviour.IsClientOnlyInitializedNetworkBehaviour.IsClientOnlyStartedNetworkBehaviour.IsServerInitializedNetworkBehaviour.IsServerStartedNetworkBehaviour.IsServerOnlyInitializedNetworkBehaviour.IsServerOnlyStartedNetworkBehaviour.IsHostInitializedNetworkBehaviour.IsHostStartedNetworkBehaviour.IsOfflineNetworkBehaviour.IsNetworkedNetworkBehaviour.GetIsNetworked()NetworkBehaviour.IsManagerReconcilingNetworkBehaviour.ObserversNetworkBehaviour.IsOwnerNetworkBehaviour.IsControllerNetworkBehaviour.HasAuthorityNetworkBehaviour.OwnerNetworkBehaviour.OwnerIdNetworkBehaviour.ObjectIdNetworkBehaviour.LocalConnectionNetworkBehaviour.OwnerMatches(NetworkConnection)NetworkBehaviour.Despawn(GameObject, DespawnType?)NetworkBehaviour.Despawn(NetworkObject, DespawnType?)NetworkBehaviour.Despawn(DespawnType?)NetworkBehaviour.Spawn(GameObject, NetworkConnection, Scene)NetworkBehaviour.Spawn(NetworkObject, NetworkConnection, Scene)NetworkBehaviour.RemoveOwnership()NetworkBehaviour.GiveOwnership(NetworkConnection)NetworkBehaviour.GetInstance<T>()NetworkBehaviour.TryRegisterInstance<T>(T)NetworkBehaviour.UnregisterInstance<T>()NetworkBehaviour.CanLog(LoggingType)MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.nameObject.hideFlags
Properties
ID
The unique guild ID for this character. Synchronized over the network.
public long ID { get; set; }
Property Value
LeaderRankOrder
The highest rank order that exists in this guild — the leader's seat.
public byte LeaderRankOrder { get; set; }
Property Value
OnGuildJoinTriggers
Triggers invoked when the character joins a guild.
public List<Trigger> OnGuildJoinTriggers { get; }
Property Value
OnGuildLeaveTriggers
Triggers invoked when the character leaves a guild.
public List<Trigger> OnGuildLeaveTriggers { get; }
Property Value
Permissions
The permissions the character's rank holds, as computed by the server.
public GuildPermissions Permissions { get; set; }
Property Value
RankOrder
The character's position on the guild's rank ladder. Zero means "not in a guild".
public byte RankOrder { get; set; }
Property Value
Methods
HasGuildPermission(GuildPermissions)
Convenience test for a single permission on the cached mask.
public bool HasGuildPermission(GuildPermissions permission)
Parameters
permissionGuildPermissionsThe permission to test.
Returns
- bool
True when the cached mask holds every bit in
permission.
Remarks
Presentation and pre-filtering only. A server-side decision must go through the guild's rank rows; this reads a value that may be one broadcast out of date.
OnAwake()
Called when the object is awakened. Subscribes to guild ID changes.
public override void OnAwake()
OnClientGuildAddBroadcastReceived(GuildAddBroadcast, Channel)
When we add a new guild member to the guild.
public void OnClientGuildAddBroadcastReceived(GuildAddBroadcast msg, Channel channel)
Parameters
msgGuildAddBroadcastchannelChannel
OnClientGuildAddMultipleBroadcastReceived(GuildAddMultipleBroadcast, Channel)
When we need to add guild members.
public void OnClientGuildAddMultipleBroadcastReceived(GuildAddMultipleBroadcast msg, Channel channel)
Parameters
msgGuildAddMultipleBroadcastchannelChannel
OnClientGuildApplicationListBroadcastReceived(GuildApplicationListBroadcast, Channel)
Handles the guild's pending application queue.
public void OnClientGuildApplicationListBroadcastReceived(GuildApplicationListBroadcast msg, Channel channel)
Parameters
msgGuildApplicationListBroadcastThe application list broadcast message.
channelChannelThe network channel the broadcast was received on.
Remarks
Only ever delivered to a client whose rank holds ManageApplications — the server
does not send the queue to anybody else, so there is nothing to filter here.
OnClientGuildDirectoryBroadcastReceived(GuildDirectoryBroadcast, Channel)
Handles a page of the recruitment directory.
public void OnClientGuildDirectoryBroadcastReceived(GuildDirectoryBroadcast msg, Channel channel)
Parameters
msgGuildDirectoryBroadcastThe directory broadcast message.
channelChannelThe network channel the broadcast was received on.
OnClientGuildInfoBroadcastReceived(GuildInfoBroadcast, Channel)
Handles the guild information broadcast (name, notice, message of the day).
public void OnClientGuildInfoBroadcastReceived(GuildInfoBroadcast msg, Channel channel)
Parameters
msgGuildInfoBroadcastThe guild information broadcast message.
channelChannelThe network channel the broadcast was received on.
Remarks
Delivered on join and again whenever a leader or officer edits the text, so the panel never has to ask for it. Not filtered by ID here: the server only sends this to members of the guild it describes, and a client that filtered on its own (possibly not-yet-updated) guild ID would drop the copy that arrives alongside the join.
OnClientGuildInviteBroadcastReceived(GuildInviteBroadcast, Channel)
When the character receives an invitation to join a guild. Note msg.targetClientID should be our own ClientId but it doesn't matter if it changes. Server has authority.
public void OnClientGuildInviteBroadcastReceived(GuildInviteBroadcast msg, Channel channel)
Parameters
msgGuildInviteBroadcastchannelChannel
OnClientGuildLeaveBroadcastReceived(GuildLeaveBroadcast, Channel)
When our local client leaves the guild.
public void OnClientGuildLeaveBroadcastReceived(GuildLeaveBroadcast msg, Channel channel)
Parameters
msgGuildLeaveBroadcastchannelChannel
OnClientGuildLogBroadcastReceived(GuildLogBroadcast, Channel)
Handles the guild activity log broadcast.
public void OnClientGuildLogBroadcastReceived(GuildLogBroadcast msg, Channel channel)
Parameters
msgGuildLogBroadcastThe guild log broadcast message.
channelChannelThe network channel the broadcast was received on.
OnClientGuildRankListBroadcastReceived(GuildRankListBroadcast, Channel)
Handles the guild rank ladder broadcast.
public void OnClientGuildRankListBroadcastReceived(GuildRankListBroadcast msg, Channel channel)
Parameters
msgGuildRankListBroadcastThe rank list broadcast message.
channelChannelThe network channel the broadcast was received on.
Remarks
This message, not GuildAddBroadcast, is what establishes what the local player may DO. The server sends the viewer's own mask inside it rather than expecting the client to look its rank up in the ladder, so that the panel and the server always agree about which buttons should exist.
OnClientGuildRecruitmentInfoBroadcastReceived(GuildRecruitmentInfoBroadcast, Channel)
Handles the guild's own recruitment advertisement broadcast.
public void OnClientGuildRecruitmentInfoBroadcastReceived(GuildRecruitmentInfoBroadcast msg, Channel channel)
Parameters
msgGuildRecruitmentInfoBroadcastThe recruitment info broadcast message.
channelChannelThe network channel the broadcast was received on.
OnClientGuildRemoveBroadcastReceived(GuildRemoveBroadcast, Channel)
When we need to remove guild members.
public void OnClientGuildRemoveBroadcastReceived(GuildRemoveBroadcast msg, Channel channel)
Parameters
msgGuildRemoveBroadcastchannelChannel
OnClientGuildResultBroadcastReceived(GuildResultBroadcast, Channel)
Handles a guild result broadcast from the server (e.g., creation success, name taken).
public void OnClientGuildResultBroadcastReceived(GuildResultBroadcast msg, Channel channel)
Parameters
msgGuildResultBroadcastThe guild result broadcast message.
channelChannelThe network channel the broadcast was received on.
OnDestroying()
Called when the object is being destroyed. Unsubscribes from guild ID changes.
public override void OnDestroying()
OnStartCharacter()
Called when the character starts. Registers guild broadcast handlers on the owning client.
public override void OnStartCharacter()
OnStopCharacter()
Called when the character stops. Unregisters guild broadcast handlers on the owning client.
public override void OnStopCharacter()
Events
OnAddGuildMember
Event triggered when a guild member is added, or their roster row changes.
public event Action<GuildAddBroadcast> OnAddGuildMember
Event Type
OnLeaveGuild
Event triggered when leaving a guild.
public event Action OnLeaveGuild
Event Type
OnReceiveGuildApplications
Event triggered when the guild's pending application queue arrives.
public event Action<GuildApplicationEntry[]> OnReceiveGuildApplications
Event Type
OnReceiveGuildDirectory
Event triggered when a page of the recruitment directory arrives.
public event Action<GuildDirectoryEntry[]> OnReceiveGuildDirectory
Event Type
OnReceiveGuildInfo
Event triggered when the guild's descriptive text arrives. Parameters: guild ID, name, notice, message of the day.
public event Action<long, string, string, string> OnReceiveGuildInfo
Event Type
OnReceiveGuildInvite
Event triggered when a guild invite is received. Parameter: inviter's character ID.
public event Action<long> OnReceiveGuildInvite
Event Type
OnReceiveGuildLog
Event triggered when the guild's recent activity log arrives. Parameters: guild ID, entries (newest first).
public event Action<long, GuildLogEntry[]> OnReceiveGuildLog
Event Type
- Action<long, GuildLogEntry[]>
OnReceiveGuildRanks
Event triggered when the guild's rank ladder arrives.
public event Action<GuildRankListBroadcast> OnReceiveGuildRanks
Event Type
OnReceiveGuildRecruitmentInfo
Event triggered when the guild's own recruitment advertisement arrives.
public event Action<GuildRecruitmentInfoBroadcast> OnReceiveGuildRecruitmentInfo
Event Type
OnReceiveGuildResult
Event triggered when a guild result is received. Parameter: result type.
public event Action<GuildResultType> OnReceiveGuildResult
Event Type
OnRemoveGuildMember
Event triggered when a guild member is removed. Parameter: member ID.
public event Action<long> OnRemoveGuildMember
Event Type
OnValidateGuildMembers
Event triggered to validate the set of guild members. Parameter: set of member IDs.
public event Action<HashSet<long>> OnValidateGuildMembers