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
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m27s
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -70,6 +70,7 @@ type Room struct {
|
||||
Countdown int
|
||||
NextStart time.Time
|
||||
HostID string
|
||||
HostPlayerCode string // PlayerCode des Hosts (für Coop-Score Submission)
|
||||
TeamName string // Name des Teams (vom Host gesetzt)
|
||||
CollectedCoins map[string]bool // Key: "chunkID_objectIndex"
|
||||
CollectedPowerups map[string]bool // Key: "chunkID_objectIndex"
|
||||
@@ -790,6 +791,7 @@ func (r *Room) Broadcast() {
|
||||
TimeLeft: r.Countdown,
|
||||
WorldChunks: r.ActiveChunks,
|
||||
HostID: r.HostID,
|
||||
HostPlayerCode: r.HostPlayerCode,
|
||||
TeamName: r.TeamName,
|
||||
ScrollX: r.GlobalScrollX,
|
||||
CollectedCoins: r.CollectedCoins,
|
||||
|
||||
Reference in New Issue
Block a user