Exemplo n.º 1
0
 private bool AddEvent(GlobalServerMsg id, MsgEevent msg)
 {
     if (m_handlers.ContainsKey(id))
     {
         m_handlers.Remove(id);
     }
     m_handlers.Add(id, msg);
     return(true);
 }
Exemplo n.º 2
0
        public void ExcuteEvent(int id, object args)
        {
            if (!m_handlers.ContainsKey(id))
            {
                Log.TraceWarning("DispatchNow: has not id matched for:" + id);
                return;
            }

            MsgEevent handler = m_handlers[id];

            if (handler != null)
            {
                handler(id, args);
            }
        }
Exemplo n.º 3
0
        public void ExcuteEvent(GlobalServerMsg id, object args, int ilen)
        {
            if (!m_handlers.ContainsKey(id))
            {
                LogSystem.Log("DispatchNow: has not id matched for:", id);
                return;
            }

            MsgEevent handler = m_handlers[id];

            if (handler != null)
            {
                try
                {
                    handler(id, args, ilen);
                }
                catch (System.Exception ex)
                {
                    LogSystem.LogError("ExcuteEvent: handler exception:", id, " ", ex.ToString());
                }
            }
        }