Exemplo n.º 1
0
 /// <summary>
 /// 踢出队员
 /// </summary>
 public bool SendOutMember(int teamId, string userId)
 {
     if (_teamList == null)
     {
         return(false);
     }
     if (_teamList.ContainsKey(teamId))
     {
         var team = _teamList[teamId];
         if (team == null || team.Status != 1)
         {
             return(false);
         }
         if (team.TeamUser.UserId.Equals(userId))
         {
             if (_userList.ContainsKey(userId))
             {
                 _userList.Remove(userId);
             }
             team.Status   = 3;//解散组队
             team.TeamUser = new TeamUser();
             team.UserList.Clear();
         }
         team.UserList.RemoveAll(m => m.UserId.Equals(userId));
         if (_userList.ContainsKey(userId))
         {
             _userList.Remove(userId);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 private static void ProcessQueue(object state)
 {
     while (_runningQueue == 1)
     {
         singal.WaitOne();
         if (_runningQueue == 1)
         {
             Thread.Sleep(100);//Delay 100ms
         }
         while (_runningQueue == 1)
         {
             BaseEntity entity;
             if (_sendQueue.TryDequeue(out entity))
             {
                 string key    = entity.GetKeyCode();
                 byte[] buffer = DoSerialize(entity);
                 _syncPools.Remove(key);
                 DoSend(entity.PersonalId, buffer);
             }
             else
             {
                 break;
             }
         }
         singal.Reset();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 释放
 /// </summary>
 /// <param name="userGuild"></param>
 public static void Dispose(UserGuild userGuild)
 {
     if (_bossGeneralList.ContainsKey(userGuild.GuildID))
     {
         _bossGeneralList[userGuild.GuildID].Clear();
     }
     if (_userGuildList.ContainsKey(userGuild.GuildID))
     {
         _userGuildList.Remove(userGuild.GuildID);
     }
 }
Exemplo n.º 4
0
 private bool Remove(int msgId)
 {
     return(_packagePools.Remove(msgId));
 }