Example #1
0
        /// <summary>
        /// Unsubscribe all marked rpcs on listener
        /// </summary>
        /// <param name="listener"></param>
        public void Unsubscribe(object listener)
        {
            var cType = listener.GetType();

            if (cType == typeof(NetworkView)) //speedup
            {
                return;
            }

            RpcSubscriber.ForEachRpc <RpcAttribute>(cType, (method, parms, parmTypes, tokens) =>
            {
                foreach (var token in tokens)
                {
                    UnsubscribeRpc(token.Item2.RpcId);
                }
            });
        }
 /// <summary>
 /// Subscribe all the marked rpcs on the supplied component
 /// </summary>
 /// <param name="component"></param>
 public void SubscribeMarkedRpcsOnComponent(object component)
 {
     RpcSubscriber.SubscribeComponent <NetMessageInfo, RpcAttribute>(this, component, Room.Serializer, Debug.Logger);
 }
Example #3
0
 public void SubscribeRpcsOnObject(object obj)
 {
     RpcSubscriber.SubscribeObject <RpcAttribute>(this, obj, _room.Serializer, Debug.Logger);
 }
Example #4
0
 /// <summary>
 /// Subscribe all the marked rpcs on the supplied object
 /// </summary>
 /// <param name="obj"></param>
 public void SubscribeRpcsOnObject(object obj)
 {
     RpcSubscriber.SubscribeObject <NetMessageInfo, RpcAttribute>(this, obj, Serializer, Debug.Logger);
 }