Exemplo n.º 1
0
        private void Send(uint sessionId, byte[] buffer)
        {
            NetSession session = this.GetSession(sessionId);

            if (session == null)
            {
                Logger.Warn($"invalid sessionID:{sessionId}", 2, 5);
                return;
            }
            session.Send(buffer, buffer.Length);
        }
Exemplo n.º 2
0
 private void Send(SessionType sessionType, byte[] buffer, bool once)
 {
     foreach (KeyValuePair <uint, NetSession> kv in this._idToSession)
     {
         NetSession session = kv.Value;
         if (session.type != sessionType)
         {
             continue;
         }
         session.Send(buffer, buffer.Length);
         if (once)
         {
             break;
         }
     }
 }