@towercg2/server
Version:
The server runtime for the TowerCG2 video graphics system.
18 lines (14 loc) • 353 B
text/typescript
import SocketIO from "socket.io";
import {
ClientInfo
} from "@towercg2/client";
export interface Constructor {
new(...args: any[]): any
}
export function socketToClientInfo(socket: SocketIO.Socket): ClientInfo {
return {
clientId: socket.id,
clientAddress: socket.handshake.address,
clientConnectedAt: socket.handshake.time
};
}