Example #1
0
 public void SetUserState(ICollection <long> states, Zeze.Net.Binary statex)
 {
     lock (this) // 简单使用一下这个锁。
     {
         UserStates.Clear();
         UserStates.AddRange(states);
         UserStatex = statex;
     }
 }
Example #2
0
        void HandleJoinRoomCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            var newRoom = (RoomInfo)e.UserState;

            lock (_locker)
            {
                _roomInfo = newRoom;
                RoomName  = newRoom.Name.ToUpper();
                UserStates.Clear();
                Start();
            }
        }