Add WebAssembly support for assets and chunks, implement gameover screen rendering, and enhance server gameplay logic with dynamic speeds, team naming, and score components.
This commit is contained in:
@@ -66,10 +66,11 @@ type LoginPayload struct {
|
||||
|
||||
// Input vom Spieler während des Spiels
|
||||
type ClientInput struct {
|
||||
Type string `json:"type"` // "JUMP", "START", "LEFT_DOWN", "RIGHT_DOWN", etc.
|
||||
Type string `json:"type"` // "JUMP", "START", "LEFT_DOWN", "RIGHT_DOWN", "SET_TEAM_NAME", etc.
|
||||
RoomID string `json:"room_id"`
|
||||
PlayerID string `json:"player_id"`
|
||||
Sequence uint32 `json:"sequence"` // Sequenznummer für Client Prediction
|
||||
Sequence uint32 `json:"sequence"` // Sequenznummer für Client Prediction
|
||||
TeamName string `json:"team_name,omitempty"` // Für SET_TEAM_NAME Input
|
||||
}
|
||||
|
||||
type JoinRequest struct {
|
||||
@@ -105,6 +106,7 @@ 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)
|
||||
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
|
||||
@@ -125,7 +127,8 @@ type LeaderboardEntry struct {
|
||||
PlayerName string `json:"player_name"`
|
||||
PlayerCode string `json:"player_code"` // Eindeutiger Code für Verifikation
|
||||
Score int `json:"score"`
|
||||
Timestamp int64 `json:"timestamp"` // Unix-Timestamp
|
||||
Timestamp int64 `json:"timestamp"` // Unix-Timestamp
|
||||
ProofCode string `json:"proof_code"` // Beweis-Code zum Verifizieren des Scores
|
||||
}
|
||||
|
||||
// Score-Submission vom Client an Server
|
||||
@@ -133,8 +136,16 @@ type ScoreSubmission struct {
|
||||
PlayerName string `json:"player_name"`
|
||||
PlayerCode string `json:"player_code"`
|
||||
Score int `json:"score"`
|
||||
Name string `json:"name"` // Alternativer Name-Feld (für Kompatibilität)
|
||||
Mode string `json:"mode"` // "solo" oder "coop"
|
||||
Name string `json:"name"` // Alternativer Name-Feld (für Kompatibilität)
|
||||
Mode string `json:"mode"` // "solo" oder "coop"
|
||||
TeamName string `json:"team_name"` // Team-Name für Coop-Mode
|
||||
}
|
||||
|
||||
// Score-Submission Response vom Server an Client
|
||||
type ScoreSubmissionResponse struct {
|
||||
Success bool `json:"success"`
|
||||
ProofCode string `json:"proof_code"`
|
||||
Score int `json:"score"`
|
||||
}
|
||||
|
||||
// Start-Request vom Client
|
||||
|
||||
Reference in New Issue
Block a user