fmbenhassine / gamehub.io Goto Github PK
View Code? Open in Web Editor NEWReal-time multiplayer game server based on Node + Express + SocketIO + MongoDB + ElasticSearch
License: MIT License
Real-time multiplayer game server based on Node + Express + SocketIO + MongoDB + ElasticSearch
License: MIT License
Currently, the user should install node + mongo + elasticsearch to run chesshub.
It would be awesome to provide vagrant/docker files to setup all these prerequisites so that the user can just run the pre-built application in a vagrant VM or docker container.
$ node initdata
Elasticsearch INFO: 2017-01-11T03:19:19Z
Adding connection to http://localhost:9200/
Elasticsearch DEBUG: 2017-01-11T03:19:19Z
starting request {
"method": "HEAD",
"requestTimeout": 5000,
"castExists": true,
"path": "/",
"query": {}
}
Elasticsearch DEBUG: 2017-01-11T03:19:19Z
starting request {
"method": "PUT",
"path": "/chesshub",
"query": {}
}
(node:7088) DeprecationWarning: Mongoose: mpromise (mongoose's default promise l
ibrary) is deprecated, plug in your own promise library instead: http://mongoose
js.com/docs/promises.html
Elasticsearch TRACE: 2017-01-11T03:19:20Z
-> HEAD http://localhost:9200/
<- 0
Elasticsearch ERROR: 2017-01-11T03:19:20Z
Error: Request error, retrying
HEAD http://localhost:9200/ => connect ECONNREFUSED 127.0.0.1:9200
at Log.error (C:\Users\MyPC\Desktop\gamehub.io-master\node_modules\elastic
search\src\lib\log.js:225:56)
at checkRespForFailure (C:\Users\MyPC\Desktop\gamehub.io-master\node_modul
es\elasticsearch\src\lib\transport.js:240:18)
at HttpConnector. (C:\Users\MyPC\Desktop\gamehub.io-master\node
_modules\elasticsearch\src\lib\connectors\http.js:162:7)
at ClientRequest.wrapper (C:\Users\MyPC\Desktop\gamehub.io-master\node_mod
ules\elasticsearch\node_modules\lodash\lodash.js:4968:19)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:309:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1281:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Elasticsearch TRACE: 2017-01-11T03:19:20Z
-> PUT http://localhost:9200/chesshub
<- 0
Elasticsearch ERROR: 2017-01-11T03:19:20Z
Error: Request error, retrying
PUT http://localhost:9200/chesshub => connect ECONNREFUSED 127.0.0.1:9200
at Log.error (C:\Users\MyPC\Desktop\gamehub.io-master\node_modules\elastic
search\src\lib\log.js:225:56)
at checkRespForFailure (C:\Users\MyPC\Desktop\gamehub.io-master\node_modul
es\elasticsearch\src\lib\transport.js:240:18)
at HttpConnector. (C:\Users\MyPC\Desktop\gamehub.io-master\node
_modules\elasticsearch\src\lib\connectors\http.js:162:7)
at ClientRequest.wrapper (C:\Users\MyPC\Desktop\gamehub.io-master\node_mod
ules\elasticsearch\node_modules\lodash\lodash.js:4968:19)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:309:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1281:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Elasticsearch TRACE: 2017-01-11T03:19:21Z
-> HEAD http://localhost:9200/
<- 0
Elasticsearch WARNING: 2017-01-11T03:19:21Z
Unable to revive connection: http://localhost:9200/
Elasticsearch WARNING: 2017-01-11T03:19:21Z
No living connections
elasticsearch is down!
Elasticsearch TRACE: 2017-01-11T03:19:21Z
-> HEAD http://localhost:9200/
<- 0
Elasticsearch WARNING: 2017-01-11T03:19:21Z
Unable to revive connection: http://localhost:9200/
Elasticsearch WARNING: 2017-01-11T03:19:21Z
No living connections
Elasticsearch DEBUG: 2017-01-11T03:19:21Z
starting request {
"method": "POST",
"path": "/chesshub/game/1/_create",
"body": {
"white": "Foo",
"black": "Anonymous",
"content": "1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. c3 O-O 6. d4 exd4
7. cxd4 Bb4",
"result": "1-0"
},
"query": {}
}
Elasticsearch TRACE: 2017-01-11T03:19:22Z
-> HEAD http://localhost:9200/
<- 0
Elasticsearch WARNING: 2017-01-11T03:19:22Z
Unable to revive connection: http://localhost:9200/
Elasticsearch WARNING: 2017-01-11T03:19:22Z
No living connections
Elasticsearch DEBUG: 2017-01-11T03:19:23Z
starting request {
"method": "POST",
"path": "/chesshub/game/2/_create",
"body": {
"white": "Anonymous",
"black": "Bar",
"content": "1. e4 c6 2. e5 d5 3. exd6 exd6 4. Nf3 Bg4 5. d4 Nf6 6. Bg5 Be7
",
"result": "1-0"
},
"query": {}
}
On trying to run the project, I got the following error:
Error: Cannot find module 'mongodb/node_modules/bson'
This issue is also referenced here: Automattic/mongoose#2718 (Although the fix there did not help me). Updating mongoose to 4.7.4 fixed the issue for me.
Has anybody else seen this error (or is it something to do with my system?) and know any other fixes? I could submit a pull request for updating the mongoose version if that's ok also.
Thanks!
The app should use mongodb (through connect-mongo) to store sessions instead of in memory storage (not for production).
Currently, the application works fine in a local environment.
As soon as the client and server are deployed on separate machines, a Cross Origin Request error occurs. This can be fixed by enabling cross-origin resource sharing. See here:
It would be cool to have a kind of chat inside the web page in some place.
Hello, we are Korean university students. This project is an area we are interested in, so we would like to contribute.
We want to contribute through the Korean translation of the project. Is it okay to contribute?
Hello Benas
Thank you for your great work
I am using your game hub, that is perfect, but i don't see any ide for project
Could you please give what ide are you using to development this project ? is that eclipse ?
Thank you so much
Tran
@benas @galal-hussein is this mobile compatible? If not, how can I make it so??
Currently, the host and port configuration is hardcoded (localhost:3000) both on client and server side.
This should be configurable at application startup using process.env.PORT
If I make the windows smaller, I can't see properly the litle circle that indicates that is my turn
It is possible to play chess on chesshub.io as anonymous. Games played by anonymous players are not saved in the database. In contrast, when a registered user plays a game, the game should be persisted to the database and indexed in elastic search
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.