postMail() 공개 메소드

public postMail ( KBEngine.Bundle inbundle ) : void
inbundle KBEngine.Bundle
리턴 void
예제 #1
0
        public void baseCall(string methodname, params object[] arguments)
        {
            if (KBEngineApp.app.currserver == "loginapp")
            {
                Dbg.ERROR_MSG(className + "::baseCall(" + methodname + "), currserver=!" + KBEngineApp.app.currserver);
                return;
            }

            Method method = null;

            if (!EntityDef.moduledefs[className].base_methods.TryGetValue(methodname, out method))
            {
                Dbg.ERROR_MSG(className + "::baseCall(" + methodname + "), not found method!");
                return;
            }

            UInt16 methodID = method.methodUtype;

            if (arguments.Length != method.args.Count)
            {
                Dbg.ERROR_MSG(className + "::baseCall(" + methodname + "): args(" + (arguments.Length) + "!= " + method.args.Count + ") size is error!");
                return;
            }

            baseMailbox.newMail();
            baseMailbox.bundle.writeUint16(methodID);

            try
            {
                for (var i = 0; i < method.args.Count; i++)
                {
                    if (method.args[i].isSameType(arguments[i]))
                    {
                        method.args[i].addToStream(baseMailbox.bundle, arguments[i]);
                    }
                    else
                    {
                        throw new Exception("arg" + i + ": " + method.args[i].ToString());
                    }
                }
            }
            catch (Exception e)
            {
                Dbg.ERROR_MSG(className + "::baseCall(method=" + methodname + "): args is error(" + e.Message + ")!");
                baseMailbox.bundle = null;
                return;
            }

            baseMailbox.postMail(null);
        }
예제 #2
0
        public void cellCall(string methodname, object[] arguments)
        {
            Method method   = EntityDef.moduledefs[classtype].cell_methods[methodname];
            UInt16 methodID = method.methodUtype;

            if (arguments.Length != method.args.Count)
            {
                Dbg.ERROR_MSG("Entity::cellCall: args(" + (arguments.Length) + "!= " + method.args.Count + ") size is error!");
                return;
            }

            cellMailbox.newMail();
            cellMailbox.bundle.writeUint16(methodID);

            try
            {
                for (var i = 0; i < method.args.Count; i++)
                {
                    method.args[i].addToStream(cellMailbox.bundle, arguments[i]);
                }
            }
            catch (Exception e)
            {
                Dbg.ERROR_MSG("Entity::cellCall: args is error(" + e.Message + ")!");
                cellMailbox.bundle = null;
                return;
            }

            cellMailbox.postMail(null);
        }
예제 #3
0
        public void baseCall(string methodname, object[] arguments)
        {
            if (KBEngineApp.app.currserver == "loginapp")
            {
                Dbg.ERROR_MSG(classtype + "::baseCall(" + methodname + "), currserver=!" + KBEngineApp.app.currserver);
                return;
            }

            Method method   = EntityDef.moduledefs[classtype].base_methods[methodname];
            UInt16 methodID = method.methodUtype;

            if (arguments.Length != method.args.Count)
            {
                Dbg.ERROR_MSG(classtype + "::baseCall(" + methodname + "): args(" + (arguments.Length) + "!= " + method.args.Count + ") size is error!");
                return;
            }

            baseMailbox.newMail();
            baseMailbox.bundle.writeUint16(methodID);

            try
            {
                for (var i = 0; i < method.args.Count; i++)
                {
                    method.args[i].addToStream(baseMailbox.bundle, arguments[i]);
                }
            }
            catch (Exception e)
            {
                Dbg.ERROR_MSG(classtype + "::baseCall(" + methodname + "): args is error(" + e.Message + ")!");
                baseMailbox.bundle = null;
                return;
            }

            baseMailbox.postMail(null);
        }