@@ -74,8 +74,9 @@ await this.database.SendNotification(user.UserId,
7474 return this . BadRequest ( ) ;
7575 }
7676
77+ // Prevent duplicate slot uploads unless the original slot creator is the new creator
7778 if ( ! ServerConfiguration . Instance . UserGeneratedContentLimits . DuplicateSlotUploadingEnabled
78- && await this . database . Slots . AnyAsync ( s => s . RootLevel == slot . RootLevel ) )
79+ && await this . database . Slots . AnyAsync ( s => s . RootLevel == slot . RootLevel && s . CreatorId != user . UserId ) )
7980 {
8081 Logger . Warn ( "Rejecting level upload, rootlevel is duplicate" , LogArea . Publish ) ;
8182 await this . database . SendNotification ( user . UserId ,
@@ -149,6 +150,16 @@ await this.database.SendNotification(user.UserId,
149150 $ "{ slot . Name } failed to publish. (LH-PUB-0003)") ;
150151 return this . BadRequest ( ) ;
151152 }
153+
154+ if ( ! ServerConfiguration . Instance . UserGeneratedContentLimits . DuplicateSlotUploadingEnabled
155+ && await this . database . Slots . AnyAsync ( s => s . RootLevel == slot . RootLevel && s . CreatorId != user . UserId ) )
156+ {
157+ Logger . Warn ( "Rejecting level upload, rootlevel is duplicate" , LogArea . Publish ) ;
158+ await this . database . SendNotification ( user . UserId ,
159+ $ "{ slot . Name } failed to publish. (LH-PUB-0011)") ;
160+ return this . BadRequest ( ) ;
161+ }
162+
152163 // Yes Rider, this isn't null
153164 Debug . Assert ( slot . Resources != null , "slot.ResourceList != null" ) ;
154165
0 commit comments