Giter Club home page Giter Club logo

civ5-webhook's Introduction

Civ5 Pitboss Webhook

Adds webhooks to Sid Meier's Civilization 5 games. Install this on your pitboss server to be notified anytime a player starts/ends their turn or connects/disconnects.

How to use

  1. Edit steamapps/common/Sid Meier's Civilization V/Assets/DLC/Expansion2/UI/InGame/TopPanel.lua and append the content of GameStateHook.lua. This injects the game hook logic, which logs the game state to the game console. Other files can be used, (i.e. if you do not have BNW), but this file works. If you choose to inject into another file, make sure that it is being loaded when hosting a game.

  2. Edit Documents/My Games/Sid Meier's Civilization 5/config.ini and enable logging.

;Update these two properties
MessageLog = 1
LoggingEnabled = 1
  1. Copy WatchLog.ps1 to Documents/My Games/Sid Meier's Civilization 5/Logs. Change https://my-endpoint.com to be whatever endpoint you want.

  2. Make sure that powershell scripts are enabled on your system. https:/go.microsoft.com/fwlink/?LinkID=135170

  3. Start the game.

  4. Run the Watchlog.ps1 script. Note that you may need to manually open a powershell console, cd to the logs directory, and then run the script. Windows does not seem able to automatically open a powershell console in a folder which contains an apostrophe ', which is the case with the default game directory.

Game State Payload

Civ5 Pitboss Webhook will send an HTTP POST request with a JSON body.

{
    "gameTurn": 118,
    "players": [
        {
            "id": 1,
            "nickName": "Atreides",
            "civilization": "Morocco",
            "isTurnComplete": false,
            "isOnline": true,
            "isAlive": true
        },
        {
            "id": 2,
            "nickName": "bobby_joe",
            "civilization": "America",
            "isTurnComplete": true,
            "isOnline": false,
            "isAlive": true
        }
     ]
}

Troubleshooting

The powershell script shows red text and immediately stops!

  • Make sure that the game is running before running the script. Make sure that powershell scripts are enabled. (Step 4.)

civ5-webhook's People

Contributors

keotl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tschitsch

civ5-webhook's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.