public static MarryRoom CreateMarryRoomFromDB(MarryRoomInfo roomInfo, int timeLeft)
 {
     MarryRoomMgr._locker.AcquireWriterLock();
     try
     {
         MarryRoom marryRoom = new MarryRoom(roomInfo, MarryRoomMgr._processor);
         if (marryRoom != null)
         {
             MarryRoomMgr._Rooms.Add(marryRoom.Info.ID, marryRoom);
             marryRoom.BeginTimer(60000 * timeLeft);
             return(marryRoom);
         }
     }
     finally
     {
         MarryRoomMgr._locker.ReleaseWriterLock();
     }
     return(null);
 }
Exemple #2
0
        public static MarryRoom CreateMarryRoomFromDB(MarryRoomInfo roomInfo, int timeLeft)
        {
            MarryRoom room = null;

            _locker.AcquireWriterLock();
            try
            {
                room = new MarryRoom(roomInfo, _processor);
                if (room != null)
                {
                    _Rooms.Add(room.Info.ID, room);

                    room.BeginTimer(60 * 1000 * timeLeft);
                    return(room);
                }
            }
            finally
            {
                _locker.ReleaseWriterLock();
            }

            return(null);
        }