Tidak Ada Deskripsi

Kirk Trombley ed8257bdc2 Add reverse geocoding domain function to UI 4 tahun lalu
client ed8257bdc2 Add reverse geocoding domain function to UI 4 tahun lalu
server 6e0d5b11c2 Some TODOs on the server after identifying a bug 4 tahun lalu
.drone.yml d295ab81e1 Skip tests for now 4 tahun lalu
.gitignore 5cbe704f19 Upgrade to React 17, react-scripts 4, and fix resulting linting and imports 4 tahun lalu
README.md 0642086fc7 README update 4 tahun lalu

README.md

Geoguessr Self-Hosted Reimplementation

Build Status

API

API Endpoints
GET /health
    Returns 200 and {
        "version": string,
        "status": string
    }
POST /score
    Accepts {
        "point1": {
            "lat": number,
            "lng": number
        },
        "point2": {
            "lat": number,
            "lng": number
        }
    }
    Returns 400 or 200 and {
        "score": number,
        "distance": number
    }
GET /caches
    Returns 200 and {
        "caches": [
            {
                "generationMethod": string,
                "countryLock": string || null,
                "size": number
            }, ...
        ]
    }
GET /generators
    Returns 404 vs 200 and {
        "generators": [
            {
                "generationMethod": string,
                "countryLocks": [ string ],
            }
        ]
    }
PUT /game
    Accepts {
        "timer": number,
        "rounds": number,
        "countryLock": string || null (default: null),
        "generationMethod": string (default: "RANDOMSTREETVIEW"),
        "ruleSet": string (default: "NORMAL")
    }
    Returns 501 vs 200 and {
        "gameId": string
    }
GET /game/{game_id}/config
    Returns 404 vs 200 and {
        "timer": number,
        "rounds": number,
        "countryLock": string || null,
        "generationMethod": string,
        "ruleSet": string
    }
GET /game/{game_id}/coords
    Returns 404 vs 200 and {
        "1": {
            "lat": number,
            "lng": number,
            "country": string || null,
        }, ...
    }
POST /game/{game_id}/join
    Accepts {
        "playerName": string
    }
    Returns (404, 409) vs 201 and {
        "playerId": string
    }
GET /game/{game_id}/players
    Returns 404 vs 200 and {
        "players": [
            {
                "name": string,
                "currentRound": string || null,
                "totalScore": number,
                "guesses": {
                    "1": {
                        "lat": number,
                        "lng": number,
                        "country": string || null,
                        "score": number || null,
                        "timeRemaining": number
                    }, ...
                }
            }, ...
        ]
    }
GET /game/{game_id}/players/{player_id}/current
    Returns 404 vs 200 and {
        "currentRound": string || null,
        "coord": {
            "lat": number,
            "lng": number,
            "country": string || null,
        } || null,
        "timer": number || null
    }
GET /game/{game_id}/linked
    Returns 404 vs 200 and {
        "linkedGame": string || null
    }
PUT /game/{game_id}/linked
    Accepts {
        "linkedGame": string
    }
    Returns (401, 404) vs 201
GET /game/{game_id}/round/{round}/first
    Returns 200 and {
        "first": string || null
    }
POST /game/{game_id}/round/{round}/guess/{player_id}
    Accepts {
        "timeRemaining": number,
        "lat": number,
        "lng": number,
        "country": string || null (default: null),
    }
    Returns (404, 409) vs 201 and {
        "totalScore": number,
        "score": number,
        "distance": number
    }
POST /game/{game_id}/round/{round}/timeout/{player_id}
    Returns (404, 409) vs 201 and {
        "totalScore": number
    }

Next Steps

Planned Game Modes

None currently! Submit ideas!

Code/Design Improvements

UI/UX

  • Clean up rankings screen
    • Show countries of guesses/results (maybe with flags)
  • Auto-zoom guess map to country in a country-specific game
  • Rotation in Frozen mode
  • Improved alert of cut off in Race mode
  • Improve error handling in UI
  • Override google controls in streetview, make custom divs

Server

  • Convert back-end to use a real db (persistence between deployments not necessary for now)
  • Use alembic to manage db migrations in real persistent db
  • Timestamps/hashes in info responses so checks can be faster
  • Convert to a socket-based api, to allow timing to be server-side

Attributions

Urban game data is based on the World Cities Database