public void Brocast(Packet packet, IUserToken except = null) { lock (this._lockObj) { SendHelper.Brocast(this._users, packet, except); } }
public void Brocast(Packet packet, IUserToken except = null) { List <string> users = new List <string>(); CacheFactory.HALL_CACHE.ForeachUser(user => { users.Add(user); }); SendHelper.Brocast(users, packet, except); }
private void BrocastTeam(Room room, int teamIndex, Packet packet, IUserToken except = null) { List <Room.Player> team = teamIndex == 0 ? room.teamOne : room.teamTwo; if (team.Count == 0) { return; } List <string> users = new List <string>(); lock (CacheFactory.ROOM_CACHE.lockObj2) { int count = team.Count; for (int i = 0; i < count; i++) { users.Add(team[i].id); } } SendHelper.Brocast(users, packet, except); }