Giter Site home page Giter Site logo

colyseus / colyseus-websocket-hx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soywiz-archive/haxe-ws

27.0 27.0 11.0 114 KB

(Haxe) WebSocket client aimed for all platforms

Home Page: https://lib.haxe.org/p/colyseus-websocket

License: MIT License

HTML 0.21% Haxe 99.79%
haxe haxelib websockets

colyseus-websocket-hx's Introduction



Discussion forum

Multiplayer Framework for Node.js.
View documentation

Colyseus is an Authoritative Multiplayer Framework for Node.js, with SDKs available for the Web, Unity, Defold, Haxe, Cocos and Construct3. (See official SDKs)

The project focuses on providing synchronizable data structures for realtime and turn-based games, matchmaking, and ease of usage both on the server-side and client-side.

The mission of the framework is to be a standard netcode & matchmaking solution for any kind of project you can think of!

Key features:

  • WebSocket-based communication
  • Simple API in the server-side and client-side.
  • Automatic state synchronization from server-to-client (delta compressed)
  • Matchmaking clients into game rooms/sessions
  • Scale vertically or horizontally

See public roadmap for future plans.

๐Ÿš€ Quickstart

Create a bare-bones Colyseus server by using npm create colyseus-app@latest:

npm create colyseus-app@latest my-colyseus-server
cd my-colyseus-server
npm start

Sponsors

The sustainability of the project relies on Colyseus Cloud subscriptions and sponsorships. If you are not using Colyseus Cloud, please consider sponsoring the project ๐Ÿ’–

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Aymeric Chauvin

๐Ÿ’ฌ ๐Ÿ’ก

Brian Hay

๐Ÿ–‹

Damian A. Pastorini

๐Ÿ’ฌ ๐Ÿ“– ๐Ÿ›

Darek Greenly

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป

David Rydwanski

๐Ÿ’ฌ ๐Ÿ’ป

Dr. Burton

๐Ÿง‘โ€๐Ÿซ

Endel Dreyer

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก

Enriqueto

๐Ÿ’ผ

Fazri Zubair

๐Ÿ’ผ

Federico

๐Ÿ› ๐Ÿ’ป

James Jacoby

๐Ÿ’ฌ ๐Ÿ’ก ๐Ÿ–‹

Jonas Voland

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿค” ๐Ÿ’ก

Kyle J. Kemp

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿค”

Luke Wood

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป

Milad Doorbash

๐Ÿ› ๐Ÿ’ป

Nikita Borisov

๐Ÿ› ๐Ÿ’ป ๐Ÿ’ผ ๐Ÿค”

Phil Harvey

๐Ÿ“–

Sergey

๐Ÿ› ๐Ÿ’ป

Tom

๐Ÿ’ฌ ๐Ÿ› ๐Ÿค”

Tommy Leung

๐Ÿง‘โ€๐Ÿซ

digimbyte

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind are welcome!

Contributing

We encourage you to contribute to Colyseus! Please check out the Contributing guide for guidelines about how to proceed. Join us!

Everyone interacting in Colyseus and its sub-projects' codebases, issue trackers and chat rooms is expected to follow the code of conduct.

License

MIT

colyseus-websocket-hx's People

Contributors

9morello avatar dvergar avatar endel avatar fucksophie avatar imcasper avatar lpsandaruwan avatar markknol avatar mepsoid avatar realyuniquename avatar romamik avatar romanmikhailov avatar serjek avatar sh-dave avatar soywiz avatar tecteun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

colyseus-websocket-hx's Issues

Getting a compilation failure for python target

Thank you for this project. I've gotten a lot of good usage out of it. I ran into this error when targeting the python target:

src/haxe/net/Crypto.hx:19: characters 29-37 : Type not found : RandomOs

I'm running ubuntu with both python2 and python3 installed on my machine, and using master of this git repo. Do I need to specify which python version to use during compilation? Are there other libraries that I need to install? Any help is greatly appreciated.

Sending a message to the server throws "Custom(ssl_send)"

For some odd reason this error is thrown when the client sends a message to the server, this happens randomly

Logs:

haxe/net/impl/WebSocketGeneric.hx:104: Custom(ssl_send)
io/colyseus/Connection.hx:58: WebSocket connection has been closed, stopping the thread!

Server example Python target - NameError: name 'sys_ssl_Socket' is not defined

I'm getting a NameError: name 'sys_ssl_Socket' is not defined when adding a python target for the server example.

To reproduce:

  1. Add
--next

-python output/serverExamplePy.py
-cp src
-main haxe.net.example.WebSocketServerExample

to serverExample.hxml

  1. haxe serverExample.hxml
  2. python output/serverExamplePy.py

This results in the following traceback:

Traceback (most recent call last):
  File "output/serverExamplePy.py", line 3086, in <module>
    haxe_net_example_WebSocketServerExample.main()
  File "output/serverExamplePy.py", line 1375, in main
    server = haxe_net_WebSocketServer.create("0.0.0.0",port,1,True,False)
  File "output/serverExamplePy.py", line 1318, in create
    return haxe_net_WebSocketServer(host,port,maxConnections,isSecure,isDebug)
  File "output/serverExamplePy.py", line 1267, in __init__
    self._listenSocket = (sys_ssl_Socket() if (self._isSecure) else sys_net_Socket())
NameError: name 'sys_ssl_Socket' is not defined

Is this an issue with Haxe's python socket implementation? I'm new to haxe, so I'm not sure how to inspect this myself.

Thanks!

SocketSys Host resolve can take too much time.

In the hxcpp target, creating a new host instance runs the "_hx_std_host_resolve" function and it sometimes takes seconds to resolve the host, so creating the websocket can cause the application to freeze for seconds on the sys target.

image
image

Stack Trace:

this.impl.connect(new Host(host), port);

https://github.com/HaxeFoundation/haxe/blob/3c97999667770f3a5418817d99a98bc47ef930b0/std/cpp/_std/sys/net/Host.hx#L38
https://github.com/HaxeFoundation/haxe/blob/3c97999667770f3a5418817d99a98bc47ef930b0/std/cpp/NativeSocket.hx#L69
https://github.com/HaxeFoundation/hxcpp/blob/0f2e870f066ae456ac65d65c6fb1fbdd3b22f251/src/hx/libs/std/Socket.cpp#L354

Solution Suggestion: The host instance can be created in a different thread, and once created, they can be moved to the main thread, creating a thread-safe solution.

Unknown error code

image
I get this output when trying to compile the example server code(examples are outdated fyi), I am creating a websocket server with isSecure false and isDebug true.

RandomOs for python target

Hi,

The following is missing from the bottom of Crypto.hx

#if python
@:pythonImport("os")
extern class RandomOs
{
	static public function urandom(count:Int):Array<Int>;
}
#end

Otherwise, you get an error that RandomOs is not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.