Subject: Colyseus HaXe Externs & Colyseus version 0.10
Took a break from the Colyseus Extension, but I'm back.
I was asked to create a MicroPhone HaXe extension for iOS and Android so that did take some time.
Also, I wanted to wait a bit till the version 0.10 was done on both of the client and server side.
Thanks to Serjek and Endel for their contributions, I was able to get a HaXe combination running with the Nyan Cat example.
Server Side: Oracle Linux
- Download : https://github.com/serjek/colyseus-hxjs
- Download : https://github.com/serjek/colyseus-hxjs-examples
- extract in /root/serjek directory
- Install npm : curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
- yum install -y nodejs`
- npm -version
6.5.0-next.0
HaXe - Download install-haxe.hs : https://gist.github.com/jgranick/8cc40e2e0f277146725f
- sh install-haxe.sh
- export LD_LIBRARY_PATH=/root/haxe/neko
- haxelib setup
/usr/lib/haxe/lib - cd /root/serjek/colyseus-hxjs-examples-master/
- npm i lix -g
- lix download
- Upgraded haxe to 4.0.0 preview 4 from : https://haxe.org/download/file/4.0.0-preview.4/haxe-4.0.0-preview.4-linux64.tar.gz/
- Updated the install-haxe.sh to reflect that .tar.gz
- ran install-haxe.sh again
- haxe -version
4.0.0-preview.4+1e3e5e0 - lix use haxe 4.0.0-rc.2
- Make sure that you are in the serjek/colyseus-hxjs-examples-master directory
- haxe server.hxml
- cd bin/server
- npm i yarn -g
- yarn
- node index.js
src/MainServer.hx:39: -- listening on 0.0.0.0:2567... --
New Session
- export LD_LIBRARY_PATH=/root/haxe/neko
- /usr/local/bin/haxe
- lix use haxe 4.0.0-rc.2
- haxe -version
4.0.0-preview.4+1e3e5e0 - cd /root/serjek/colyseus-hxjs-examples-master
- haxe client.hxml
- cd bin/client
- yarn
- node index.js
Test will run.
Now for the HaXe Client on Windows: https://github.com/colyseus/colyseus-hx
- https://github.com/HaxeFoundation/haxe/releases/download/3.4.4/haxe-3.4.4-win64.exe
- 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
Current version is 3.3.0 - haxelib install openfl
8.9.0 - haxelib run openfl setup
7.3.0 - haxelib run lime setup
Up to Date - lime create HelloWorld
- cd HelloWorld
- lime test html5
- extract the colyseus hx master to \haxetoolkit\colyseus-hx-master
- cd \HaxeToolkit\colyseus-hx-master\example\openfl\Source
- notepad Main.hx
Edit: the ws connection so that it points to the Linux Server mentioned above. - cd \HaxeToolkit\colyseus-hx-master\example\openfl
- haxelib install haxe-ws
- haxelib set hxcpp 3.2.94
(installing) - lime build project.xml html5
Error:
Source/Main.hx:55: characters 48-50 : Array<Unknown<0>> should be Null<Map<Strin
g, Dynamic>>
Source/Main.hx:55: characters 48-50 : Array<Unknown<0>> should be Map<String, Dy
namic>
Source/Main.hx:55: characters 48-50 : For optional function argument 'options'
Edit : c:\HaxeToolkit\colyseus-hx-master\src\io\colyseus\Client.hx
// M.E. @:generic public function join<T>(roomName: String, ?options: Map<String, Dynamic>, ?cls: Class<T>): Room<T> {
//this.room = this.client.join("state_handler", [], State);
this.room = this.client.join("state_handler", new Map<String,Dynamic>(), State);
Now the lime build project.xml html5 followed by lime test html5 work with the externs by Serjek.
That leaves me the task of creating a new Stencyl Extension that utilizes the
this.room.state.players.onAdd = function(player, key)
methodology rather than the
this.room.listen("players/:id", function(change) {
methodology.