Class NetObject
Inheritance
System.Object
NetObject
Assembly: Eco.Shared.dll
Syntax
public sealed class NetObject : Object
Properties
Active
Declaration
public bool Active { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Controller
Declaration
public INetObject Controller { get; }
Property Value
EventHandler
Declaration
public static INetworkEventHandler EventHandler { set; }
Property Value
ID
Declaration
Property Value
| Type |
Description |
| System.Int32 |
|
Methods
AddNetworkInteceptor(INetworkInterceptor)
Declaration
public static void AddNetworkInteceptor(INetworkInterceptor interceptor)
Parameters
ClearEventHandler()
Declaration
public static void ClearEventHandler()
ClearNetworkInterceptors()
Declaration
public static void ClearNetworkInterceptors()
Create()
Declaration
Destroy()
Declaration
InstantiateAndCreate(INetObject, Boolean)
Declaration
public static NetObject InstantiateAndCreate(INetObject controller, bool active)
Parameters
| Type |
Name |
Description |
| INetObject |
controller |
|
| System.Boolean |
active |
|
Returns
InstantiateAndCreate(INetObject, Int32)
Makes new instance of NetObject for controller with pre-defined id and then Create() it.
Declaration
public static NetObject InstantiateAndCreate(INetObject controller, int id)
Parameters
| Type |
Name |
Description |
| INetObject |
controller |
|
| System.Int32 |
id |
|
Returns
ReceiveEvent(INetClient, NetworkEvent, BSONValue)
Declaration
public static void ReceiveEvent(INetClient client, NetworkEvent netEvent, BSONValue bson)
Parameters
RemoveNetworkInterceptor(INetworkInterceptor)
Declaration
public static bool RemoveNetworkInterceptor(INetworkInterceptor interceptor)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
SendEvent(NetworkEvent, BSONObject, INetClient, INetObject)
Declaration
public static void SendEvent(NetworkEvent netEvent, BSONObject bsonObj, INetClient target, INetObject netObj = null)
Parameters
SendEvent<TScopeAwareEnumerable>(NetworkEvent, BSONObject, TScopeAwareEnumerable, INetObject)
Send event to multiple clients at once. It requires IScopeAwareEnumerable<T> for targets because may process them asynchronously and save reference to enumerable for future usage.
Explicit scope control allow us to prevent errors when targets only valid in scope of calling method and avoid defensive copy to prevent such errors when targets safe to reference outside of scope (i.e. when they're immutable or unowned right after passing to method).
Declaration
public static void SendEvent<TScopeAwareEnumerable>(NetworkEvent netEvent, BSONObject bsonObj, TScopeAwareEnumerable targets, INetObject netObj = null)
where TScopeAwareEnumerable : IScopeAwareEnumerable<INetClient>
Parameters
Type Parameters
| Name |
Description |
| TScopeAwareEnumerable |
|
SendEventNow(NetworkEvent, BSONObject, INetClient)
Sends event immediately if possible ignoring previously queued messages. As side effect it makes encoding in current thread instead of network thread.
Declaration
public static void SendEventNow(NetworkEvent netEvent, BSONObject bsonObj, INetClient target)
Parameters
Extension Methods