public postMail ( KBEngine.Bundle inbundle ) : void | ||
inbundle | KBEngine.Bundle | |
Résultat | void |
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); }
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); }
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); }