Show / Hide Table of Contents

Class RPCManager

Manager responsible for RPC lookup and invocation.

Inheritance
System.Object
RPCManager
Namespace: Eco.Shared.Networking
Assembly: Eco.Shared.dll
Syntax
public class RPCManager : Object

Constructors

RPCManager()

Declaration
public RPCManager()

Fields

LogRPCResponseTime

Declaration
public static Action<TimeSpan> LogRPCResponseTime
Field Value
Type Description
System.Action<System.TimeSpan>

QueryKey

Declaration
public const string QueryKey = "query"
Field Value
Type Description
System.String

RPCLogger

Declaration
public static PerformanceManager RPCLogger
Field Value
Type Description
PerformanceManager

Properties

ControllerManager

Declaration
public static object ControllerManager { get; }
Property Value
Type Description
System.Object

TaskScheduler

Declaration
public static TaskScheduler TaskScheduler { get; set; }
Property Value
Type Description
System.Threading.Tasks.TaskScheduler

Methods

Call(String, INetObject, INetClient, Action, Object[])

Declaration
public static void Call(string methodname, INetObject obj, INetClient target, Action resultCallback, params object[] args)
Parameters
Type Name Description
System.String methodname
INetObject obj
INetClient target
System.Action resultCallback
System.Object[] args

Call(String, INetObject, INetClient, Object[])

Declaration
public static void Call(string methodname, INetObject obj, INetClient target, params object[] args)
Parameters
Type Name Description
System.String methodname
INetObject obj
INetClient target
System.Object[] args

Call<T>(String, INetObject, INetClient, Action<T>, Object[])

Declaration
public static void Call<T>(string methodname, INetObject obj, INetClient target, Action<T> resultCallback, params object[] args)
Parameters
Type Name Description
System.String methodname
INetObject obj
INetClient target
System.Action<T> resultCallback
System.Object[] args
Type Parameters
Name Description
T

CreateLookupsForDerived(Type)

Declaration
public static void CreateLookupsForDerived(Type basetype)
Parameters
Type Name Description
System.Type basetype

GetMethodId(String)

Declaration
public static int GetMethodId(string key)
Parameters
Type Name Description
System.String key
Returns
Type Description
System.Int32

GetOrBuildLookup(Type)

Declaration
public static Dictionary<string, RPCMethod[]> GetOrBuildLookup(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Collections.Generic.Dictionary<System.String, RPCMethod[]>

GetRPC(Int32)

Declaration
public static RPCMethod GetRPC(int id)
Parameters
Type Name Description
System.Int32 id
Returns
Type Description
RPCMethod

HandleQueryResponse(BSONObject)

Declaration
public static void HandleQueryResponse(BSONObject bson)
Parameters
Type Name Description
BSONObject bson

HandleReceiveRPC(INetClient, BSONObject)

Declaration
public static Task HandleReceiveRPC(INetClient client, BSONObject bson)
Parameters
Type Name Description
INetClient client
BSONObject bson
Returns
Type Description
System.Threading.Tasks.Task

HasRPCOnType(Type, String)

Declaration
public static bool HasRPCOnType(Type type, string name)
Parameters
Type Name Description
System.Type type
System.String name
Returns
Type Description
System.Boolean

Invoke(INetClient, RPCInvocation, Boolean)

Invokes invocation with access permissions check.

Declaration
public static object Invoke(INetClient client, RPCInvocation invocation, bool notifyOnPermissionFail = true)
Parameters
Type Name Description
INetClient client
RPCInvocation invocation
System.Boolean notifyOnPermissionFail
Returns
Type Description
System.Object

InvokeOn(INetClient, BSONObject, Object, String)

Declaration
public static object InvokeOn(INetClient client, BSONObject bson, object target, string methodName)
Parameters
Type Name Description
INetClient client
BSONObject bson
System.Object target
System.String methodName
Returns
Type Description
System.Object

ResolveMethodName(String)

Resolves method name from method id or method name.

Declaration
public static string ResolveMethodName(string methodIdOrName)
Parameters
Type Name Description
System.String methodIdOrName
Returns
Type Description
System.String

RPCs(Type)

Declaration
public static IEnumerable<KeyValuePair<string, RPCMethod[]>> RPCs(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, RPCMethod[]>>

SetKeyToIdMapping(BSONArray)

Declaration
public static void SetKeyToIdMapping(BSONArray rpcInfos)
Parameters
Type Name Description
BSONArray rpcInfos

TryCreateAndAddQuery(BSONObject, Action, INetClient, String)

Try creating an Eco.Shared.Networking.RPCManager.AwaitedQuery using the given callback and bind it to the given BSONObject

Declaration
public static bool TryCreateAndAddQuery(BSONObject bson, Action callback, INetClient target, string methodName)
Parameters
Type Name Description
BSONObject bson
System.Action callback
INetClient target
System.String methodName
Returns
Type Description
System.Boolean

TryCreateAndAddQuery<T>(BSONObject, Action<T>, INetClient, String)

Try creating an Eco.Shared.Networking.RPCManager.AwaitedQuery using the given callback and bind it to the given BSONObject

Declaration
public static bool TryCreateAndAddQuery<T>(BSONObject bson, Action<T> callback, INetClient target, string methodName)
Parameters
Type Name Description
BSONObject bson
System.Action<T> callback
INetClient target
System.String methodName
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

TryCreateInvocation(INetClient, Object, String, BSONArray, out RPCInvocation)

Declaration
public static bool TryCreateInvocation(INetClient client, object target, string methodName, BSONArray bsonArgs, out RPCInvocation invocation)
Parameters
Type Name Description
INetClient client
System.Object target
System.String methodName
BSONArray bsonArgs
RPCInvocation invocation
Returns
Type Description
System.Boolean

TryCreateInvocation(INetClient, Object, String, IList<Object>, out RPCInvocation)

Declaration
public static bool TryCreateInvocation(INetClient client, object target, string methodName, IList<object> packedArgs, out RPCInvocation invocation)
Parameters
Type Name Description
INetClient client
System.Object target
System.String methodName
System.Collections.Generic.IList<System.Object> packedArgs
RPCInvocation invocation
Returns
Type Description
System.Boolean

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
☀
☾