Coder Social home page Coder Social logo

netease / pomelo Goto Github PK

View Code? Open in Web Editor NEW
11.9K 1.1K 2.9K 59.65 MB

A fast,scalable,distributed game server framework for Node.js.

Home Page: http://pomelo.netease.com

License: MIT License

JavaScript 99.23% Shell 0.06% CSS 0.25% HTML 0.40% Batchfile 0.05%

pomelo's Introduction

Pomelo -- a fast, scalable game server framework for node.js

Pomelo is a fast, scalable game server framework for node.js. It provides the basic development framework and many related components, including libraries and tools. Pomelo is also suitable for real-time web applications; its distributed architecture makes pomelo scale better than other real-time web frameworks.

Build Status

Features

Complete support of game server and realtime application server architecture

  • Multiple-player game: mobile, social, web, MMO rpg(middle size)
  • Realtime application: chat, message push, etc.

Fast, scalable

  • Distributed (multi-process) architecture, can be easily scale up
  • Flexible server extension
  • Full performance optimization and test

Easy

  • Simple API: request, response, broadcast, etc.
  • Lightweight: high development efficiency based on node.js
  • Convention over configuration: almost zero config

Powerful

  • Many clients support, including javascript, flash, android, iOS, cocos2d-x, C
  • Many libraries and tools, including command line tool, admin tool, performance test tool, AI, path finding etc.
  • Good reference materials: full docs, many examples and an open-source MMO RPG demo

Extensible

  • Support plugin architecture, easy to add new features through plugins. We also provide many plugins like online status, master high availability.
  • Custom features, users can define their own network protocol, custom components very easy.

Why should I use pomelo?

Fast, scalable, real-time game server development is not an easy job, and a good container or framework can reduce its complexity. Unfortunately, unlike web, finding a game server framework solution is difficult, especially an open source solution. Pomelo fills this gap, providing a full solution for building game server frameworks. Pomelo has the following advantages:

  • The architecture is scalable. It uses a multi-process, single thread runtime architecture, which has been proven in the industry and is especially suited to the node.js thread model.
  • Easy to use, the development model is quite similar to web, using convention over configuration, with almost zero config. The API is also easy to use.
  • The framework is extensible. Based on the node.js micro module principle, the core of pomelo is small. All of the components, libraries and tools are individual npm modules, and anyone can create their own module to extend the framework.
  • The reference materials and documentation are quite complete. In addition to the documentation, we also provide an open-source MMO RPG demo (HTML5 client), which is a far better reference material than any book.

How can I develop with pomelo?

With the following references, you can quickly familiarize yourself with the pomelo development process:

Contributors

License

(The MIT License)

Copyright (c) 2012-2017 NetEase, Inc. and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pomelo's People

Contributors

blueseason avatar changchang avatar cooldd100 avatar cynron avatar demon0925 avatar fantasyni avatar impcyber avatar jiangzhuo avatar kaisatec avatar lellansin avatar ljhsai avatar mog422 avatar mrfranklin avatar neuqzxy avatar newebug avatar pipi32167 avatar py8765 avatar qiankanglai avatar roytan883 avatar skyblue avatar whtiehack avatar wuxian avatar xiecc avatar xieren58 avatar xuxbuptisc avatar youxiachai avatar zhanghaojie avatar zhangmin510 avatar zj8487 avatar zxc122333 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  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  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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pomelo's Issues

请教一些问题?

Hi,感谢开源pomelo框架,有一些问题请教下。
假设我有3个frontend server分别是A B C用于管理client的连接,1个backend server D处理聊天逻辑,假设user 1到user 10连接上A,user 11-user20连接上了B,user 21-user30连接上了C,global session是指单个front server中session集合,还是所有的front server中session集合?
如果user1 发送一条消息,A直接通过消息路由到D服务器处理,通过rpc来调用D的服务,此时D会copy一份user1的session是不是被称为local session?
backend server是基于功能的划分即垂直划分 如果单个backend server D处理不了那么多聊天请求,能否将垂直功能进一步的水平扩展,即将某个频道用户分布在不同的机器来处理?

Performance && Communication?

