CustomCriticalInjuriesController - xEdziu/RPG-Handy-Helper GitHub Wiki

CpRedCustomCriticalInjuriesController

This page contains documentation for the CpRedCustomCriticalInjuriesController class, which handles custom critical injuries management for Cyberpunk Red.

Basic Information

Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.custom.customCriticalInjuries

Authentication

All requests to this controller require an XSRF token to be included in the headers.
Example:

headers: {
  "X-XSRF-TOKEN": "<csrfToken>"
}

Endpoint Summary

HTTP Method Path Description
GET /rpgSystems/cpRed/customCriticalInjuries/all Returns basic info about all available custom critical injuries
GET /rpgSystems/cpRed/customCriticalInjuries/{customCriticalInjuryId} Returns detailed information about a specific custom critical injuries by ID
GET /rpgSystems/cpRed/customCriticalInjuries/game/{gameId} Returns basic info about all available custom critical injuries by game ID
GET /admin/rpgSystems/cpRed/customCriticalInjuries/all Returns a full list of all custom critical injuries types with administrative data
POST /rpgSystems/cpRed/customCriticalInjuries/add Adds a new custom critical injury type to the system
PUT /rpgSystems/cpRed/customCriticalInjuries/update/{customCriticalInjuryId} Update custom critical injury data

Field Descriptions

Request Body Fields (CustomCriticalInjuriesDto)

  • gameId (Long): ID of the game this custom critical injury belongs to. Required.
  • injuryPlace (String): The place of the custom critical injury on the body. Required. Possible values: HEAD,BODY.
  • effect (String): Description of the custom critical injury effect. Required.
  • patching (String): Description of the patching process for the custom critical injury. Required.
  • treating (String): Description of the treatment process for the custom critical injury. Required.

Response Fields

  • message (String): Describes the result of the operation.
  • error (Integer): HTTP status code.
  • timestamp (String): Time the response was generated.
  • customCriticalInjury (Object): A single custom critical injury object (if applicable).
  • customCriticalInjuryList (Array): List of custom critical injuries (if applicable).

Endpoint Details

Get All Custom Critical Injuries

Method: GET
Path: /rpgSystems/cpRed/customCriticalInjuries/all

Response

