Example #1
0
 /// <summary>
 /// Unaccepts the specified map.
 /// </summary>
 /// <param name="mapName">Name of the map.</param>
 /// <param name="tester">The tester.</param>
 /// <param name="denialMessage">The denial message.</param>
 /// <param name="isAdmin">if set to <c>true</c> [is admin].</param>
 /// <returns>A bool indicating whether the operation was successful or not</returns>
 public bool Unaccept(string mapName, string tester, string denialMessage = null, bool isAdmin = false)
 {
     var selected = this[mapName];
     bool successful = false;
     if (selected.Accepted) {
         User testerUsr = UserMan[tester];
         if (testerUsr != null) {
             selected.Accepted = false;
             if (denialMessage != null) {
                 selected.IsDenied = true;
                 Denial denial = new Denial();
                 denial.MapId = selected.Id;
                 denial.TesterId = testerUsr.Id;
                 denial.Message = denialMessage;
                 denial.Timestamp = DB.UnixTimestamp;
                 SaveDenial(denial);
             }
             successful = true;
             FB.MsgChans("Map: \"" + selected.Name + "\" accepted by " + tester);
             SaveMap(selected);
         }
     }
     return successful;
 }
Example #2
0
 /// <summary>
 /// Denies the map with the provided map name.
 /// </summary>
 /// <param name="mapName">Name of the map.</param>
 /// <param name="tester">The tester.</param>
 /// <param name="denialMessage">The denial message.</param>
 /// <param name="isAdmin">if set to <c>true</c> [is admin].</param>
 /// <returns>Whether or not the map was successfully denied.</returns>
 public bool DenyMap(string mapName, string tester, string denialMessage, bool isAdmin = false)
 {
     var selected = this[mapName];
     bool successful = false;
     if (!selected.Accepted) {
         User testerUsr = UserMan[tester];
         if (testerUsr != null) {
             selected.Accepted = false;
             if (denialMessage != null) {
                 selected.IsDenied = true;
                 Denial denial = new Denial();
                 denial.MapId = selected.Id;
                 denial.TesterId = testerUsr.Id;
                 denial.Message = denialMessage;
                 denial.Timestamp = DB.UnixTimestamp;
                 SaveDenial(denial);
             }
             successful = true;
             FB.MsgChans("Map: \"" + selected.Name + "\" accepted by " + tester);
             SaveMap(selected);
         }
     } else {
         FB.Notice(tester, "Map couldn't be denied because it has already been accepted. Instead, use:");
         FB.Notice(tester, ".unaccept \"mapname\" denial message");
     }
     return successful;
 }
Example #3
0
 /// <summary>
 /// Saves the provided Denial object to the Database.
 /// </summary>
 /// <param name="denial">The Denial instance to save</param>
 /// <returns>Whether or not the save was successful ?</returns>
 public bool SaveDenial(Denial denial)
 {
     var result = Denials.Save(denial);
     return result.DocumentsAffected > 0;
 }
Example #4
0
 public JoinedMapData(CmrMap theMap, Denial theDenial, User theMapper, User theTester)
 {
     this.denial = theDenial;
     this.map = theMap;
     this.mapper = theMapper;
     this.tester = theTester;
 }