mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Structure change (#4220)
* Structure change * Remove duplicate folders from previous structure * Cleanup websocket protocol * Updating from based off PR * Fixup - remove wrong files during conflict and get the websocket working * renaming tsx to ts Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
a0deb73df6
commit
1ddc9cc929
123 changed files with 424 additions and 228 deletions
|
|
@ -0,0 +1,19 @@
|
|||
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.services.session.updateInfo(serverName, serverVersion);
|
||||
webClient.commands.session.login();
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue