public static void Dispatcher(PlanConfig planconfig) { if (ScriptEngines.IsCompiling) { return; } if (MsgList.Count <= 0) { return; } int count = Math.Min(MsgList.Count, 100); var list = MsgList.GetListRange(0, count); foreach (var v in list) { v.IsRemove = true; GameSession session = GameSession.Get(v.UserId); if (session != null && session.Connected && v.Param != null) { switch (v.Type) { case MsgType.Chat: { var packet = ActionFactory.GetResponsePackage(ActionIDDefine.Cst_Action2000, session, v.Param, OpCode.Text, null ); ActionFactory.SendAction(session, ActionIDDefine.Cst_Action2000, packet, (rsession, asyncResult) => { }, 0); } break; case MsgType.Notice: { var packet = ActionFactory.GetResponsePackage(ActionIDDefine.Cst_Action2001, session, v.Param, OpCode.Text, null ); ActionFactory.SendAction(session, ActionIDDefine.Cst_Action2001, packet, (rsession, asyncResult) => { }, 0); } break; } } } MsgList.RemoveAll(t => t.IsRemove == true); }