Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Refactor the server to use a PubSub architecture #16

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dist/events.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export declare const PLAYER_CONNECT = "PLAYER_CONNECT";
export declare const PLAYER_DISCONNECT = "PLAYER_DISCONNECT";
export declare const LOBBY_CREATE = "LOBBY_CREATE";
export declare const LOBBY_JOIN = "LOBBY_JOIN";
export declare const TOURNAMENT_START = "TOURNAMENT_START";
export declare const UPDATE_STATS = "UPDATE_STATS";
export declare const LOG = "LOG";
export declare const MATCH_START = "MATCH_START";
export declare const MATCH_END = "MATCH_END";
export declare const GAME_START = "GAME_START";
export declare const GAME_END = "GAME_END";
export declare const PLAYER_DATA = "PLAYER_DATA";
export declare const SEND_PLAYER_DATA = "SEND_PLAYER_DATA";
export declare const success: (event: string) => string;
export declare const pending: (event: string) => string;
export declare const failure: (event: string) => string;
19 changes: 19 additions & 0 deletions dist/events.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/events.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dist/server/Server.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Options } from "../lib/cli-options";
export default class Server {
import PubSubber from "../tournament/model/Subscriber";
export default class Server extends PubSubber {
private options;
private players;
private lobbies;
Expand All @@ -11,8 +12,6 @@ export default class Server {
private onLobbyCreate;
private onLobbyJoin;
private onLobbyTournamentStart;
private updateStats;
private addPlayer;
private removePlayer;
private log;
}
104 changes: 50 additions & 54 deletions dist/server/Server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading