~starkingdoms/starkingdoms

ref: cc06268120ce59ec3fce2bcedbc5594f26a86a10 starkingdoms/client/src/index.ts -rw-r--r-- 924 bytes
cc062681 — c0repwn3r basic handshake with server 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//import * as PIXI from "pixi.js";

import {Logger, logSetup} from "./logger";
import {gateway_connect, GatewayClient} from "./gateway";

logSetup();
const logger = new Logger("client");

export interface GlobalData {
    client: GatewayClient | null
}

export const global: GlobalData = {
    client: null
}

async function client_main(server: string, username: string) {
    logger.info("StarKingdoms client - starting");

    global.client = await gateway_connect(server, username);
}

client_main("ws://localhost:3000/ws", "core").then(() => {});

/*

let app = new PIXI.Application({width: window.innerWidth, height: window.innerHeight, resizeTo: window });

// @ts-ignore
document.body.appendChild(app.view);

let sprite = PIXI.Sprite.from("./hearty.png");
app.stage.addChild(sprite);

let elapsed = 0.0;
app.ticker.add((delta) => {
    elapsed += delta;
    sprite.x = 100.0 + Math.cos(elapsed/50.0) * 100.0;
});

 */