Steps to reproduce:
Followed : https://www.wikihow.com/Install-Node.Js-on-Windows to install NPM
- https://nodejs.org/en/ Download and run: \users\Administrator\Downloads\node-v10.15.1-x64.msi
set PATH=c:\"Program Files"\nodejs;%HAXE_PATH%;%NEKOPATH%;%PATH%
node -v
npm install typescript
Download colyseus examples: https://github.com/colyseus/colyseus-examples : Clone/Download ZIP
Extract in C:\
cd \colyseus-examples-master
npm install
npm run bundle-colyseus-client
npm start
Now for the HaXe Part:
Download https://github.com/HaxeFoundation/haxe/releases/download/3.4.4/haxe-3.4.4-win64.exe
c:> haxe-3.4.4-win65.exe
let it create default c:\HaxeToolkit :
Setting DOS Environment:
set HAXE_PATH=c:\HaxeToolkit\haxe
set NEKOPATH=c:\HaxeToolkit\neko
set PATH=%HAXE_PATH%;%NEKOPATH%;%PATH%
haxelib setup c:\HaxeToolkit\haxe\lib
haxelib --global update haxelib
haxelib install openfl
haxelib run openfl setup
haxelib run lime setup
lime create HelloWorld
cd HelloWorld
lime test html5
lime setup windows
Download Visual Studio 16
vs_community__956414624.1551197993.exe
Choose : Desktop development with C++ AND Click C++/CLI support
lime test windows
The installed 4.0.8 hxcpp does not contain run script apparantly , so set to original hxcpp:
haxelib set hxcpp hxcpp
When 'Error : Could not process asset libraries' then do:
openfl rebuild tools
COLYSEUS
Download ZIP from GitHub : https://github.com/colyseus/colyseus-hx
Extract the archive to c:\HaxeToolkit so that the project.xml is in c:\HaxeToolkit\colyseus-hx-master
Modify the Main.hx: to mkae sure that the localhost line is active and the "ws://colyseus-examples.herokuapp.com"); is commented out
this.client = new Client("ws://localhost:2567");
Build the NyanCat example
c:> cd \HaxeToolkit\colyseus-hx-master\example\NyanCat
C:\HaxeToolkit\colyseus-hx-master\example\NyanCat>lime build project.xml html5
Error: Could not find haxelib "haxe-ws", does it need to be installed?
Install haxe-ws 1.0.5
haxelib install haxe-ws
lime test html5
It should now produce the nyancat window where you can move around with the cursor keys
C:\HaxeToolkit\colyseus-hx-master\example\NyanCat>lime build project.xml windows
lime test windows
LEAVING ROOM Crash:
Now we change the Main.hx to include leaving room
this.client = new Client("ws://localhost:2567");
//this.client = new Client("ws://colyseus-examples.herokuapp.com");
this.room = this.client.join("state_handler");
var timer = new haxe.Timer(5000);
timer.run = function() {
trace(" Leave Room ");
this.room.leave();
var timer2=new haxe.Timer(2000);
timer2.run = function (){
timer2.stop();
trace(" Create new room ... " );
this.room = this.client.join("state_handler");
};
};
Build and lime test the windows version
When you see CLIENT: ERROR you should stop the program and start the program again.
Repeat to use lime test windows
After a while; approximate < 10 minutes; it will crash