Exemple #1
0
 public void add_service_listener(int stype, net_message_handle handle)
 {
     if (event_listeners.ContainsKey(stype))
     {
         event_listeners[stype] += handle;
     }
     else
     {
         event_listeners.Add(stype, handle);
     }
 }
Exemple #2
0
 public void remove_service_listener(int stype, net_message_handle handle)
 {
     if (!event_listeners.ContainsKey(stype))
     {
         return;
     }
     else
     {
         event_listeners[stype] -= handle;
         if (event_listeners[stype] == null)
         {
             event_listeners.Remove(stype);
         }
     }
 }