Colyseus Multiplayer Client for Haxe

Hi there!

I’d like to announce that Colyseus finally has a client for Haxe, which I was planning to have since a long time ago.

If you’re interested in developing multiplayer games, you may find this server and client library useful. The client library was tested on html5, neko, cpp and ios targets.

Simple demo

This demo uses the state_handler room, from the official examples repository. (You can check more links in the description of the video.)

About the project

Colyseus is an Open-Source Multiplayer Game Server for NodeJS. It has a server state sync mechanism designed to be simple to use.

5 Likes

Hello, congrats on the Haxe support for the library.

Trying to send a string as a message from one client to the others in the same room, in the nyamcat example, but not getting there.
Shouldn’t : this.room.send({ message: “TEST”}); register with the onMessage functions?

            this.room.onMessage = function (message) {
		trace("ROOM MESSAGE: " + Std.string(message));
	};

Is there a way to broadcast like in 01-chat-room.ts colyseus example?

Edit 1: Managed to get the messages showing in the running server at 2567 but not being able to broadcast to other clients in the same room, still. this.room.send({message:‘TEST’}); stops at the server and other clients don’t get the test message.

Edit 2: I see broadcast is only available in the server so pretty much a mute point to ask for it in the client.

1 Like

Hi everyone! Recently I’ve updated the server to version 0.11 , as well as the Haxe client library. Here’s the migration guide pointing out all the changes https://docs.colyseus.io/migrating/0.11/

The new serialization algorithm has landed too, the performance and bandwidth consumption has been improved quite a bit!

@Franky there’s no broadcast() method available in the client, but you can easily make this happen when you receive a message in the server. I’ve made a template RelayRoom that can be used and modified for your needs, here: https://github.com/colyseus/colyseus/blob/master/src/rooms/RelayRoom.ts
(@Franky sorry for the huge delay to reply (one year?), I don’t log in here frequently, just turned on notifications :slight_smile: )

3 Likes

No worries @endel, great work on the lib, will be looking up the version changes and the relay example. Thank you!

1 Like

I am trying to compile the NyanCat example using Colyseus.
Any idea why it stopped on this error ? It is the Client.hx file.

Hi @VishwasGagrani, are you using the latest version of Haxe? I believe this syntax is not allowed on Haxe 3. Should be fine on Haxe 4.

Feel free to join Colyseus’ Discord server if you have any questions: https://discord.gg/RY8rRS7

Cheers