Guard

SPGG Bot Docs

Give me your ID if you want to cross this world!

#WebSocket Events Reference

#Overview

The SPGG bot system uses Socket.IO for real-time bidirectional communication between bots and the server. Each game uses separate namespaces to avoid event collisions.

#Namespaces

Namespace Purpose Used By
/stream-client FC24 bot events fc24.py
/fc25/stream-client FC25 bot events fc25.py
/undisputed/stream-client Undisputed bot events und.py
/helper FC24 GUI remote control fc24-gui.py
/fc25/helper FC25 GUI remote control fc25-gui.py
/undisputed/helper Undisputed GUI remote control und-gui.py
/logs Remote log streaming All bots

#Events Emitted by Bot → Server

#waiting

Bot is ready and waiting for a match.

{
  "uuid": "device-uuid",
  "minutes": "7"
}

#myid

Identify device to the server.

{
  "id": "device-uuid"
}

#start-match

Match has been detected as started (memory confirms gameplay).

{
  "uuid": "device-uuid"
}

Undisputed variant:

{
  "uuid": "device-uuid",
  "game_time": 180
}

#home-away / team-full

Confirm team/fighter names for the match.

FC24/FC25:

{
  "uuid": "device-uuid",
  "home": "Manchester United",
  "away": "Liverpool"
}

Undisputed:

{
  "uuid": "device-uuid",
  "player_1": "Mike Tyson",
  "player_2": "Muhammad Ali"
}

#half FC24 ONLY FC25 ONLY

Halftime detected.

{
  "uuid": "device-uuid"
}

#end-match FC24 ONLY FC25 ONLY

Football match ended.

{
  "uuid": "device-uuid",
  "minutes": "7"
}

#match-data

Real-time match data sent every 0.5 seconds.

FC24/FC25 payload:

{
  "homeGoal": 2,
  "awayGoal": 1,
  "currentTime": 45000,
  "aranaktuHomeGoal": 2.0,
  "aranaktuAwayGoal": 1.0,
  "homeShots": 5,
  "awayShots": 3,
  "homeFouls": 2,
  "awayFouls": 4,
  "homeYellowCards": 1,
  "awayYellowCards": 0,
  "homeRedCards": 0,
  "awayRedCards": 0,
  "ballPositionX": 0.65,
  "ballPositionY": 0.3,
  "uuid": "device-uuid"
}

Undisputed payload:

{
  "uuid": "device-uuid",
  "gameTime": 120,
  "currentRound": 3,
  "boxer1_round_score": [10, 10, 9, 10, 10, 10, ...],
  "boxer2_round_score": [9, 10, 10, 9, 10, 10, ...]
}

#round-break-stats UND ONLY

Damage stats captured during round break.

{
  "uuid": "device-uuid",
  "round": 3,
  "stats": {
    "home": {
      "head": 45.5,
      "body": 30.0,
      "lswell": 25.0,
      "rswell": 10.0,
      "lcuts": 50.0,
      "rcuts": 25.0
    },
    "away": {
      "head": 35.0,
      "body": 20.5,
      "lswell": 15.0,
      "rswell": 5.0,
      "lcuts": 25.0,
      "rcuts": 0.0
    }
  }
}

#winner-detected UND ONLY

Winner detected from screen color analysis.

{
  "uuid": "device-uuid",
  "winner": "player1",
  "total_rounds": 8,
  "game_time": 0,
  "lastQueueId": 12345
}

#match-score UND ONLY

Full scorecard after fight ends.

{
  "uuid": "device-uuid",
  "winner": "player1",
  "gameTime": 0,
  "currentRound": 8,
  "boxer1_round_score": [10, 10, 9, ...],
  "boxer2_round_score": [9, 10, 10, ...],
  "lastQueueId": 12345
}

#log

Remote log message (sent to /logs namespace).

{
  "uuid": "device-uuid",
  "message": "Match started.",
  "level": "info",
  "timestamp": 1700000000.123
}

#Events Received by Bot ← Server

#new-match

Server assigns a new match to the bot.

FC24/FC25 payload:

{
  "streamPath": "/live/device-uuid",
  "home": "Manchester United",
  "away": "Liverpool",
  "home_league": 2,
  "away_league": 4,
  "all_95": true
}

Undisputed payload:

{
  "streamPath": "/live/device-uuid",
  "player_1": "Mike Tyson",
  "player_2": "Muhammad Ali",
  "weight": "5",
  "id": 12345
}

#starting-match

Same payload as new-match — used for mid-session starts.

#pong

Server response to ping. No payload.


#GUI Events (Helper Namespace)

#start-script

Remote command to start the bot.

{
  "uuid": "device-uuid"
}

#stop-script

Remote command to stop the bot.

{
  "uuid": "device-uuid"
}

#git-pull

Remote command to pull latest code from Git.

{
  "uuid": "device-uuid"
}

#terminate

Sent by GUI to helper namespace to signal bot process termination.

{}