reduce code
This commit is contained in:
parent
7a163e10ab
commit
7e0bb8357d
1 changed files with 1 additions and 2 deletions
|
|
@ -78,11 +78,10 @@ async function createGame(gameId, targetTiles, image, ts, scoreMode) {
|
||||||
|
|
||||||
function addPlayer(gameId, playerId, ts) {
|
function addPlayer(gameId, playerId, ts) {
|
||||||
const idx = GameCommon.getPlayerIndexById(gameId, playerId)
|
const idx = GameCommon.getPlayerIndexById(gameId, playerId)
|
||||||
|
const diff = ts - GameCommon.getStartTs(gameId)
|
||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
const diff = ts - GameCommon.getStartTs(gameId)
|
|
||||||
GameLog.log(gameId, Protocol.LOG_ADD_PLAYER, playerId, diff)
|
GameLog.log(gameId, Protocol.LOG_ADD_PLAYER, playerId, diff)
|
||||||
} else {
|
} else {
|
||||||
const diff = ts - GameCommon.getStartTs(gameId)
|
|
||||||
GameLog.log(gameId, Protocol.LOG_UPDATE_PLAYER, idx, diff)
|
GameLog.log(gameId, Protocol.LOG_UPDATE_PLAYER, idx, diff)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue