Add server variable to the event handlers.

This commit is contained in:
Oliver-Akins 2020-10-08 21:30:39 -06:00
parent c5e1621366
commit c0e9efcc9f
16 changed files with 44 additions and 44 deletions

View file

@ -55,32 +55,32 @@ io.on(`connection`, (socket: sio.Socket) => {
log.silly(`Client connected with id ${socket.id}`);
// Game Management
socket.on(`HostGame`, (data: HostGame) => HostGame(socket, data));
socket.on(`JoinGame`, (data: JoinGame) => JoinGame(socket, data));
socket.on(`HostGame`, (data: HostGame) => HostGame(io, socket, data));
socket.on(`JoinGame`, (data: JoinGame) => JoinGame(io, socket, data));
// Join a game
socket.on(`StartGame`, (data: any) => StartGame(socket, data));
socket.on(`StartGame`, (data: any) => StartGame(io, socket, data));
// Chancellor Nominations
socket.on(`ChancellorNomination`, (data: any) => ChancellorNomination(socket, data));
socket.on(`ChancellorNomination`, (data: any) => ChancellorNomination(io, socket, data));
socket.on(`Vote`, Vote);
// Policy Receiving
socket.on(`PresidentPolicies`, (data: any) => PresidentPolicies(socket, data));
socket.on(`ChancellorPolicy`, (data: any) => ChancellorPolicy(socket, data));
socket.on(`VetoRequest`, (data: any) => VetoRequest(socket, data));
socket.on(`VetoConfirm`, (data: any) => VetoConfirm(socket, data));
socket.on(`PresidentPolicies`, (data: any) => PresidentPolicies(io, socket, data));
socket.on(`ChancellorPolicy`, (data: any) => ChancellorPolicy(io, socket, data));
socket.on(`VetoRequest`, (data: any) => VetoRequest(io, socket, data));
socket.on(`VetoConfirm`, (data: any) => VetoConfirm(io, socket, data));
// Special Actions
socket.on(`ExecutePlayer`, (data: any) => ExecutePlayer(socket, data));
socket.on(`NextPresident`, (data: any) => NextPresident(socket, data));
socket.on(`ExecutiveConfirmation`, (data: any) => ExecutiveConfirmation(socket, data));
socket.on(`InvestigateAffiliation`, (data: any) => InvestigateAffiliation(socket, data));
socket.on(`ExecutePlayer`, (data: any) => ExecutePlayer(io, socket, data));
socket.on(`NextPresident`, (data: any) => NextPresident(io, socket, data));
socket.on(`ExecutiveConfirmation`, (data: any) => ExecutiveConfirmation(io, socket, data));
socket.on(`InvestigateAffiliation`, (data: any) => InvestigateAffiliation(io, socket, data));
// Utility Events
socket.on(`GetPlayerList`, (data: GetPlayerList) => GetPlayerList(socket, data));
socket.on(`GetPlayerList`, (data: GetPlayerList) => GetPlayerList(io, socket, data));
});
io.on(`reconnect_attempt`, (socket: sio.Socket) => {