Exemple #1
0
        public void Report(string methodArg, params KVString[] kvs)
        {
            HoxisProtocolAction action = new HoxisProtocolAction
            {
                method = methodArg,
                args   = new HoxisProtocolArgs(kvs),
            };

            Report(action);
        }
Exemple #2
0
        public void Report(string methodArg, Dictionary <string, string> argsArg)
        {
            HoxisProtocolAction action = new HoxisProtocolAction
            {
                method = methodArg,
                args   = new HoxisProtocolArgs {
                    values = argsArg
                },
            };

            Report(action);
        }
        public bool ResponseSuccess(string handleArg, string methodArg, params KVString[] kvs)
        {
            Dictionary <string, string> argsArg = new Dictionary <string, string>();

            argsArg.Add("code", C.RESP_SUCCESS);
            foreach (KVString kv in kvs)
            {
                argsArg.Add(kv.key, kv.val);
            }
            HoxisProtocolAction action = new HoxisProtocolAction(methodArg, new HoxisProtocolArgs(argsArg));

            return(Response(handleArg, action));
        }
        /// <summary>
        /// Response a custom result, hardly called immediately
        /// </summary>
        /// <param name="handleArg"></param>
        /// <param name="actionArg"></param>
        /// <returns></returns>
        public bool Response(string handleArg, HoxisProtocolAction actionArg)
        {
            HoxisProtocol proto = new HoxisProtocol
            {
                type     = ProtocolType.Response,
                handle   = handleArg,
                err      = C.RESP_SUCCESS,
                receiver = HoxisProtocolReceiver.undef,
                sender   = HoxisProtocolSender.undef,
                action   = actionArg,
                desc     = ""
            };

            ProtocolPost(proto);
            return(true);
        }
Exemple #5
0
        /// <summary>
        /// Report an action of this gameObject, generally syn
        /// </summary>
        /// <param name="action"></param>
        public void Report(HoxisProtocolAction actionArg)
        {
            HoxisProtocol proto = new HoxisProtocol
            {
                type     = ProtocolType.Synchronization,
                handle   = "",
                receiver = HoxisProtocolReceiver.cluster,
                sender   = new HoxisProtocolSender
                {
                    aid      = id,
                    loopback = true,
                },
                action = actionArg,
                desc   = "",
            };

            Report(proto);
        }
Exemple #6
0
 /// <summary>
 /// Call the behaviour-layer
 /// </summary>
 /// <param name="action"></param>
 public void CallBehaviour(HoxisProtocolAction action)
 {
     _behav.Act(action);
 }
 public void Act(HoxisProtocolAction action)
 {
     Act(action.method, action.args);
 }
        public bool Response(string handleArg, string methodArg, params KVString[] kvs)
        {
            HoxisProtocolAction action = new HoxisProtocolAction(methodArg, new HoxisProtocolArgs(kvs));

            return(Response(handleArg, action));
        }