Class MatchCondition
When this observer condition is placed on an object, a client must be within the same match to view the object.
Inheritance
Implements
Inherited Members
Namespace: FishNet.Component.Observing
Assembly: FishNet.Runtime.dll
Syntax
[CreateAssetMenu(menuName = "FishNet/Observers/Match Condition", fileName = "New Match Condition")]
public class MatchCondition : ObserverCondition, IOrderable
Methods
AddToMatch(Int32, NetworkConnection, NetworkManager, Boolean)
Adds a connection to a match.
Declaration
public static void AddToMatch(int match, NetworkConnection conn, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conn to. |
NetworkConnection | conn | Connection to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
AddToMatch(Int32, NetworkConnection[], NetworkManager, Boolean)
Adds connections to a match.
Declaration
public static void AddToMatch(int match, NetworkConnection[] conns, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conns to. |
NetworkConnection[] | conns | Connections to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
AddToMatch(Int32, NetworkObject, NetworkManager, Boolean)
Adds an object to a match.
Declaration
public static void AddToMatch(int match, NetworkObject nob, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conn to. |
NetworkObject | nob | Connection to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
AddToMatch(Int32, NetworkObject[], NetworkManager, Boolean)
Adds objects to a match.
Declaration
public static void AddToMatch(int match, NetworkObject[] nobs, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conns to. |
NetworkObject[] | nobs | Connections to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
AddToMatch(Int32, List<NetworkConnection>, NetworkManager, Boolean)
Adds connections to a match.
Declaration
public static void AddToMatch(int match, List<NetworkConnection> conns, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conns to. |
System.Collections.Generic.List<NetworkConnection> | conns | Connections to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
AddToMatch(Int32, List<NetworkObject>, NetworkManager, Boolean)
Adds objects to a match.
Declaration
public static void AddToMatch(int match, List<NetworkObject> nobs, NetworkManager manager = null, bool replaceMatch = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to add conns to. |
System.Collections.Generic.List<NetworkObject> | nobs | Connections to add to match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
System.Boolean | replaceMatch | True to replace other matches with the new match. |
ConditionMet(NetworkConnection, Boolean, out Boolean)
Returns if the object which this condition resides should be visible to connection.
Declaration
public override bool ConditionMet(NetworkConnection connection, bool currentlyAdded, out bool notProcessed)
Parameters
Type | Name | Description |
---|---|---|
NetworkConnection | connection | Connection which the condition is being checked for. |
System.Boolean | currentlyAdded | True if the connection currently has visibility of this object. |
System.Boolean | notProcessed | True if the condition was not processed. This can be used to skip processing for performance. While output as true this condition result assumes the previous ConditionMet value. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetConditionType()
How a condition is handled.
Declaration
public override ObserverConditionType GetConditionType()
Returns
Type | Description |
---|---|
ObserverConditionType |
Overrides
GetConnectionMatches(NetworkManager)
Returns connections and the matches they are in.
Declaration
public static Dictionary<NetworkConnection, HashSet<int>> GetConnectionMatches(NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | manager | NetworkManager to use. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<NetworkConnection, System.Collections.Generic.HashSet<System.Int32>> |
GetMatchConnections(NetworkManager)
Returns matches and connections in each match.
Declaration
public static Dictionary<int, HashSet<NetworkConnection>> GetMatchConnections(NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | manager | NetworkManager to use. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.HashSet<NetworkConnection>> |
GetMatchObjects(NetworkManager)
Returns matches and objects within each match.
Declaration
public static Dictionary<int, HashSet<NetworkObject>> GetMatchObjects(NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | manager | NetworkManager to use. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.HashSet<NetworkObject>> |
GetObjectMatches(NetworkManager)
Returns objects and the matches they are in.
Declaration
public static Dictionary<NetworkObject, HashSet<int>> GetObjectMatches(NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | manager | NetworkManager to use. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<NetworkObject, System.Collections.Generic.HashSet<System.Int32>> |
RemoveFromMatch(NetworkConnection, NetworkManager)
Removes a connection from all matches.
Declaration
public static void RemoveFromMatch(NetworkConnection conn, NetworkManager manager)
Parameters
Type | Name | Description |
---|---|---|
NetworkConnection | conn | NetworkConnection to remove. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(NetworkObject, NetworkManager)
Removes nob from all matches.
Declaration
public static bool RemoveFromMatch(NetworkObject nob, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkObject | nob | NetworkObject to remove. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveFromMatch(NetworkObject[], NetworkManager)
Removes a network object from all matches.
Declaration
public static void RemoveFromMatch(NetworkObject[] nobs, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
NetworkObject[] | nobs | NetworkObjects to remove. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(List<NetworkObject>, NetworkManager)
Removes network objects from all matches.
Declaration
public static void RemoveFromMatch(List<NetworkObject> nobs, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<NetworkObject> | nobs | NetworkObjects to remove. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(Int32, NetworkConnection, NetworkManager)
Removes a connection from a match.
Declaration
public static bool RemoveFromMatch(int match, NetworkConnection conn, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conn from. |
NetworkConnection | conn | Connection to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveFromMatch(Int32, NetworkConnection[], NetworkManager)
Removes connections from a match.
Declaration
public static void RemoveFromMatch(int match, NetworkConnection[] conns, NetworkManager manager)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conns from. |
NetworkConnection[] | conns | Connections to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(Int32, NetworkObject, NetworkManager)
Removes a network object from a match.
Declaration
public static void RemoveFromMatch(int match, NetworkObject nob, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conn from. |
NetworkObject | nob | NetworkObject to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(Int32, NetworkObject[], NetworkManager)
Removes network objects from a match.
Declaration
public static void RemoveFromMatch(int match, NetworkObject[] nobs, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conns from. |
NetworkObject[] | nobs | NetworkObjects to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(Int32, List<NetworkConnection>, NetworkManager)
Removes connections from a match.
Declaration
public static void RemoveFromMatch(int match, List<NetworkConnection> conns, NetworkManager manager)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conns from. |
System.Collections.Generic.List<NetworkConnection> | conns | Connections to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |
RemoveFromMatch(Int32, List<NetworkObject>, NetworkManager)
Removes network objects from a match.
Declaration
public static void RemoveFromMatch(int match, List<NetworkObject> nobs, NetworkManager manager = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | match | Match to remove conns from. |
System.Collections.Generic.List<NetworkObject> | nobs | NetworkObjects to remove from match. |
NetworkManager | manager | NetworkManager to rebuild observers on. If null InstanceFinder.NetworkManager will be used. |