{
  "customWeapon": {
    "id": 1,
    "gameId": 1,
    "name": "Customowy Łuk bloczkowy",
    "requiredSkillId": 1,
    "type": "BOW",
    "damage": 3,
    "magazineCapacity": 1,
    "numberOfAttacks": 2,
    "handType": 2,
    "isHidden": false,
    "quality": "EXCELLENT",
    "price": 200,
    "availability": "PREMIUM",
    "isModifiable": true,
    "modSlots": 3,
    "description": "Customowy łuk bloczkowy stworzony na specjalne zamówienie."
  },
  "message": "Customowa broń pobrana pomyślnie",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.

Get Custom Critical Injury by ID

Method: GET
Path: /rpgSystems/cpRed/customCriticalInjuries/{CriticalInjuryId}

Response

{
  "customCriticalInjuries": {
    "gameId": 1,
    "injuryPlace": "HEAD",
    "name": "rany",
    "effects": "nie zabija",
    "patching": "none",
    "treating": "yes"
  },
  "message": "Customowa rana krytyczna została pobrana",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid custom critical injury ID.
  • 401 Unauthorized: User is not logged in.
  • 404 Not Found:Custom critical injury with the specified ID does not exist.

Get Custom Ammunition by Game ID

Method: GET
Path: /rpgSystems/cpRed/customAmmunition/game/{gameId}

Response

{
  "customCriticalInjuries": [
    {
      "gameId": 1,
      "injuryPlace": "HEAD",
      "name": "nowe rany",
      "effects": "zabija",
      "patching": "none",
      "treating": "none"
    },
    {
      "gameId": 1,
      "injuryPlace": "BODY",
      "name": "zacięcie",
      "effects": "nie zabija, boli",
      "patching": "none",
      "treating": "yes"
    },
    {
      "gameId": 1,
      "injuryPlace": "HEAD",
      "name": "rana krytyczna",
      "effects": "nie zabija",
      "patching": "none",
      "treating": "yes"
    }
  ],
  "message": "Customowe rany krytyczne do gry zostały pobrane",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid game ID.
  • 401 Unauthorized: User is not logged in.
  • 404 Not Found: Game with the specified ID does not exist.

Get All Custom CriticalInjuries with Admin Data

Method: GET
Path: admin/rpgSystems/cpRed/customCriticalInjuries/all

Response

{
  "customCriticalInjuries": [
    {
      "id": 1,
      "gameId": {
        "id": 1,
        "name": "Night City Adventures",
        "description": "A thrilling adventure in the heart of Night City.",
        "owner": {
          "id": 1,
          "username": "zuber",
          "firstName": "Mateusz",
          "surname": "Zubrzycki",
          "email": "[email protected]",
          "token": null,
          "password": "$2a$10$KVpnGkuArP/eeM8GfW.8UeOJtVIbBi1Ljnp95Uo0f1W92iZbSCmp6",
          "role": "ROLE_ADMIN",
          "locked": false,
          "enabled": true,
          "createdAt": "2025-06-24T21:46:19.320+00:00",
          "userPhotoPath": "/img/profilePics/defaultProfilePic.png",
          "accountNonExpired": true,
          "credentialsNonExpired": true,
          "oauthId": null,
          "authorities": [
            {
              "authority": "ROLE_ADMIN"
            }
          ],
          "oauthProvider": null,
          "accountNonLocked": true
        },
        "rpgSystem": {
          "id": 1,
          "name": "Cyberpunk 2077",
          "description": "A futuristic role-playing game set in the dystopian Night City."
        },
        "status": "ACTIVE"
      },
      "injuryPlace": "HEAD",
      "name": "rany",
      "effects": "nie zabija",
      "patching": "none",
      "treating": "yes"
    },
    {
      "id": 2,
      "gameId": {
        "id": 1,
        "name": "Night City Adventures",
        "description": "A thrilling adventure in the heart of Night City.",
        "owner": 1,
        "rpgSystem": {
          "id": 1,
          "name": "Cyberpunk 2077",
          "description": "A futuristic role-playing game set in the dystopian Night City."
        },
        "status": "ACTIVE"
      },
      "injuryPlace": "BODY",
      "name": "zacięcie",
      "effects": "nie zabija, boli",
      "patching": "none",
      "treating": "yes"
    }
  ],
  "message": "Customowe rany krytyczne zostały pobrane dla administratora",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.
  • 403 Forbidden: User is not an admin.

Add New Custom Critical Injury

Method: POST
Path: /admin/rpgSystems/cpRed/customCriticalInjuries/add

Request

{
{
  gameId: 1,
  injuryPlace: "HEAD",
  name: "rana krytyczna",
  effects: "nie zabija",
  patching: "none",
  treating: "yes"
}

Response

{
  "message": "Customowe rany krytyczne zostały dodane.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: User not authenticated.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found: Invalid custom CriticalInjury data.

Update Custom CriticalInjuries

Method: PUT
Path: /admin/rpgSystems/cpRed/customCriticalInjuries/update/{CriticalInjuriesId}

Request

{
  gameId: 1,
  injuryPlace: "HEAD",
  name: "nowe rany",
  effects: "zabija",
  patching: "none",
  treating: "none"
}

Response

{
  "message": "Customowe rany krytyczne zostały zmodyfikowane.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid custom critical injury ID or data.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found:Custom critical injury with the specified ID does not exist.

Common Troubleshooting Tips

  • Missing XSRF Token: Ensure the X-XSRF-TOKEN header is included in every request.
  • Invalid Fields: Double-check the request body for missing or invalid fields.
  • Permission Issues: Verify that the user has the necessary permissions for the requested operation.
⚠️ **GitHub.com Fallback** ⚠️