Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
js
Charlie Crane
@xiecc
Who am I
NASDAQ: NTES
https://github.com/NetEase/pomelo
Pomelo position
Game Server
Fast Scalable
Network Real-time
Motivation--node.js advantages
Scalability -- event driven I/O
Game, network-insentive, massive network flow
Language, javascript
Browser, HTML5, unity3d, cocos2d-x, other platform – same
language in client and server
Solution
Optimization
Divide process
All can be solved in practice
Node.js game—Mozilla BrowserQuest
Node.js game—google gritsgame
Motivation -- our demo
http://pomelo.netease.com/lordofpomelo
Motivation--architecture of demo
Motivation -- game VS web
Long connection VS Short connection
Partition: area based VS Load balanced cluster
Stateful VS Stateless
Request/broadcast VS Request/response
Motivation--complicate servers
Game VS web
Motivation--how to solve complexity
Too … complicated?
solution: framework
Agenda
The state of pomelo
Motivation
Framework
Practice
Pomelo Framework
master
backend
frontend
backend
backend
frontend
backend
Framework--- server abstraction
Duck type
conn area
ector chat
The
Duck
servers
Framework---server abstraction
Framework --- request abstraction
Client call remote method on server
Client, like ajax
Pomelo
component Connector
Loader
Socket.io
Socket/We
bSocket
Framework --- push&broadcast
Push messages to a group of users
Thrift
Writing a .thrift file
Generate Thrift file to source code
thrift --gen <language> <Thrift filename>
Copy the source to application
… 5、Broadcast
1.5
client
Practice --- Client Move Request
pomelo.on(‘onMove’, function(data) {
play move animation
…
});
Practice – route rule
Define once:
app.route(‘area’, routeUtil.area);
Practice --- character move
Character Move, isn’t that easy?
Smooth effect
Client prediction
Latency Compensate
How to notify
AOI(area of interest)
What’s more
Performance
Plugin, components
Realtime application framework – a better one, more
scalable, adaptable
AI – pomleo-bt
Broadcast strategy – pomelo-aoi , schedule
Data sync strategy – pomelo-sync
Admin all the servers -- pomelo-admin pomelo-cli
How to build a full game – lordofpomelo play online
High availability – master and zookeeper
Thank you
@xiecc
https://github.com/NetEase/pomelo