space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.47k stars 3.09k forks source link

Save ahelps to database #18008

Open Chief-Engineer opened 1 year ago

Chief-Engineer commented 1 year ago

Ahelps should be logged to the database. Right now, the only option for logging is the discord relay. This isn't ideal for many reasons including searchability. The issues can be mitigated by using admin logs, but I don't think that's an ideal solution.

Included data

List of everything that, ideally, would be stored:

Possible schema

This doesn't include the online status of each participant, and it may have issues, I haven't done anything with databases recently. This might also benefit from additional tables, maybe an entityID to prototype/name thing

Table ahelp_exchange {
  ahelp_id integer [unique]
  ahelp_round integer [pk]
  ahelp_target int4 [ref: > player.player_id]
}

Table ahelp_message {
  ahelp_id integer [pk, ref: > ahelp_exchange.ahelp_id]
  id integer [pk]
  sent_at timestamp
  round roun_status
  sender int4 [ref: > player.player_id]
  sender_entity integer
  is_adminned bool
  target_online bool
  message varchar
}

Table ahelp_participant {
  participant_id integer [pk, ref: > ahelp_exchange.ahelp_id]
  ahelp_id integer
  player_id int4 [ref: > player.player_id]
}

enum roun_status {
    lobby
    round
    postround
}
Geekyhobo commented 2 months ago

In progress