# reactgame1 **Repository Path**: a047/game1 ## Basic Information - **Project Name**: reactgame1 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-23 - **Last Updated**: 2021-08-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 全局参数 : 1. clients [{clients,id,ip}] 所有连接用户; 2. plays [{clients,id,ip,isReady,status}] 玩家数组 3. viewers [{clients,id,ip,isReady}] 观众数组 4. nextPlay black/write 下一步走棋,白棋或者黑棋 5. nextPlayId 下一步走棋的用户的id 6. chessboard 棋盘 7. playState 当前游戏状态 1.未开始 ,用户连接 2.用户准备 3 游戏开始,给plays分配棋色,设置nextPlayId nextPlay 通知clients 4.plays走棋 通知clients 5.判赢,通知clients 6.一位玩家请求再来一次,通知plays ,等待对手确定, 清空棋盘,通知clients开始 客户端连接服务端 服务端接收 分配id ,ip