Git Product home page Git Product logo

cgos's Introduction

Computer Go Server

Python Server

Start a cgos server and web page builder.

python3 -m pip install -r requirements.txt
python3 cgos/server.py cgos19.ini &
python3 cgos/webuild.py cgos19.ini &

If you used previous version, migrate database.

sqlite3 /path/to/cgos.state < db/migrate-001-create-games-index.sql

genmove_analyze extention

GTP Client can send winrate, score and pv via cgos-genmove_analyze, lz-genmove_analyze or kata-genmove_analyze commands.

And WGo.js show these analysis.

See Wiki.

Administrator extention

% telnet localhost 1919
< protocol genmove_analyze
e1 telnet
< username
admin
< password
pass123
who
< gnugo8 waiting 0 1702.4092782840737 3.0
< ray-10s-b waiting 0 1668.129179991671 3.0
match ray-10s-b gnugo8 300 300
< match-> ray-10s-b(1658)   gnugo8(1713)
games
< ...
< match 4841 2023-05-14 10:56 9 7.0 ray-10s-b(1658) gnugo8(1713) - - - B+4.0
< match 4842 - - 9 7.0 gnugo8(1714) ray-10s-b(1657) 60000 60000 17 -
games
< ...
< match 4841 2023-05-14 10:56 9 7.0 ray-10s-b(1658) gnugo8(1713) - - - B+4.0
< match 4842 2023-05-14 11:00 9 7.0 gnugo8(1714) ray-10s-b(1657) - - - W+Resign

Original Tcl Server

How to build from source:

  1. Add tclkit to your path a. Identify your platform specific tclkit in third_party directory b. Make a copy (called tclkit) somewhere in your path (~/bin and /usr/bin are good candidates for unix systems)
  2. Go into the directory of the component you wish to build (e.g. client)
  3. Run gnu make (on unix systems, this should just be 'make')

Is there no tclkit for your environment in the repository? Other kits can be downloaded from http://www.equi4.com

Don't have gnu make? You have two options: Option 1: Obtain gnu make Option 2: Run individual commands out of the makefile (e.g. sdx wrap)

cgos's People

Contributors

cglemon avatar k-matsuzaki avatar killerducky avatar remi-coulom avatar yssaya avatar zakki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cgos's Issues

List of ideas

Server

  • Save SGF during game
  • Get moves incrementaly from WGo
  • Password hashing hashlib.scrypt/passlib
  • CGOS protocol over SSL
  • Broadcast delayed game to protect from side chanel attack

Servers for hosting competitions like CGF Open / UEC Cup

  • Proxy server to handle large number of viewers
  • Matching game management
  • Manual judging
  • Multiple rules support

GTP client

  • Test using cgos-genmove_analyze native AI

Tcl/Tk Viewer

  • Show analysis

Web Viewer

  • Display of game record during a game
  • Responsive design

If LogFile has no directory, the client crashes

If I set something like this in the .cfg file:
LogFile = common.log

The client crashes (in an infinite loop) with

Traceback (most recent call last):
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 769, in <module>
    expected = main(sys.argv[1:])
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 738, in main
    client = CGOSClient(engineConfigs,
  File "/home/rcoulom/repos/cgos/client-python/src/cgosclient.py", line 128, in __init__
    os.makedirs(os.path.dirname(logFileName), exist_ok=True)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

It works if I use log/common.log instead.

The CGOS protocol.

I want to rewrite the server part in my personal repository in order to simplify the code and much focus on tournament games. It means that I will remove some original features. It may include

  • Fully support for original CGOS client and some other tools.
  • Remove the data base (sqlite).
  • Remove the complexity store path.
  • Remove the global object.
  • Implement fully asynchronous saving feature (Remove the [#5] to this repository).
  • User can control the match game.

There are seven states in the CGOS

  • protocol : get the current client version
  • username: get the user name
  • password: get the password
  • gameover: end the game
  • genmove: get the name move
  • waiting: waiting for next game
  • ok: do not accept any response

There are two protocol version

  • v1: nothing special
  • e1: use the analysis command

Any special thing should I notice?

doesn't start any games

Hi,

When I start the python cgos implementation and let 2 gtp-programs connect, it won't start matches:

2023-02-15 19:36:42,256 - cgos_server - INFO - "(CGOS) 9x9 Computer Go Server" up and running at 2023-02-15 18:36:42 GMT
2023-02-15 19:36:42,256 - cgos_server - INFO - datafile:'/usr/local/games/cgos/server-python/wdata.txt' -> workdir:'/usr/local/games/cgos/server-python'
2023-02-15 19:36:42,273 - cgos_server - INFO - Serving on ('::', 9900, 0, 0), ('0.0.0.0', 9900)
2023-02-15 19:36:48,976 - cgos_server - INFO - Connection from ('172.29.0.107', 48970)
2023-02-15 19:36:59,396 - cgos_server - INFO - Connection from ('127.0.0.1', 39584)
2023-02-15 19:37:27,301 - cgos_server - INFO - Games in progress: 0
2023-02-15 19:37:27,301 - cgos_server - INFO - Batch rating
2023-02-15 19:37:27,302 - cgos_server - INFO - sizeof bad_users: 0
2023-02-15 19:37:27,302 - cgos_server - INFO - maximum skip elo: 2000.0
2023-02-15 19:37:27,302 - cgos_server - INFO - ELO permutation factor to be used: 3000.0
2023-02-15 19:37:42,317 - cgos_server - INFO - Batch rating
2023-02-15 19:37:42,317 - cgos_server - INFO - sizeof bad_users: 0
2023-02-15 19:37:42,318 - cgos_server - INFO - maximum skip elo: 2000.0
2023-02-15 19:37:42,318 - cgos_server - INFO - ELO permutation factor to be used: 3000.0
Python CGOS client. e1 cgosPython 0.3.0 beta (c)2009 Christian Nentwich
2023-02-15 19:36:47,970: Chose engine 1 ("DellaBaduck456a8b5") as next player. Switching and re-connecting.
2023-02-15 19:36:47,970: Starting GTP engine, command line: ../build/dellabaduck
2023-02-15 19:36:48,973: Attempting to connect to server '172.29.0.1', port 9900
2023-02-15 19:36:48,974: Connected

A bug issue.

I quickly report the bug here. I may send the pull request tomorrow. My python version is 3.8. Here is a bug for dict in the version.

TypeError: 'type' object is not subscriptable

The dict should be replaced by typing.Dict in my python version. For example,

gme: dict[int, GoGame] = dict()

should be

from typing import Dict
gme: Dict[int, GoGame] = dict()

Some potential bug report.

@zakki

The python-client can not work on the Ubuntu. Are your environment Windows? Because the python behavior may be difference between two OS. I want to check it first. Thanks!

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.