import * as WebSocket from 'ws' ; import { GameClient , setWebSocket , } from '../lib' ; if ( process . argv . length < 4 ) { console . log ( 'Usage gameClient.exe <token> <versionId>' ) ; process . exit ( ) ; } setWebSocket ( WebSocket ) ; const client = new GameClient ( ) ; client . on ( 'open' , ( ) => console . log ( 'Connected to interactive' ) ) ; client . on ( 'message' , ( err ) => console . log ( '<<<' , err ) ) ; client . on ( 'send' , ( err ) => console . log ( '>>>' , err ) ) ; client . open ( { authToken : process . argv [ 2 ] , versionId : parseInt ( process . argv [ 3 ] , 10 ) , } ) . then ( ( ) => { return client . ready ( true ) ; } ) ;