Class RPCManager
Manager responsible for RPC lookup and invocation.
Inheritance
System.Object
RPCManager
Assembly: Eco.Shared.dll
Syntax
public class RPCManager : Object
Constructors
RPCManager()
Declaration
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
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
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
HandleQueryResponse(BSONObject)
Declaration
public static void HandleQueryResponse(BSONObject bson)
Parameters
HandleReceiveRPC(INetClient, BSONObject)
Declaration
public static Task HandleReceiveRPC(INetClient client, BSONObject bson)
Parameters
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
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
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
TryCreateInvocation(INetClient, Object, String, BSONArray, out RPCInvocation)
Declaration
public static bool TryCreateInvocation(INetClient client, object target, string methodName, BSONArray bsonArgs, out RPCInvocation invocation)
Parameters
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