diff --git a/backend/database.db b/backend/database.db index 71c46ba..e5224fb 100644 Binary files a/backend/database.db and b/backend/database.db differ diff --git a/frontend/src/pages/gameMasterPage.jsx b/frontend/src/pages/gameMasterPage.jsx index 68d570a..008d659 100644 --- a/frontend/src/pages/gameMasterPage.jsx +++ b/frontend/src/pages/gameMasterPage.jsx @@ -23,12 +23,12 @@ const GameMasterPage = () => { const pcsResponse = await axios.get(`http://localhost:5000/games/${gameId}/playerchars`); const processedPCs = Array.isArray(pcsResponse.data) ? pcsResponse.data : [pcsResponse.data]; setPlayerCharacters(processedPCs.filter(pc => pc !== null)); - + // Fetch NPCs with different structure const npcsResponse = await axios.get(`http://localhost:5000/games/${gameId}/npcs`); const processedNPCs = Array.isArray(npcsResponse.data) ? npcsResponse.data : [npcsResponse.data]; setNpcs(processedNPCs.filter(npc => npc !== null)); - + // Fetch Items const itemsResponse = await axios.get(`http://localhost:5000/games/${gameId}/items`); const processedItems = Array.isArray(itemsResponse.data) ? itemsResponse.data : [itemsResponse.data]; @@ -37,19 +37,20 @@ const GameMasterPage = () => { console.error('Error fetching data:', error); } }; - + fetchData(); const interval = setInterval(fetchData, 5000); return () => clearInterval(interval); }, [gameId]); const Section = ({ title, items, createPath, createText }) => ( - {title} @@ -69,8 +70,8 @@ const GameMasterPage = () => { {items.map((item, index) => ( - { image={item.Img || defaultItemImage} alt={item.ItemName} className={`rarity-${item.Rarity} rarity-image`} - sx={{ + sx={{ objectFit: 'contain', width: '128px' }} /> - @@ -120,33 +121,34 @@ const GameMasterPage = () => { return ( // Update main container Box styling - Game Master Dashboard {/* Player Characters Section */} - Player Characters {playerCharacters.map((character, index) => ( - { height="140" image={character.Img || defaultCharacterImage} alt={character.CharName} - sx={{ + sx={{ objectFit: 'contain', width: '140px', borderRadius: '3px' @@ -187,12 +189,13 @@ const GameMasterPage = () => { {/* NPCs Section */} - NPCs @@ -212,8 +215,8 @@ const GameMasterPage = () => { {npcs.map((npc, index) => ( - { height="140" image={npc.Img || defaultCharacterImage} alt={npc.CharName} - sx={{ + sx={{ objectFit: 'contain', width: '140px', borderRadius: '3px' @@ -238,13 +241,26 @@ const GameMasterPage = () => { - {npc.CharName} + {npc.Name} - {npc.Race} + {npc.Race} - Level {npc.Level} - {npc.Job} + Job: {npc.Job} + + + Status: {npc.Allied === 0 + ? 'Allied' + : npc.Allied === 1 + ? 'Neutral' + : 'Enemy'}