mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
Webatrice: Adding game created to persistence layer (#5067)
This commit is contained in:
parent
f8bc6cf998
commit
1ab723ca64
4 changed files with 11 additions and 1 deletions
|
|
@ -57,4 +57,9 @@ export const Actions = {
|
||||||
name,
|
name,
|
||||||
amount
|
amount
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
gameCreated: (roomId) => ({
|
||||||
|
type: Types.GAME_CREATED,
|
||||||
|
roomId
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,8 @@ export const Dispatch = {
|
||||||
removeMessages: (roomId, name, amount) => {
|
removeMessages: (roomId, name, amount) => {
|
||||||
store.dispatch(Actions.removeMessages(roomId, name, amount));
|
store.dispatch(Actions.removeMessages(roomId, name, amount));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
gameCreated: (roomId) => {
|
||||||
|
store.dispatch(Actions.gameCreated(roomId));
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ export const Types = {
|
||||||
USER_LEFT: '[Rooms] User Left',
|
USER_LEFT: '[Rooms] User Left',
|
||||||
SORT_GAMES: '[Rooms] Sort Games',
|
SORT_GAMES: '[Rooms] Sort Games',
|
||||||
REMOVE_MESSAGES: '[Rooms] Remove Messages',
|
REMOVE_MESSAGES: '[Rooms] Remove Messages',
|
||||||
|
GAME_CREATED: '[Rooms] Game Created',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MAX_ROOM_MESSAGES = 1000;
|
export const MAX_ROOM_MESSAGES = 1000;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export class RoomPersistence {
|
||||||
};
|
};
|
||||||
|
|
||||||
static gameCreated(roomId: number) {
|
static gameCreated(roomId: number) {
|
||||||
console.log('gameCreated', roomId);
|
RoomsDispatch.gameCreated(roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static joinedGame(roomId: number, gameId: number) {
|
static joinedGame(roomId: number, gameId: number) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue