Update the type structure, and rename the "game.*" events to "lobby.*"
This commit is contained in:
parent
3b5e643232
commit
c5449f1153
4 changed files with 35 additions and 18 deletions
|
|
@ -1,15 +1,17 @@
|
|||
import { ServerResponse } from "../ServerResponse";
|
||||
import { PlayerData } from "../PlayerData";
|
||||
import { ServerResponse } from "../../ServerResponse";
|
||||
import { PlayerData } from "../../PlayerData";
|
||||
|
||||
/**
|
||||
* The data that must be supplied to the server in order to create a game.
|
||||
*/
|
||||
export interface IGameCreateRequest {
|
||||
export interface LobbyCreateRequest {
|
||||
username: string;
|
||||
}
|
||||
|
||||
/** The data that is given to the client when they attempt to join a lobby. */
|
||||
export interface IGameCreateResponse extends ServerResponse {
|
||||
/**
|
||||
* The data that is given to the client when they attempt to create a lobby.
|
||||
*/
|
||||
export interface LobbyCreateResponse extends ServerResponse {
|
||||
|
||||
/**
|
||||
* The ID of the lobby, this is used so that other players may join the
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import { ServerResponse } from "../ServerResponse";
|
||||
import { PlayerData } from "../PlayerData";
|
||||
import { ServerResponse } from "../../ServerResponse";
|
||||
import { PlayerData } from "../../PlayerData";
|
||||
|
||||
/** The data required by the server to be able to join a game */
|
||||
export interface IGameJoinRequest {
|
||||
export interface LobbyJoinRequest {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** The response that the player receives upon succesfully joining a game. */
|
||||
export interface IGameJoinResponse extends ServerResponse {
|
||||
export interface LobbyJoinResponse extends ServerResponse {
|
||||
players?: PlayerData[];
|
||||
}
|
||||
10
common/src/types/events/players/update.ts
Normal file
10
common/src/types/events/players/update.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { ServerResponse } from "../../ServerResponse";
|
||||
import { PlayerData } from "../../PlayerData";
|
||||
|
||||
/**
|
||||
* The data that the server is requesting connected clients use while updating
|
||||
* their lobby information.
|
||||
*/
|
||||
export interface PlayerUpdateResponse extends ServerResponse {
|
||||
players?: PlayerData[];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue