Private
Public Access
1
0

Add PlayerCode for enhanced score tracking and host validation logic in cooperative mode. Optimize UI for mobile devices with new responsive styles.
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m27s

This commit is contained in:
Sebastian Unterschütz
2026-01-04 17:34:19 +01:00
parent 8f49a691f7
commit 400a7e752b
6 changed files with 102 additions and 29 deletions

View File

@@ -74,11 +74,12 @@ type ClientInput struct {
}
type JoinRequest struct {
Name string `json:"name"`
RoomID string `json:"room_id"`
GameMode string `json:"game_mode"` // "solo" oder "coop"
IsHost bool `json:"is_host"`
TeamName string `json:"team_name"`
Name string `json:"name"`
RoomID string `json:"room_id"`
GameMode string `json:"game_mode"` // "solo" oder "coop"
IsHost bool `json:"is_host"`
TeamName string `json:"team_name"`
PlayerCode string `json:"player_code"` // PlayerCode für Score-Tracking
}
type PlayerState struct {
@@ -106,7 +107,8 @@ type GameState struct {
TimeLeft int `json:"time_left"`
WorldChunks []ActiveChunk `json:"world_chunks"`
HostID string `json:"host_id"`
TeamName string `json:"team_name"` // Team-Name (vom Host gesetzt)
HostPlayerCode string `json:"host_player_code"` // PlayerCode des Hosts (für Coop-Score)
TeamName string `json:"team_name"` // Team-Name (vom Host gesetzt)
ScrollX float64 `json:"scroll_x"`
CollectedCoins map[string]bool `json:"collected_coins"` // Welche Coins wurden eingesammelt (Key: ChunkID_ObjectIndex)
CollectedPowerups map[string]bool `json:"collected_powerups"` // Welche Powerups wurden eingesammelt
@@ -150,7 +152,8 @@ type ScoreSubmissionResponse struct {
// Start-Request vom Client
type StartRequest struct {
RoomID string `json:"room_id"`
RoomID string `json:"room_id"`
PlayerID string `json:"player_id"` // Wer startet das Spiel
}
// Leaderboard-Request vom Client