-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: pvp * new queue for pvp, playerCode * update: rename file * feat: pvp * feat: match tests for pvp * feat: store codes for pvp seperate * feat: pvp game tests * fix: pvp response * feat: add self match for pvp * update: pagination for get user-matches * feat : PvP leaderboard (#5) * feat : PvP leaderboard * fix : commit bugs * fix : commit bugs * fix: pvp leaderbord * fix: variable names * fix: queue name * fix: pvp fixes * fix: pvp commit history * fix(player_code): python state typecast * fix: pvp initial code * feat: abilities --------- Co-authored-by: Mughil Srinivasan R S <[email protected]> Co-authored-by: shubham-1806 <[email protected]>
- Loading branch information
1 parent
4b7add5
commit e68376a
Showing
71 changed files
with
2,081 additions
and
141 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
library/src/main/kotlin/delta/codecharacter/core/PvpGameApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.1.0). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
package delta.codecharacter.core | ||
|
||
import io.swagger.v3.oas.annotations.* | ||
import io.swagger.v3.oas.annotations.enums.* | ||
import io.swagger.v3.oas.annotations.media.* | ||
import io.swagger.v3.oas.annotations.responses.* | ||
import io.swagger.v3.oas.annotations.security.* | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.MediaType | ||
import org.springframework.http.ResponseEntity | ||
|
||
import org.springframework.web.bind.annotation.* | ||
import org.springframework.validation.annotation.Validated | ||
import org.springframework.web.context.request.NativeWebRequest | ||
import org.springframework.beans.factory.annotation.Autowired | ||
|
||
import jakarta.validation.constraints.DecimalMax | ||
import jakarta.validation.constraints.DecimalMin | ||
import jakarta.validation.constraints.Email | ||
import jakarta.validation.constraints.Max | ||
import jakarta.validation.constraints.Min | ||
import jakarta.validation.constraints.NotNull | ||
import jakarta.validation.constraints.Pattern | ||
import jakarta.validation.constraints.Size | ||
import jakarta.validation.Valid | ||
|
||
import kotlin.collections.List | ||
import kotlin.collections.Map | ||
|
||
@Validated | ||
@RequestMapping("\${api.base-path:}") | ||
interface PvpGameApi { | ||
|
||
@Operation( | ||
summary = "Get pvp game logs by game ID", | ||
operationId = "getPvpGameLogsByGameId", | ||
description = """Get pvp game logs by game ID""", | ||
responses = [ | ||
ApiResponse(responseCode = "200", description = "OK", content = [Content(schema = Schema(implementation = kotlin.String::class))]) | ||
], | ||
security = [ SecurityRequirement(name = "http-bearer") ] | ||
) | ||
@RequestMapping( | ||
method = [RequestMethod.GET], | ||
value = ["/pvpgames/{gameId}/logs"], | ||
produces = ["application/json"] | ||
) | ||
fun getPvpGameLogsByGameId(@Parameter(description = "UUID of the game", required = true) @PathVariable("gameId") gameId: java.util.UUID): ResponseEntity<kotlin.String> { | ||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
library/src/main/kotlin/delta/codecharacter/dtos/PvPGameDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package delta.codecharacter.dtos | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import com.fasterxml.jackson.annotation.JsonValue | ||
import delta.codecharacter.dtos.PvPGameStatusDto | ||
import jakarta.validation.constraints.DecimalMax | ||
import jakarta.validation.constraints.DecimalMin | ||
import jakarta.validation.constraints.Email | ||
import jakarta.validation.constraints.Max | ||
import jakarta.validation.constraints.Min | ||
import jakarta.validation.constraints.NotNull | ||
import jakarta.validation.constraints.Pattern | ||
import jakarta.validation.constraints.Size | ||
import jakarta.validation.Valid | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
/** | ||
* PvP Game model | ||
* @param id | ||
* @param scorePlayer1 | ||
* @param scorePlayer2 | ||
* @param status | ||
*/ | ||
data class PvPGameDto( | ||
|
||
@Schema(example = "123e4567-e89b-12d3-a456-426614174000", required = true, description = "") | ||
@get:JsonProperty("id", required = true) val id: java.util.UUID, | ||
|
||
@Schema(example = "69", required = true, description = "") | ||
@get:JsonProperty("scorePlayer1", required = true) val scorePlayer1: kotlin.Int, | ||
|
||
@Schema(example = "69", required = true, description = "") | ||
@get:JsonProperty("scorePlayer2", required = true) val scorePlayer2: kotlin.Int, | ||
|
||
@field:Valid | ||
@Schema(example = "null", required = true, description = "") | ||
@get:JsonProperty("status", required = true) val status: PvPGameStatusDto | ||
) { | ||
|
||
} | ||
|
28 changes: 28 additions & 0 deletions
28
library/src/main/kotlin/delta/codecharacter/dtos/PvPGameStatusDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package delta.codecharacter.dtos | ||
|
||
import java.util.Objects | ||
import com.fasterxml.jackson.annotation.JsonValue | ||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import jakarta.validation.constraints.DecimalMax | ||
import jakarta.validation.constraints.DecimalMin | ||
import jakarta.validation.constraints.Email | ||
import jakarta.validation.constraints.Max | ||
import jakarta.validation.constraints.Min | ||
import jakarta.validation.constraints.NotNull | ||
import jakarta.validation.constraints.Pattern | ||
import jakarta.validation.constraints.Size | ||
import jakarta.validation.Valid | ||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
/** | ||
* | ||
* Values: IDLE,EXECUTING,EXECUTED,EXECUTE_ERROR | ||
*/ | ||
enum class PvPGameStatusDto(val value: kotlin.String) { | ||
|
||
@JsonProperty("IDLE") IDLE("IDLE"), | ||
@JsonProperty("EXECUTING") EXECUTING("EXECUTING"), | ||
@JsonProperty("EXECUTED") EXECUTED("EXECUTED"), | ||
@JsonProperty("EXECUTE_ERROR") EXECUTE_ERROR("EXECUTE_ERROR") | ||
} | ||
|
Oops, something went wrong.