#服务器 #游戏 #AI #交互 #connect4-lib

nightly app connect4-server

与connect4-lib交互的服务器

1个不稳定版本

0.1.0 2020年4月14日

#906游戏

GPL-3.0-or-later

67KB
1.5K SLoC

Rust中的类似Connect 4的游戏

AI

大部分AI内容基于这个 http://blog.gamesolver.org/solving-connect-four/01-introduction/

/api/

/api/refresh

  • 接收
  • 来自身份验证头的jwt令牌
  • 返回
  • comms Refresh object with new valid JWT token
    

/api/signin/u/p

  • 接收
  • username from api path u
    
  • password from api path p
    
  • 返回
  • comms Signin object with new JWT token
    

/api/creategame

  • 接收
  • jwt token from authentication header
    
  • lib game object from the request body
    
  • 返回
  • comms GameDataResponse
    

/api/playmove

  • 接收
  • jwt token from authentication header
    
  • comms PlayMove object from the request body
    
  •     has the room id in it
    
  •     has the column in it
    
  •     has the lib chip description in it
    
  • 返回
  • comms GameDataResponse
    

/api/getgame/id

  • 接收
  • jwt token from authentication header
    
  • game id from the api path
    
  • 返回
  • comms GameDataResponse
    

/api/joingame/id

  • 接收
  • jwt token from authenticaion header
    
  • game id from the api path
    
  • a vector of players to register from the body
    
  • 返回
  • a vector of possible player numbers, if the server failed to register a player it will have None as the player number in the repsonse
    

/api/allgames/past

  • 接收
  • jwt token from authenticaion header with username in it
    
  • 返回
  • a possibly empty vector of comms GameData that all have username in the users list and a game state not Ongoing
    

(注意,此端点尚未工作,因为后端阻止你赢得任何游戏)

/api/allgames/ongoing

  • 接收
  • jwt token from authenticaion header with username in it
    
  • 返回
  • a possibly empty vector of comms GameData that all have username in the users list and a game state Ongoing
    

依赖项

~33–47MB
~884K SLoC