You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2020. It is now read-only.
res.send(`Sent move with id ${moveId} for game ${gameId}`)
133
133
}else{
134
134
res.status(404).send('No game with id '+gameId)
135
135
}
136
-
}catch(e){
136
+
}catch(e){
137
137
res.status(500).send(e)
138
138
}
139
139
})
@@ -143,8 +143,8 @@ export class AsyncGameManager {
143
143
.then(server=>{
144
144
res.send({
145
145
status: server.getStatus(),
146
-
port: server.getPort(),
147
-
error: server.stderr.join(),
146
+
port: server.getPort(),
147
+
error: server.stderr.join(),
148
148
}asGameServerInfo)
149
149
})
150
150
.catch(e=>res.status(500).send(e))
@@ -157,18 +157,18 @@ export class AsyncGameManager {
157
157
158
158
resp.numberOfStates=game.getStateCount()
159
159
160
-
if(game.isReplay){//Game is a replay, all states should be loaded, report so
160
+
if(game.isReplay){//Game is a replay, all states should be loaded, report so
161
161
resp.gameStatus='REPLAY'
162
162
resp.gameResult=game.getResult()
163
-
}elseif(gameinstanceofLiveGame){//Game is a live game and might or might not be finished, let's find out
163
+
}elseif(gameinstanceofLiveGame){//Game is a live game and might or might not be finished, let's find out
164
164
letlg: LiveGame=game
165
-
if(lg.isLive()){
166
-
if(AsyncApi.hasMoveRequest(gameId)){//If there's an action request currently lodged with the API
165
+
if(lg.isLive()){
166
+
if(AsyncApi.hasMoveRequest(gameId)){//If there's an action request currently lodged with the API
167
167
resp.gameStatus='REQUIRES INPUT'
168
168
let[id,mr]=AsyncApi.getMoveRequest(gameId)//Get the request and assemble the response. We can request this ActionRequest many times, but only redeem it once
0 commit comments