Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Remilia - Structure of Huaban Directional Pinni...
Search
ZHU, Kaidi
February 03, 2015
Programming
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Remilia - Structure of Huaban Directional Pinning System
ZHU, Kaidi
February 03, 2015
More Decks by ZHU, Kaidi
See All by ZHU, Kaidi
给 Node.js 插上 C++ 的翅膀
xadillax
1
170
Other Decks in Programming
See All in Programming
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
250
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
すこし踏み込む CancellationToken
htkym
2
1.7k
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
mrbgem 三角測量 開発
ogom
0
240
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
130
速習iPhone Duo対応
yuukiw00w
2
980
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
330
Are APIs Still Relevant in the AI Era?
soyuka
0
460
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
気持ちぃ〜角丸 Squircle
ryu1013
0
290
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
What's in a price? How to price your products and services
michaelherold
247
13k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
First, design no harm
axbom
PRO
2
1.3k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Agile that works and the tools we love
rasmusluckow
331
22k
Ruling the World: When Life Gets Gamed
codingconduct
0
400
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
590
My Coaching Mixtape
mlcsv
0
350
Transcript
Remilia HDPS The Huaban Directional Pinning System
Subprojects The Cellar The Gate The Koumakan The API T
ester TODO…
Structure The Whole Koumakan’s Process
“All the gensokyo characters services are written in Framework Gensokyo.”
–XadillaX <The Remilia Bible> 1-1-3, Gensokyo Prologue
Gensokyo An Illyria RPC service framework written in Node.js http://gitlab.widget-inc.com/huaban/gensokyo
Installation $ npm install -g git+ssh://
[email protected]
:65422/huaban/gensokyo.git#<VERSION> Or … $ cnpm
install -g gensokyo [--registry=http://registry.npm.huaban.org]
$ gensokyo new cellar
module.exports = { echo1: [ "before1", "echo2" ], echo2: [
"before1", [ "echo1", "echo2" ], "after1" ], echo3: "echo1", echo4: { before: [ "before1" ], ctrller: "echo1" } };
function makeSequence(before, controller, after, routerName, keyName) { var sequence =
[]; sequence.add(before); sequence.add(controller); sequence.add(after); var func = function(req, resp, callback) { var funcIdx = 0; var funcCount = sequence.length; app.logger.info("Received a request \"{router}.{action}\".".assign({ router : routerName, action : keyName })); // do the sequence async.whilst( function() { return funcIdx < funcCount; }, function(next) { var func = sequence[funcIdx]; func(req, resp, function() { funcIdx++; next(); }); }, function(err) { if(err) { app.logger.err("An error occurred in `{router}` -> `{action}`: {error}".assign({ router : routerName, action : keyName, error : err.message })); return; } callback(); } ); }; return func; }
var util = require("util"); var Controller = require("gensokyo").Controller; var EchoController
= function(gensokyo) { Controller.call(this, gensokyo); }; util.inherits(EchoController, Controller); EchoController.prototype.echo1 = function(req, resp, next) { this.logger.info("echo1"); next(); }; EchoController.prototype.echo2 = function(req, resp, next) { this.logger.info("echo2"); resp.message.ok = true; // 测试⼈人品 if(Number.random(1, 100) < 50) { resp.error("You're unlucky!"); return; } next(); }; module.exports = EchoController;
“All ciphertext is from Sanae and into Cellar.” –Kochiya Sanae
<The Remilia Bible> 5-3-12, Sanae Ciphertext
The Cellar
The Cellar (Ver. 1) Fetch wet data from mongodb stored
by Sanae regularly Dry the wet data into useful data and store back to another collection
*#*# NO OFFLINE #*#*
The Cellar (Ver. 2) Wait for Illyria Requests. Get data
from Sanae’s storage. Response the data.
“Cellar is a raw data fetcher & sender. And the
Gate is to peep the raw data to fetch dry information.” –Remilia Scarlet <The Remilia Bible> 6-2-13, Gate T estament
“The Gate is a hub between the Cellar and the
Koumakan. And the peep hole is the core soul of the Gate.” –Remilia Scarlet <The Remilia Bible> 6-2-13, Gate T estament
Gate Wait for peep requests. Peep the raw data from
the Cellar. Response the peeped data back.
“One peep hole per rule. And one rule per hole.”
–Puppets <The Remilia Bible> 9-8-1, Puppet Oath
“We peep the image links, the site links.” –Puppets <The
Remilia Bible> 9-8-1, Puppet Oath
“Of cause, we peep the description of that heavenly image.
And we peep the kind of it.” –Puppets <The Remilia Bible> 9-8-1, Puppet Oath
“At last, don’t forget to peep the raw board name
for it.” –Puppets <The Remilia Bible> 9-8-1, Puppet Oath
“WE ARE ONLINE!” –Puppets <The Remilia Bible> 9-8-1, Puppet Oath
Cellar Sanae Storage Gate Peep Koumakan Puppet
Koumakan The palace puppets live. The magic controls all the
puppets. A puppet owns a Huaban account. Each puppet is independent.
“Remilia created a factory to create puppets at the first
day.” –<The Remilia Bible> 2-1-1, Factday
Puppet Manager The puppet factory var PuppetManager = function() {};
PuppetManager.prototype.addPuppets = function() {}; PuppetManager.prototype.startOne = function() {}; ……
“At the second day, she gave puppets body, blood and
soul.” –<The Remilia Bible> 2-1-2, Thouday
Puppet The pinning creature var Puppet = function() {}; Puppet.prototype.start
= function() {};
Puppets builds with Composition Account Composition Peeped Queue Composition Schedule
Composition (Pin) Hand Composition Board Composition …
Base Composition var BaseComposition = function(puppetId, parent) { EventEmitter.call(this); this.gensokyo
= gensokyo; this.logger = gensokyo.logger; this.puppetId = puppetId; this.parent = parent; }; util.inherits(BaseComposition, EventEmitter); module.exports = BaseComposition; BaseComposition.type = "BaseComposition";
Compositions var FooComposition = function(puppetId, parent) { BaseComposition.call(this, puppetId, parent);
}; util.inherts(FooComposition, BaseComposition); …
So Puppets var Puppet = function(puppetId) { EventEmitter.call(this); this.gensokyo =
gensokyo; this.logger = gensokyo.logger; this.puppetId = puppetId; // 账号组件 this.account = new Compositions.Account(puppetId, this); // 缓存数据队列 this.peepedQueue = new Compositions.PeepedQueue(puppetId, this); // 时间表 this.schedule = new Compositions.Schedule(puppetId, this); // ⼊入库之⽖爪 this.pinHand = new Compositions.PinHand(puppetId, this); // 魔貫光殺砲 ƅЧƅ)σ━00000000000━• … this.logger.info("Puppet " + puppetId + " created."); };
“Remilia endued puppets the ability to acquire an outside world,
Huaban at the third day.” –<The Remilia Bible> 2-1-3, Huaday
Account Composition var AccountComposition = function() {}; AccountComposition.prototype.fetchInformation = function()
{}; AccountComposition.prototype.createAccount = function() {}; AccountComposition.prototype.signIn = function() {}; …
“Give me name and avatar!” –Puppets <The Remilia Bible> 2-1-3,
Huaday
The Other Sides of the World http://www.qzone.cc/ http://bbs.duowan.com/ Waiting for
you, my new God of creation…
“Puppets got the ability of peeping from Gate at the
forth day due to Remilia.” –<The Remilia Bible> 2-1-4, Gatday
Peeped Queue Composition var PeepedQueueComposition = function() {}; PeepedQueueComposition.prototype.nextImage =
function() {}; PeepedQueueComposition.prototype.clean = function() {}; PeepedQueueComposition.prototype.peepCrowd = function() {}; ...
“Fifth day, Remilia gave puppets the ability to create Boards.”
–<The Remilia Bible> 2-1-5, Boarday
Board Composition var BoardComposition = function() {}; BoardComposition.prototype.getBoard = function()
{}; BoardComposition.randomStyleName = function() {}; ...
“Sixth day, puppets got the ability to pin to Huaban
from Remilia.” –<The Remilia Bible> 2-1-6, Pinsday
Pin Hand Composition var PinHandComposition = function() {}; PinHandComposition.prototype.pin =
function() {}; ...
“The last day, each puppet made its own schedule to
pin. And Remilia went to rest.” –<The Remilia Bible> 2-1-7, Scheday
Schedule Composition var ScheduleComposition = function() {}; ScheduleComposition.prototype.genSchedule = function()
{}; ScheduleComposition.prototype.nextCanAndCant = function() {}; ...
“Let me be like a human!” –Puppets <The Remilia Bible>
2-1-7, Huaday
Sleep… Rest… Pin… Rest… Pin… … Sleep…
“Boom is a Bang to implement interacting with Huaban.” –Remilia
Scarlet <The Remilia Bible> 17-3-8, Big Boom
Boom Used by others (Celler, Gate or Koumakan)
“We need a centre control magic!” –Remilia Scarlet <The Remilia
Bible> 21-7-14, Residual Page XIV
Fin The world’s ending is another world’s beginning.