First, I am curious about the performance of your game, is there any performance problems to develop such a game?
Second, in such a big game the communication between the server side and the client must be quite frequent, is there any strategy that you use to make sure the messages are sent in order and won't be lost?

pomelo list show nothing

Hi, I have installed and run gameserver and webserver on ubuntu successfully, but when I run "pomelo list" in game-server folder, nothing display, I have to use ctrl-c to terminate it.
and when I click the "Test Game Server" on the webpage, nothing happen.

how does a message route to a spefic server

hi, pomelo is now quite popular, i also pay close attention to it
today , i see your articles about pomelo
i am concerned about how messages route to a spefic server
what i see from your web-server demo the request is like this

pomelo.request("area.playerHandler.enterScene",{}, function(msg) {
}); 

so how does it route to a area server
i am very curious , thanks for your feedback

关于Lordofpomelo基于灯塔的AOI服务的疑问

AOI服务

玩家的视野往往远远小于场景的大小,因此对于场景中的绝大部分消息,进行简单的全场景广播是没有必要而且无法承受的。而当消息发生时,如何确定该消息需要通知的对象就是AOI模块的工作。

Lordofpomelo中实现的是基于灯塔的AOI服务,其基本的方式是将整个地图划分为等大的tower,每个tower服务维护一个对象列表,指向在这个tower范围内的对象。然后在这个数据结构的基础上来触发各种AOI事件。

这里我有个疑问,如果,玩家A和B分别处于灯塔1,1和1,2的相近的边缘,玩家A如何确定是否需要同步消息给B玩家呢?

安装pomelo后,运行出错

在ubuntu10.10上安装了nodejs-0.8.14,然后安装pomelo模块,创建chatofpomelo后,在game-server目录下运行pomelo start
提示一下错误
[2012-11-28 19:33:41.468] [INFO] /node_modules/pomelo/node_modules/pomelo-admin/lib/consoleService.js - try to connect master: "master", "127.0.0.1", 3005
[2012-11-28 19:33:41.507] [ERROR] /node_modules/pomelo/lib/master/starter.js - FAILED TO RUN, return code: 127

pomelo list命令用不了!

提示:Fail to read the file, please check if the application is started legally.
我的Mac和Ubuntu都是这样!

log4js报错是为什么?

log4js.fileAppender - Writing to file logs/con-log-[serverId].log, error happened { [Error: ENOENT, open 'logs/con-log-[serverId].log']
errno: 34,
code: 'ENOENT',
path: 'logs/con-log-[serverId].log' }

浏览器兼容性问题

测试只能在v8下正常运行 , FF Safari 360 ios下运行都有问题 , 什么时候考虑兼容这些?

wsPort & port

I error configure the chat server with a wsport, and the request to chat server can't be accessed.
I thought the wsPort is used for outside access like clients and html pages, the port is used for communication between servers. But I don't know am I right? And the real reason of my error configuration.

安装问题

windows和ubuntu用npm都没安装成功过....是不是少装了什么东西

helloworld项目报错

localhost:helloWorld xiaohei107$ pomelo start development --daemon
Please go to your pomelo project workspace to operate the application.
localhost:helloWorld xiaohei107$ cd web-server && node app

module.js:340
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/Users/xiaohei107/Documents/GameDevelop/helloWorld/web-server/app.js:1:77)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
。。。求大师指导。

在启动游戏服务器时出现这个错误

[root@localhost lordofpomelo]# pomelo start

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'existsSync'
at Object. (/usr/local/lib/node_modules/pomelo/bin/pomelo:29:23)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
[root@localhost lordofpomelo]#

node.js 9.0 请大神帮忙看下错误

报错Origin http://42.121.56.72:3000 is not allowed by Access-Control-Allow-Origin.

我的程序自己开发过程中没问题,game-server和web-server都是127.0.0.1,但我现在部署到阿里云的服务器上的时候报了Origin http://42.121.56.72:3000 is not allowed by Access-Control-Allow-Origin.
网上搜了一下,http://blog.csdn.net/mibb005/article/details/7623704这里有类似的解决方式,但是我照着改了还是不行,我pomelo是全局安装的,因此我改的是/usr/lib/node_module/pomelo下面的socket.io,请问如何解决?

