Example #1
0
 public static PlayerAvatar[] GetPlayerAvatars(int playerId)
 {
     PlayerAvatar item = new PlayerAvatar();
     item.mPlayerID = playerId;
     item.mAvatarID = 0;
     MappedObjectList<PlayerAvatar> objects = new QuazalQuery("GetPlayerAvatarsByID", new object[] { playerId }).GetObjects<PlayerAvatar>();
     objects.Insert(0, item);
     return objects.ToArray();
 }
Example #2
0
 public IAdditionalContent[] GetMyUploads()
 {
     if (!base.ContentType.CurrentUserCanUpload)
     {
         return new IAdditionalContent[0];
     }
     MappedObjectList<CustomMap> objects = new QuazalQuery("GetMyUploadedMaps", new object[0]).GetObjects<CustomMap>();
     if (objects == null)
     {
         return new CustomMap[0];
     }
     return objects.ToArray();
 }
Example #3
0
 internal void GatherLadderReports()
 {
     ThreadQueue.QueueUserWorkItem(delegate (object state) {
         try
         {
             MappedObjectList<LadderGameSession> objects = new QuazalQuery("GetUnreportedLadderGameSessions", new object[] { User.Current.ID }).GetObjects<LadderGameSession>();
             foreach (LadderGameSession session in objects)
             {
                 VGen0 method = null;
                 MappedObjectList<LadderGameSession> allParticipants = new QuazalQuery("GetGameSessionMembersByGameID", new object[] { session.GameID }).GetObjects<LadderGameSession>();
                 if (((base.InvokeRequired && !base.Disposing) && !base.IsDisposed) && base.IsHandleCreated)
                 {
                     if (method == null)
                     {
                         method = delegate {
                             if (this.LadderGamePlayed != null)
                             {
                                 this.LadderGamePlayed(this, EventArgs.Empty);
                             }
                             new DlgLadderReport(allParticipants.ToArray()).ShowDialog();
                         };
                     }
                     base.BeginInvoke(method);
                 }
                 else if ((!base.Disposing && !base.IsDisposed) && base.IsHandleCreated)
                 {
                     if (this.LadderGamePlayed != null)
                     {
                         this.LadderGamePlayed(this, EventArgs.Empty);
                     }
                     new DlgLadderReport(allParticipants.ToArray()).ShowDialog();
                 }
             }
         }
         catch (Exception exception)
         {
             ErrorLog.WriteLine("Error gathering ladder reports.", new object[0]);
             ErrorLog.WriteLine(exception);
         }
     }, new object[0]);
 }