SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
レジェンドワールド
サーバーサイド技術解説スライド
2016年8月21日
カルチョス・シグマ
※レジェンドワールドは株式会社スクウェア・エニックスの登録商標です。
目次
・マスターデータとユーザーデータ
・クエリーと応援依頼の仕組みについて
・APIと例外処理について
・参考文献
マスターデータと
ユーザーデータ
マスターデータとユーザーデータ
回復薬、召喚メダル、召喚補
助券、バトルアイテム、納品
素材、オーブ素材etc...
ユーザーの所持オーブ・アイ
テム、オーブ召喚履歴、レジ
ェンドボスの履歴、シークレ
ットエリアの履歴etc...
マスターデータ・・・ゲームのシステムデータ
ユーザーデータ・・・ユーザーのゲームデータ
マスターデータ ユーザーデータ
マスターデータの具体例
LEGENDWORLD
MasterDataBase
0 = 銅の宝箱
1 = 銀の宝箱
2 = 金の宝箱
15% = 1500 / 100
確率計算はプログラム上で行うものとす
る。
0 = ノーマル
1 = 激レア
1 = 回復薬
2 = 召喚メダル
3 = 召喚補助券
4 = バトルアイテム
5 = 納品素材
6 = オーブ素材
7 = その他
ユーザーデータの具体例
LEGENDWORLD
UserDataBase
初めにテーブルが
作られた日付
最後にアイテムを
取得した日付
シークレットエリアがオー
プンしているかチェック
Model
データ表示の流れ
Controller View
データベース
プログラム
ゲーム画面
クエリーと
応援依頼の仕組みについて
応援依頼の特徴
LW_app01 LW_db1
レジェンドボス討伐のために自分以外のユーザーに応援依頼を出す機能のこと。
応援依頼を出せるユーザーは戦友・チームメンバー・おまかせ(旧仕様では近くの冒険者)の3通り
【メリット】チェイン効果が付けばボスを倒しやすくなる・連帯感強化・チームコミュニティ活性化
【デメリット】LVや時間帯に左右される・間違ってボスを撃破したときの罪悪感…(´;ω;`)
※アプリサーバ2台、データベースサーバ2台構成と仮定して考察します!
LW_app02
LW_db2
近くの冒険者へ応援依頼(旧仕様)
LW_app_02 LW_db2
LW_app_01 LW_db1
LV 142
カルチョ
ス
LV 137
Aさん
LV 147
Bさん
LV 137
Dさん
LV 143
Eさん
1. 自分のレベル付近のユーザーデータ(ユニークID,名前,LV)を抽出
・最小レベル = 自分のレベル - 15
・最大レベル = 自分のレベル + 5
(パーティー編成「近くの冒険者」参照)
2. 応援依頼ロジック処理により、依頼通知(マイページもしくは
クエスト画面)
自分のレベルに依存して応援依頼が届くため、依頼に応えてくれるユーザーが限定される
(レベルが高いと応援依頼が届かないことも…)
LV 140
Cさん LV 150
Fさん
LV 136
Gさん
おまかせ応援依頼(現仕様)
LW_app_01 LW_db1
カルチョ
ス
23:00:02
ログイン
Aさん
22:52:22
ログイン
Bさん
23:00:03
ログイン
LW_app_02 LW_db2
Dさん
23:12:03
ログイン
Cさん
23:05:45
ログイン
Eさん
22:56:39
ログイン
Fさん
22:58:02
ログアウ
ト
Gさん
23:00:02
ログアウト
1. 自分が応援要請を出した時刻付近のユーザーデータ(ユニークID,名前,
最終ログイン時間)を抽出
2. 応援依頼ロジック処理により、依頼通知(マイページもしくは
クエスト画面)
ログイン時間に依存して応援依頼が届く仕組み。時間帯によって届く人数が限定される。
自分のレベルに依存する近くの冒険者よりは応援要請が届きやすい。
クエリーについて
データベースからデータを抽出したり操作したりといった処理を行うための命令のこと(IT用語辞典バイナリ)
SQL(Stractured Query Language)という言語を用いて記述する。
ブラウザゲームでユーザーのデータを取得したり、アイテムのデータを挿入したりするときに用いられる。
今回はMySQLというデータベース管理システムのSQL記法で説明します。
★データの抽出
書式: SELECT カラム名 from テーブル名 WHERE 条件式
※全てのカラムを抽出したい場合はカラム名を*(アスタリスク)にする
具体例) id = xxxxのユーザーテーブル(user)からunique_id、name、LVのカラムを取得する
mysql> SELECT unique_id,name,LV from user WHERE id = xxxx;
mysql>
unique_id name LV
13553 カルチョス 144
APIと例外処理について
APIって何なんだ!?
Application Programming Interfaceの略称
あるコンピュータプログラム(ソフトウェア)の機能や管理するデータなどを
外部の他のプログラムから呼び出して利用するための手順や形式などを
定めた規約のこと(IT用語辞典 e-Wordsより)
Application:アプリケーション。スクエニレジェンドワールド(以下LW)
やメンバーズアバターのことを指す。
Programming:LWはAS3,Java,Haxe,JavaScript。メンバーズはPHPが使われている。
Interface:アプリケーション同士をプログラムを用いてやり取りするときの窓口のこと。
LW_App_Server
メンバーズアバター
クリスタ
APIの具体例
LWの装備画面でメンバーズの衣装に切り替えるボタンを押したときの動作
1. LW内のプログラムからアバターキャプチャ画像を取得
2. 取得したアバターキャプチャ画像を指定されたディレクトリ内に格納
cache.member.legen
dworld.jp
IP:61.110.217.xxx~
61.110.217.yyy
(xxx,yyyは要確認)
avater.member.jp.sq
uare-enix.com
IP:111.64.92.xxx
~ 111.64.92.yyy
(xxx,yyyは要確認)
cf. Mobage Restful API https://docs.mobage.com/display/JPPC/How+to+Use+the+RESTful+API
簡単なAPIを作ってみよう!
内容:ボタンを押すと「近くの冒険者」(自分のLv - 30以上かつ自分のLv + 5)のユーザーの名前・レベル・最
高戦闘力・メインジョブ・キラー効果付き装備(あり・なし)をJSON形式で表示する。
実装内容:データが正しく返ってきた場合、*JSON形式でデータを表示。
*JSON・・・JavaScript Object Notationの略。JavaScriptの中でデータを表現する形式のこと。
実装言語:HTML・JavaScript(Ajax)・PHP
●入力処理
1. ajaxをGoogleHostedLibrariesから読
み込む
2. ajaxの処理を書く
3. buttonタグを作成
●出力処理
1. headerを定義する
2. レベルを定義する
3. ユーザーリストを作成する
4. 近くの冒険者を出力する
簡単なAPIを作ってみた結果(1)
簡単なAPIを作ってみた結果(2)
詳細はhttps://github.com/calchos/php_projectを参照してください。
例外処理について
プログラムの実行の継続を妨げる異常な事象(「例外」と呼ばれる)が発生した際に、
その内容に応じて実行される処理のこと。(IT用語辞典 e-Wordsより)
・ActionScript3ではtry~catch...finallyと呼ばれる処理で実装される。
{ } { } { }
エラーが発生
する可能性が
ある処理を記述
try
エラーが発生
した際に行う
処理を記述
finallycatch
エラーが発生する可能性を試し
てみて(try)、発生したらそのエ
ラーを捕まえに行く(catch)
イメージ。最後に(finally)実行し
たい処理が必要なときは記述す
る。
最後に実行
したい処理を記述
例外処理の具体例および実装例
LW内での例) 戦友に挨拶したが、サーバーからレスポンス(応答)が返ってこない場合
クエスト探索終了後に起きるランタイムエラーなど
・実装例) 例外をキャッチして画面上に「ミ☆errorミ☆」と出力する。
・XMLのタグの数が1つではないとき
例外を投げる処理を記述しています。
詳細は
http://wonderfl.net/c/YhXX
を参照して下さい。
参考文献
・WebAPIについての説明(Qiita)
http://qiita.com/busyoumono99/items/9b5ffd35dd521bafce47
・JavaScript(jQuery)からPHPのAPIを利用する(Qiita)
http://qiita.com/mpyw/items/62e6e415f86eb30a5ff4
・アプリケーションの同期エラーの処理(Adobe.com)
http://help.adobe.com/ja_JP/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf3
51e63e3d118a9b90204-7ed1.html
・移ろいやすいユーザーの心をつかむためのエラー処理(@IT)
http://www.atmarkit.co.jp/ait/articles/0807/10/news146.html

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

レジェンドワールドサーバーサイド技術解説スライド