安装后,无法开启服务

root@glance:~/lordofpomelo# pomelo start
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.2.44

之前有部分出错,没看清。
修改了 shard目录下的mysql.json,而且进入game-server,然后启动也无效。。。

Language for Issues.

Hello,

I don't mean to be rude or inappropriate but:

Could you speak in English on Github ?

(I really don't speak Chinese and Google translate is really doing a terrible job).

That would make easier for me to contribute and to see what need to be fixed.

Thanks.

source code issue

Why ”defaultConfiguration“ should be executed twice in the source code,one is in app.js,another is in function init of application.js

关于游戏副本

我想请教一下用pomelo引擎的架构如何实现游戏副本机制比较合适呢?
据我目前了解,每个服务器进程都需要在server.json中配置。但是副本是动态的,而且一个进程一个副本显然也不合适。有没有什么简单又不费资源的方案呢?

Is the express framework necessary?

Question one:

Now I want to develop a game with the pomelo.
Because I am more familiar withSocketStream(another node.js web framework), I want to replace the express with the withSocketStream. Of course, your demo (lordofpomelo) used express for the web framework.

Can I do it so?:

One more question:

Why the command "pomelo stop" can not work well sometimes? If so, what can I do to close all the servers?

Thanks!
TyroneJuno

请教一些pomelo常见日志报错原因和解决办法

game-server 日志

  • [2012-11-22 09:01:31.889] [ERROR] /node_modules/pomelo/lib/master/starter.js - FAILED TO RUN, return code: 1
  • [2012-11-22 09:01:31.481] [ERROR] console - Caught exception: Error: spawn ENOMEM
    at errnoException (child_process.js:847:11)
    at ChildProcess.spawn (child_process.js:794:11)
    at exports.spawn (child_process.js:618:9)
    at Object.exports.execFile (child_process.js:510:15)
    at Object.exports.exec (child_process.js:481:18)
    at spawnProcess (/opt/lordof/lordofpomelo-master/game-server/node_modules/pomelo/lib/master/starter.js:143:14)
    at Object.starter.localrun (/opt/lordof/lordofpomelo-master/game-server/node_modules/pomelo/lib/master/starter.js:104:2)
    at Object.starter.run (/opt/lordof/lordofpomelo-master/game-server/node_modules/pomelo/lib/master/starter.js:38:11)
    at Object.starter.runServers (/opt/lordof/lordofpomelo-master/game-server/node_modules/pomelo/lib/master/starter.js:18:8)
    at Server.start.masterConsole.on.self.registered.(anonymous function) (/opt/lordof/lordofpomelo-master/game-server/node_modules/pomelo/lib/master/master.js:38:11)

web-server 日志

  • { code: undefined, msg: 'connect EHOSTUNREACH' }

ps:希望wiki增加一些Q&A

The question of using fully node.js based communications

I am curious - it seems like pomelo's backend server-server communications rely on mailboxes, which are powered by node's nativenet module (which means raw sockets), which is fine and dandy, but I wonder why go the extend to write so much new code when you guys could have utilized something like zeromq to achieve essentially the same things?

关于聊天室demo源代码的小疑问

 pomelo是否对socket.io部分做了一层封装,封装在pomeloclient.js文件下。例如在client.js中的queryEntry方法(检查进入聊天室的名字是否存在)。

// query connector
function queryEntry(uid, callback) {
var route = 'gate.gateHandler.queryEntry';
pomelo.init({
host: window.location.hostname,
port: 3014,
log: true
}, function() {
pomelo.request(route, {
uid: uid
}, function(data) {
pomelo.disconnect();
if (data.code === 500) {
showError(LOGIN_ERROR);
return;
}
callback(data.host, data.port);
});
});
};

当调用pomelo.init时候会调用pomeloclient.js下的
pomelo.init = function(params, cb){
pomelo.params = params;
params.debug = true;
var host = params.host;
var port = params.port;

var url = 'ws://' + host;
if(port) {
  url +=  ':' + port;
}

socket = io.connect(url, {'force new connection': true, reconnect: false});

socket.on('connect', function(){
  console.log('[pomeloclient.init] websocket connected!');
  if (cb) {
    cb(socket);
  }
});

socket.on('reconnect', function() {
  console.log('reconnect');
});

socket.on('message', function(data){
  if(typeof data === 'string') {
    data = JSON.parse(data);
  }
  if(data instanceof Array) {
    processMessageBatch(pomelo, data);
  } else {
    processMessage(pomelo, data);
  }
});

socket.on('error', function(err) {
  console.log(err);
});

socket.on('disconnect', function(reason) {
  pomelo.emit('disconnect', reason);
});

};

但是 socket = io.connect(url, {'force new connection': true, reconnect: false}); 这个没看懂 整个文件上下文除了这里没有出现过io,他是怎么关联socket.io的。

还有cilent中pomelo变量初始化:var pomelo = window.pomelo;
这和一般nodejs中模块调用貌似不太一样看了下pomeloclient.js中exports的部分:
if (typeof module !== 'undefined' && module.exports) {
module.exports.EventEmitter = EventEmitter;
}
else {
root = window;
root.EventEmitter = EventEmitter;
}

.....

(function (exports, global) {

var Protocol = exports;

var HEADER = 5;

var Message = function(id,route,body){
this.id = id;
this.route = route;
this.body = body;
};

/**
*
*pomele client encode

  • id message id;
  • route message route
  • msg message body
  • socketio current support string
    *
    */
    Protocol.encode = function(id,route,msg){
    var msgStr = JSON.stringify(msg);
    if (route.length>255) { throw new Error('route maxlength is overflow'); }
    var byteArray = new Uint16Array(HEADER + route.length + msgStr.length);
    var index = 0;
    byteArray[index++] = (id>>24) & 0xFF;
    byteArray[index++] = (id>>16) & 0xFF;
    byteArray[index++] = (id>>8) & 0xFF;
    byteArray[index++] = id & 0xFF;
    byteArray[index++] = route.length & 0xFF;
    for(var i = 0;i<route.length;i++){
    byteArray[index++] = route.charCodeAt(i);
    }
    for (var i = 0; i < msgStr.length; i++) {
    byteArray[index++] = msgStr.charCodeAt(i);
    }
    return bt2Str(byteArray,0,byteArray.length);
    };

/**
*
*client decode
*msg String data
*return Message Object
*/
Protocol.decode = function(msg){
var idx, len = msg.length, arr = new Array( len );
for ( idx = 0 ; idx < len ; ++idx ) {
arr[idx] = msg.charCodeAt(idx);
}
var index = 0;
var buf = new Uint16Array(arr);
var id = ((buf[index++] <<24) | (buf[index++]) << 16 | (buf[index++]) << 8 | buf[index++]) >>>0;
var routeLen = buf[HEADER-1];
var route = bt2Str(buf,HEADER, routeLen+HEADER);
var body = bt2Str(buf,routeLen+HEADER,buf.length);
return new Message(id,route,body);
};

var bt2Str = function(byteArray,start,end) {
var result = "";
for(var i = start; i < byteArray.length && i<end; i++) {
result = result + String.fromCharCode(byteArray[i]);
};
return result;
}

})('object' === typeof module ? module.exports : (this.Protocol = {}), this);

没理清他是怎么把接口exports出去的。

nodejs菜鸟求指导。。。

安装卡死问题

提示:

[ws v0.4.23] Attempting to compile blazing fast native extensions.
[ws v0.4.23] Attempting to compile blazing fast native extensions.
[ws v0.4.23] Attempting to compile blazing fast native extensions.

然后用control+C/Z 跳出

然后就没有然后了...

更新lordofpomelo后服务器启动失败

[2012-12-04 13:57:15.047] [INFO] console - /home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo-aoi/lib/towerAOI/towerAOI.js:10

[2012-12-04 13:57:15.047] [INFO] console - this.width = config.tower.width;

[2012-12-04 13:57:15.047] [INFO] console - ^

[2012-12-04 13:57:15.068] [INFO] console - TypeError: Cannot read property 'width' of undefined
at new TowerAOI (/home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo-aoi/lib/towerAOI/towerAOI.js:10:28)
at Object.exp.getService (/home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo-aoi/lib/towerAOI/towerAOI.js:358:10)
at new AOIService (/home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo-aoi/lib/aoiService.js:12:25)
at Object.exp.getService (/home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo-aoi/lib/aoiService.js:100:10)
at Object.exp.init (/home/Hengstar/workspace/lordofpomelo/game-server/app/domain/area/area.js:48:19)
at Object. (/home/Hengstar/workspace/lordofpomelo/game-server/app.js:76:7)
at Object.Application.configure (/home/Hengstar/workspace/lordofpomelo/game-server/node_modules/pomelo/lib/application.js:541:7)
at Object. (/home/Hengstar/workspace/lordofpomelo/game-server/app.js:67:5)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)

