diff --git a/backend/database.db b/backend/database.db
index 07c5f38..743abed 100644
Binary files a/backend/database.db and b/backend/database.db differ
diff --git a/frontend/src/pages/games.jsx b/frontend/src/pages/games.jsx
index 7574d36..c24dc77 100644
--- a/frontend/src/pages/games.jsx
+++ b/frontend/src/pages/games.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useContext } from 'react';
import { Link, useParams } from 'react-router-dom';
import axios from 'axios';
import { UserContext } from '../context/UserContext';
-import { Box, Typography, Grid, Card, CardContent, CardMedia, Button } from '@mui/material';
+import { Box, Typography, Grid2, Card, CardContent, CardMedia, Button } from '@mui/material';
import defaultCharacterImage from '../assets/default-character.png';
const GamesPage = () => {
@@ -13,7 +13,9 @@ const GamesPage = () => {
useEffect(() => {
const fetchCharacter = async () => {
try {
+ console.log(`Fetching character for gameId: ${gameId}, userId: ${userId}`); // Debug output
const response = await axios.get(`http://localhost:5000/games/${gameId}/${userId}/character`);
+ console.log('Character data:', response.data); // Debug output
setCharacter(response.data);
} catch (error) {
console.error('Error fetching character:', error);
@@ -37,78 +39,79 @@ const GamesPage = () => {
}
return (
-
-
- {/* Character Info Section */}
-
- {character.CharName}
-
- {/* Health Bar */}
-
-
+
+
+ {/* Character Image and Details */}
+
+
+
+
+
+ Age: {character.Age}
+ Race: {character.Race}
+ Sex: {character.Sex}
+ Job: {character.Job}
+
+
+
+
+
+ {/* CharName, Health and Mana Bars */}
+
+ {character.CharName}
+
+
+
Health
- {character.CurrentHealth}/{character.MaxHealth}
+ {character.currentHealth}/{character.maxHealth}
-
-
+
+
- {/* Mana Bar */}
-
-
+
+
Mana
- {character.CurrentMana}/{character.MaxMana}
+ {character.currentMana}/{character.maxMana}
-
-
+
+
-
- {/* Character Description */}
+
+ {/* Character Info Section */}
- Description
- {character.Looks}
+ Description
+ {character.description}
{/* Inventory */}
- Inventory
-
- {character.Items?.map((item, index) => (
-
-
+ Inventory
+
+ {character.inventory?.map((item, index) => (
+
+
{item.name}
Quantity: {item.quantity}
-
+
))}
-
+
-
-
- {/* Character Image and Details */}
-
-
-
-
- Age: {character.Age}
- Race: {character.Race}
- Sex: {character.Sex}
- Job: {character.Job}
-
-
-
-
+
+
);
};
-export default GamesPage;
\ No newline at end of file
+export default GamesPage;
\ No newline at end of file