GithubHelp home page GithubHelp logo

h-shan / wzclot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brendanfly/wzclot

0.0 1.0 0.0 4.8 MB

-B's official warzone clot

Shell 0.01% Python 35.72% HTML 14.53% CSS 1.01% JavaScript 48.74%

wzclot's Introduction

Warzone Custom Tournament and Ladder

Warzone CLOT focused around custom leagues and tournaments, initially developed by -B and now publically available to contribute to.

Setting up your test server

Fork the repo to a local directory.

This web application is written in the Django framework and the server side pieces are entirely written in python. The database used is postgreSQL and connection pooling with max 20 active connections runs on the server. To setup a local test site you will need to do the following.

Install Python 3.7 - https://www.python.org/downloads/windows/
Install virtualenv - pip install virtualenv (you might need to open a new command windows after installing python, windows only)
Install postgreSQL 11.6-3 - https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

In the project folder run:
pip install -r requirements.txt

Create settings_local.py in the wltourney folder with the following:

DEBUG=True
TEMPLATE_DEBUG=True DEBUG_ISSUES=False

ALLOWED_HOSTS=['*'] # any url django will serve

DATABASES = {
'default': {
'ENGINE': 'django_postgrespool',
'NAME': 'your_database_name',
'USER': 'database_username',
'PASSWORD': 'database_password',
'HOST': 'localhost',
'PORT': '5432',
}
}

You must create .env file in the project root...and set the following variables

WZ_ENDPOINT=http://127.0.0.1:8000
WZ_ACCOUNT_EMAIL=WZEmailAddress
WZ_API_TOKEN=WZAPIToken - can be retrieved from https://www.warzone.com/wiki/Get_API_Token_API
WZ_ACCOUNT_TOKEN=AccountToken - visit public profile e.g. https://www.warzone.com/Profile?p=2719017226 and use the p value 2719017226
WZ_TEST_BOT_TOKEN=

Migrate database to the latest schema
python manage.py migrate

Create a super user account for your local django database to be able to view the admin site (127.0.0.1:8000/admin) python manage.py createsuperuser

Run the testserver locally
python manage.py runserver --noreload

Logging into the Local CLOT Server

The local server you're running will actually hit the warzone endpoint to log you in, however you need to set up the login redirect since you'll be using your own credentials for use with the Warzone API.

Visit https://www.warzone.com/CLOT/Config and setup your redirect URL, which should always be http://127.0.0.1:8000/login

Object Model

There are a handful of top level objects that are used on the CLOT

The framework being used is Django. Please read-up and use this documentation for reference. https://www.djangoproject.com/

Bot

The Warzone bot is able to run in any server and was created to integrate with the CLOT directly. There is a real-time ladder, clan-league updates, and general rankings and statistics from the CLOT and main Warzone sites as well.

Please see bot.py

Engine

Running in a separate process on the server, the engine runs every 180 seconds and processes ALL tournaments/leagues that are not finished

Please see engine.py

Want the Discord Bot in your Server?

If you want the discord bot in your server please contact -B#0292. If the bot is already in your server you can create special channels that the bot will use to communicate updates to accordingly.

Create a channel named any of the following:
real-time-ladder
real_time_ladder
monthly-template-circuit
monthly_template_circuit
clan-league-bot-chat
clan_league_bot_chat

wzclot's People

Contributors

brendanfly avatar

Watchers

 avatar

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.