Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error accesing game-server from remote #17

Open
frabaglia opened this issue Aug 8, 2016 · 1 comment
Open

Error accesing game-server from remote #17

frabaglia opened this issue Aug 8, 2016 · 1 comment

Comments

@frabaglia
Copy link

frabaglia commented Aug 8, 2016

I have read the %50 of the documentation and i'm actually trying to setup the chat example running the server on OSX 10.11.3, node v6.0.0, npm 3.10.5.

If i start the client connections from the local host, everything works fine. The clients see each other and the server show the logs normally.
If i try with other clients at the network, i start having trouble. The error is at client side:

1 - Mobile client accesing via LAN to the web client: 192.168.0.15:3001/index.html

img_0935

2 - Accesing by safari developer tools the console output is:

screen shot 2016-08-08 at 2 05 12 pm

3 - Debugging pomeloclient.js this is the variable states

screen shot 2016-08-08 at 2 04 57 pm

@SRWFan
Copy link

SRWFan commented Dec 18, 2017

game-server/app/servers/gate/handler/gateHandler.js
handler.queryEntry = function(msg, session, next) {
var uid = msg.uid;
if(!uid) {
next(null, {
code: 500
});
return;
}
// get all connectors
var connectors = this.app.getServersByType('connector');
if(!connectors || connectors.length === 0) {
next(null, {
code: 500
});
return;
}
// select connector
var res = dispatcher.dispatch(uid, connectors);
next(null, {
code: 200,
//host: res.host,
host: res.remoteHost || res.host,
port: res.clientPort
});
};

game-server/config/servers.json
{
"development":{
"connector":[
{"id":"connector-server-1","host":"127.0.0.1", "remoteHost":"YourIP", "port":4050, "clientPort": 3050, "frontend": true},
{"id":"connector-server-2","host":"127.0.0.1", "remoteHost":"YourIP", "port":4051, "clientPort": 3051, "frontend": true},
{"id":"connector-server-3","host":"127.0.0.1", "remoteHost":"YourIP", "port":4052, "clientPort": 3052, "frontend": true}
],
"chat":[
{"id":"chat-server-1", "host":"127.0.0.1", "port":6050},
{"id":"chat-server-2", "host":"127.0.0.1", "port":6051},
{"id":"chat-server-3", "host":"127.0.0.1", "port":6052}
],
"gate":[
{"id": "gate-server-1", "host": "127.0.0.1", "clientPort": 3014, "frontend": true}
]
},
"production":{
"connector":[
{"id":"connector-server-1", "host":"127.0.0.1", "port":4050, "clientPort": 3050, "frontend": true},
{"id":"connector-server-2", "host":"127.0.0.1", "port":4051, "clientPort": 3051, "frontend": true},
{"id":"connector-server-3", "host":"127.0.0.1", "port":4052, "clientPort": 3052, "frontend": true}
],
"chat":[
{"id":"chat-server-1", "host":"127.0.0.1", "port":6050},
{"id":"chat-server-2", "host":"127.0.0.1", "port":6051},
{"id":"chat-server-3", "host":"127.0.0.1", "port":6052}
],
"gate":[
{"id": "gate-server-1", "host": "127.0.0.1", "clientPort": 3014, "frontend": true}
]
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants