mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
* fix three panel layout height issue * rename websocket/services to websocket/persistence, implement LeaveRoom * cleanup * add new line eof * move route components from /components to /containers * remove duplicate style Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
19 lines
657 B
TypeScript
19 lines
657 B
TypeScript
import { StatusEnum } from "types";
|
|
|
|
export const ServerIdentification = {
|
|
id: ".Event_ServerIdentification.ext",
|
|
action: (info, webClient, _raw) => {
|
|
const { serverName, serverVersion, protocolVersion } = info;
|
|
|
|
if (protocolVersion !== webClient.protocolVersion) {
|
|
webClient.disconnect();
|
|
webClient.updateStatus(StatusEnum.DISCONNECTED, "Protocol version mismatch: " + protocolVersion);
|
|
return;
|
|
}
|
|
|
|
webClient.resetConnectionvars();
|
|
webClient.updateStatus(StatusEnum.LOGGINGIN, "Logging in...");
|
|
webClient.persistence.session.updateInfo(serverName, serverVersion);
|
|
webClient.commands.session.login();
|
|
}
|
|
};
|