Show / Hide Table of Contents

Interface INetworkEventHandler

Namespace: Eco.Shared.Networking
Assembly: Eco.Shared.dll
Syntax
public interface INetworkEventHandler

Methods

ReceiveEvent(INetClient, NetworkEvent, BSONValue)

Declaration
void ReceiveEvent(INetClient client, NetworkEvent netEvent, BSONValue bson)
Parameters
Type Name Description
INetClient client
NetworkEvent netEvent
BSONValue bson

SendEvent(NetworkEvent, BSONValue, INetClient, INetObject)

Sends network event to destination target with respect to order of previously queued events.

Declaration
void SendEvent(NetworkEvent netEvent, BSONValue data, INetClient target, INetObject netObj)
Parameters
Type Name Description
NetworkEvent netEvent
BSONValue data
INetClient target
INetObject netObj

SendEvent<TScopeAwareEnumerable>(NetworkEvent, BSONValue, 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
virtual void SendEvent<TScopeAwareEnumerable>(NetworkEvent netEvent, BSONValue data, TScopeAwareEnumerable targets, INetObject netObj)
    where TScopeAwareEnumerable : IScopeAwareEnumerable<INetClient>
Parameters
Type Name Description
NetworkEvent netEvent
BSONValue data
TScopeAwareEnumerable targets
INetObject netObj
Type Parameters
Name Description
TScopeAwareEnumerable

SendEventNow(NetworkEvent, BSONValue, INetClient)

Sends network event immediately if possible ignoring previously queued events. If not possible then fallback to SendEvent behavior. It also makes all encoding and serialization in current thread.

Declaration
void SendEventNow(NetworkEvent netEvent, BSONValue data, INetClient target)
Parameters
Type Name Description
NetworkEvent netEvent
BSONValue data
INetClient target

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