[2012-12-04 13:57:15.070] [ERROR] /node_modules/pomelo/lib/master/starter.js - FAILED TO RUN, return code: 1

看起来像是少数据文件了?
我用git pull下来的,已经是最新的了

关于socket.io传输的疑问

之前没有接触过socket.io这几天研究了下发现支持好些协议,使用也比较方便。但是我担心的是和客户端通讯的数据流量问题,我们做移动端的游戏,希望尽可能的省流量。但是据我看来socket.io的这种消息模式比较类似于json字符串。我们之前的消息都是用2-4字节的ID号发送,消息体都是自定义的序列化/反序列化,每个可用于网络发送消息的类定义一个对应的序列化和反序列化。类似与Boost的serialization机制,虽然这样比较麻烦,但是可以节省流量。我想了解下socket.io支不支持这样的发送方式,怎样尽可能的节省流量呢?谢谢~

lordofpomelo 中Js的不理解

在web-server/js/*.js中,所有文件的js结构均如下所示:
resources["/equipmentsPanelView.js"] = {
meta: {
mimetype: "application/javascript"
},

data:function(.....){}
}

请问为和要这么写?麻烦解释下工作原理?

Question about Session

Document say Api "session.push": Push the key/value in local session to the global session.
In my test,global session only mean the area in the same server(such as connector),but how can the the session share between servers?
For example,in connector server i put a key/value in session and call session.push,then I want to get the key/value in chat server?

是不是Global只能在server内部共享,在例子chatofpomelo中,有没有办法让我在connector的session中保存一个变量,然后在chathandler中获得这个变量?还是说所有与session有关的调用都应该在connector中定义接口,然后由connector中通过rpc调用chat remote handler中的方法来实现?

pomelo安装失败

npm ERR! npm ERR! Maximum call stack size exceeded
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 2.6.18-194.el5
npm ERR! command "node" "/usr/local/bin/npm" "install" "pomelo" "-g"
npm ERR! cwd /root/lordofpomelo
npm ERR! node -v v0.6.4
npm ERR! npm -v 1.1.65
npm ERR! type stack_overflow
sh-3.2# make
make: *** No targets specified and no makefile found. Stop.
sh-3.2# pomelo
sh: pomelo: command not found

无法安装pomelo,貌似改装的都装了,求指教

Help, pomelo list not work?

Hello,

Fail to read the file, please check if the application is started legally

When i run ' pomelo list ' command,

How to fix it ?

Help me please.

Thanks
XForest

请教关于游戏数据和游戏处理逻辑位置的问题

之前也在做一个基于node的游戏框架,目前所使用的进程结构划分和贵公司的框架不谋而合,我们是把进程分为“通信进程”和“逻辑进程”两类。然后使用一个局部调度器在某一台机器上进行进程的创建工作。最上层有一个总控调度器负责监控所有分布式部署的机器的进程情况。此为背景。。。

我现在遇到一个问题,就是在“逻辑进程”中(类似于你们的backend),游戏数据是存放在进程里作为各种类型的js对象存在的,原因是之前调研过的各种存储方案,不是速度不行,就是存储结构过于简单,无法适应复杂业务逻辑对象的存储(在js对象中可以使用各种js语法特性,包括通过集成emitter类实现观察者模式)。
但是这样产生一个问题,就是数据既然存放在逻辑进程中,那么就无法被其他逻辑进程共享,换句话说,逻辑进程无法水平扩展。比如一个游戏场景(一个房间)的业务数据和逻辑,最多只能由一个进程来处理(反之目前是可以的,一个进程有余力的话可以处理多个场景),当一个场景的人数比较多的时候,比如3000人,那么我们现在的架构就可能在逻辑处理端发生瓶颈。
请问你们的游戏数据、游戏处理逻辑是分开的还是在一个进程中?具体使用的什么技术?希望可以进行交流。我的qq 263753885.

关于server.json的疑问

{
"connector": [
{"id": "connector-server-1", "host": "127.0.0.1", "port": 3150, "wsPort":3010},
{"id": "connector-server-2", "host": "127.0.0.1", "port": 3151, "wsPort":3011},
{"id": "connector-server-3", "host": "127.0.0.1", "port": 3152, "wsPort":3012},
{"id": "connector-server-4", "host": "127.0.0.1", "port": 3153, "wsPort":3013}
],
"area": [
{"id": "area-server-1", "host": "127.0.0.1", "port": 3250, "area": 1},
{"id": "area-server-2", "host": "127.0.0.1", "port": 3251, "area": 2},
{"id": "area-server-3", "host": "127.0.0.1", "port": 3252, "area": 3}
],
"chat":[
{"id":"chat-server-1","host":"127.0.0.1","port":3450}
],
"path": [
{"id": "path-server-1", "host": "127.0.0.1", "port": 3550}
],
"auth": [
{"id": "auth-server-1", "host": "127.0.0.1", "port": 3650}
],
"gate": [
{"id": "gate-server-1", "host": "127.0.0.1", "wsPort": 3014}
]
}

这是loadofpomelo的server.json ,connector,area,chat,path,auth,gate这几个服务器是干嘛的?

Windows installation failed...

Hi,

When trying to install it "npm intall pomelo -g", it failed with the following message: "error MSB40419: the imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, ad that the file exist on disk."

I don`t have Mircrosoft Visual Studio installed, is that a problem?
If not how could I resolved this?

Thanks
Alain

今天重新下载DEMO后不能启动程序

[2012-12-10 11:11:16.974] [INFO] console - /Users/VR007/Downloads/lordofpomelo-master/game-server/node_modules/pomelo-aoi/lib/towerAOI/towerAOI.js:87

[2012-12-10 11:11:16.975] [INFO] console - this.towers[p.x][p.y].add(obj);
^

[2012-12-10 11:11:17.091] [INFO] console - TypeError: Cannot read property 'NaN' of undefined
at pro.addObject (/Users/VR007/Downloads/lordofpomelo-master/game-server/node_modules/pomelo-aoi/lib/towerAOI/towerAOI.js:87:21)
at pro.addObject (/Users/VR007/Downloads/lordofpomelo-master/game-server/node_modules/pomelo-aoi/lib/aoiService.js:45:19)
at Object.exp.addEntity (/Users/VR007/Downloads/lordofpomelo-master/game-server/app/domain/area/area.js:145:6)
at initNPCs (/Users/VR007/Downloads/lordofpomelo-master/game-server/app/domain/area/area.js:86:7)
at Object.exp.init (/Users/VR007/Downloads/lordofpomelo-master/game-server/app/domain/area/area.js:53:2)
at Object. (/Users/VR007/Downloads/lordofpomelo-master/game-server/app.js:76:7)
at Object.Application.configure (/Users/VR007/Downloads/lordofpomelo-master/game-server/node_modules/pomelo/lib/application.js:541:7)
at Object. (/Users/VR007/Downloads/lordofpomelo-master/game-server/app.js:67:5)
at Module._compile (module.js:449:26)
at Object.Modu

[2012-12-10 11:11:17.093] [INFO] console - le._extensions..js (module.js:467:10)

[2012-12-10 11:11:17.107] [ERROR] /node_modules/pomelo/lib/master/starter.js - FAILED TO RUN, return code: 1

原来没出现过这个问题, 今天在另一台机子重新下载DEMO就这样了, 根据另一个帖子里说重新安装aoi也未能排除~

请教关于聊天室DEMO的问题

当用户登陆时,用户名是保存到后端chat类型的服务器进程的chanel中的.
而在刷新用户名时,客户端请求的路由是chat.chatHandler.getUsers ,这是前端服务器上处理的方法,这个方法中的代码如下
var remote = chatRemote(this.app);
var users = remote.get(msg.rid, false);
没有使用rpc调用后端服务器方法,而是直接函数调用.

我的问题是,前后端是不同进程,前端如何能直接获取到后端的chanel中的用户名

求帮助~谢谢

lordofpomelo打开调试后进不了游戏

我在server.json中某一服务器加上调试功能
{"id": "connector-server-1", "host": "127.0.0.1", "port": 3150, "wsPort":3010, "args":"--debug=8567 --trace --prof --gc"},

发现登陆游戏时web-server的控制台显示 **** login!
但是客户端无反应。
把调试参数删掉后重启服务器再登陆一切正常~求解释~~谢谢

监控工具的问题

安装了lordofpomelo的Demo并且成功运行,但是监控工具中似乎只能看sceneinfo的信息。查看其它好几个模块都会导致Game-Server报错,如下:

[2012-11-27 11:13:21.285] [ERROR] /node_modules/pomelo/node_modules/pomelo-admin/lib/consoleService.js - unknown module: "scripts".

[2012-11-27 11:13:31.083] [ERROR] /node_modules/pomelo/node_modules/pomelo-admin/lib/consoleService.js - unknown module: "systemInfo".

检查了,发现这几个文件存在于/node_modules/pomelo/node_modules/pomelo-admin/lib/modules 中

运行sudo npm install pomelo -g出现以下错误

[ws v0.4.23] Attempting to compile blazing fast native extensions.
[ws v0.4.23] Attempting to compile blazing fast native extensions.
[ws v0.4.23] Attempting to compile blazing fast native extensions.
[ws v0.4.23] Native code compile failed (but the module will still work):
[ws v0.4.23] The native extensions are faster, but not required.
[ws v0.4.23] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.23] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.23] Start npm with --ws:verbose to show compilation output (if any).
[ws v0.4.23] Native code compile failed (but the module will still work):
[ws v0.4.23] The native extensions are faster, but not required.
[ws v0.4.23] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.23] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.23] Start npm with --ws:verbose to show compilation output (if any).
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (fs.js:297:15)
gyp ERR! System Darwin 11.4.2
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/pomelo/node_modules/pomelo-admin/node_modules/v8-profiler
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
[ws v0.4.23] Native code compile failed (but the module will still work):
[ws v0.4.23] The native extensions are faster, but not required.
[ws v0.4.23] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.23] On Unix, native extensions require Python, make and a C++ compiler.
[ws v0.4.23] Start npm with --ws:verbose to show compilation output (if any).
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/pomelo/node_modules'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/pomelo/node_modules']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/pomelo/node_modules' }
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the v8-profiler package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls v8-profiler
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "pomelo" "-g"
npm ERR! cwd /Users/xiaohei107/Documents/GameDevelop
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/xiaohei107/Documents/GameDevelop/npm-debug.log
npm ERR! not ok code 0

。。。。有点迷茫。。求指导。。。我的系统是macos,已经安装xcode

咨询一下网易Pomelo团队问题

公司让我调研 Pomelo 这个项目,是否可以使用这个项目是否能用于生产。我看了一个多星期,尝试了 demo,总体来说,这个项目还是很好的。但还有一些忧虑:
1、这个项目是网易开源出来的,但网易对这个项目的支持如何?是公司有全职员工支持,还是个人爱好?
2、如果有团队,团队构成如何,貌似没有相关资料介绍过这个。
3、目前还没有 iOS、Android 原生接口,这些需要多久能出来?
4、项目的支持除了来这里提问,是否还有其他渠道?
5、目前有没有成熟的线上产品基于 Pomelo 做的?

另外,还有一点担心就是:国内 JS 都是前端技术人员在使用,后端程序员懂 JS 的人很少。而前段程序员在写后端程序的话,很多意识、思路,经验都还需要积累。不知道网易在做这个项目的时候,有没有这方面的考虑。

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.