From 5463cbb8b73e83941f4f891743f94fac4398584a Mon Sep 17 00:00:00 2001 From: strangerx Date: Mon, 16 Jul 2018 15:04:22 +0300 Subject: [PATCH 1/2] + gitignore + Dockerize + requirements.txt + Small refactoring for start ability --- .gitignore | 3 +++ Dockerfile | 10 ++++++++++ README.md | 10 ++++++++++ requirements.txt | 0 server.py | 6 ++---- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbcb043 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +__pycache__/ +.DS_Store/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c52cd8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 + +WORKDIR /app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "./server.py" ] \ No newline at end of file diff --git a/README.md b/README.md index 521db44..c4c71a2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![logo](/evolution_logo.png) + ## Evolution Game Server version 0.1.1 @@ -11,3 +12,12 @@ version 0.1.1 ## Bugs - HTTP 500 code after beginning game +- add test.py for server testing + +## Bugs +- no turns changing + +## Development guide +1. Install docker +2. Run `docker build -t evolution-server .` to build docker image +3. Setup project sdk and run configuration in pycharm/idea diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/server.py b/server.py index 307de99..f7cbe61 100644 --- a/server.py +++ b/server.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import argparse from game import Game from room import Room @@ -7,12 +5,12 @@ from player import Player import creature, ability import os -from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +from http.server import HTTPServer, BaseHTTPRequestHandler import json #from exceptions import EvolutionServerException class Server: - Server.version = "0.1.1" + VERSION = "0.1.1" # wtf? def __init__(self): # why can't i leave it empty? From 8bb119859b0ee03ebfc8faf068e667b419d19ca3 Mon Sep 17 00:00:00 2001 From: strangerx Date: Mon, 16 Jul 2018 15:10:25 +0300 Subject: [PATCH 2/2] removed macos bullshit --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 03047dae161ca2f35c46be20643d275155fba05d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~y>8nu5XXe*7_EBr?QiD@)#V#honV zv)s@Z%q*C(Z$QJx&xVh_%q-?Y*2Fz#@un8_42v!PC+L?pYO!+P8*#ca$7Uv9+hVwj zhV~HMZ?a)!B~ez4*5p=zOPa=8%d(Lf?6_WSov-lmK*R;wPd;{S(FIN-%PvtSa*JhK zW~?>RKG|#U;uR?ek>-F*);yqO z)^3@`79ZtWE@dnqz!5pm;~4s6q8MGC_=ewYn}7GKk@3l1yUC5_S+C_&G)vfN;l%2` z&Pm^DeM^NLsdB5Q*rJ4+xz(&b)kEI3Uh5WIK8vtttMtx1ram!{7)T848PM-TMpMiK zRvzusL1#w*u*0+oWBt3JHd(+tVC9iJi1VhPH+A8N;k-HXST2D%l$rkQXr(*c+VtUNM