joedwards32 / CS2

CS2 Dedicated Server Docker Image
https://hub.docker.com/r/joedwards32/cs2
MIT License
282 stars 53 forks source link

webhook #18

Closed macshinaider closed 12 months ago

macshinaider commented 12 months ago

I'm creating a project in which I need the server to send me the result of the match to a webhook, is it possible?

joedwards32 commented 12 months ago

Hi @macshinaider,

Is the webhook triggered after server shutdown or after each match?

I think the options here are:

  1. You create your own downstream fork of my container image which includes your webhook script and you modify entry.sh in your image to execute it.
  2. I add support to my image for users to:
    1. Supply a bundle of customisations, e.g. as a tar gzip fetched from a URL; and
    2. Override the call to cs2 to call a script of their choosing instead. This script could:
      • Execute custom steps before launching cs2 (pre-hooks)
      • Execute a wrapper that watches the STDOUT of cs2 and triggers custom actions on certain output strings, like match ending.
      • Execute custom steps after cs2 closes (post-hooks)

I don't know when I will have time to work on option 2, so option 1 may be your best bet if you are in a hurry.

macshinaider commented 12 months ago

TKS 😍