Skip to content

Commit f017bf0

Browse files
authored
Merge pull request #700 from TaloDev/develop
Release 0.96.0
2 parents 68e23f3 + 8a44f35 commit f017bf0

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "game-services",
3-
"version": "0.95.1",
3+
"version": "0.96.0",
44
"description": "",
55
"main": "src/index.ts",
66
"scripts": {

src/entities/api-key.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Game from './game'
33
import User from './user'
44

55
export enum APIKeyScope {
6+
READ_PLAYER_PRESENCE = 'read:playerPresence',
7+
WRITE_PLAYER_PRESENCE = 'write:playerPresence',
68
READ_GAME_CHANNELS = 'read:gameChannels',
79
WRITE_GAME_CHANNELS = 'write:gameChannels',
810
READ_PLAYER_GROUPS = 'read:playerGroups',

src/entities/player.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export default class Player {
158158

159159
const conns = await socket.findConnectionsAsync(async (conn) => {
160160
return (
161-
conn.hasScope(APIKeyScope.READ_PLAYERS) &&
161+
conn.hasScope(APIKeyScope.READ_PLAYER_PRESENCE) &&
162162
!!conn.playerAliasId &&
163163
this.game.id === (await conn.getPlayerAlias())?.player.game.id
164164
)

tests/services/_api/player-presence-api/put.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ describe('Player presence API service - put', () => {
5555
it('should notify other players when presence is updated', async () => {
5656
const { identifyMessage, ticket, player, token } = await createSocketIdentifyMessage([
5757
APIKeyScope.READ_PLAYERS,
58-
APIKeyScope.WRITE_PLAYERS
58+
APIKeyScope.WRITE_PLAYERS,
59+
APIKeyScope.READ_PLAYER_PRESENCE
5960
])
6061

6162
await em.persistAndFlush(player)

0 commit comments

Comments
 (0)