分散式資訊系統

Download Report

Transcript 分散式資訊系統

Distributed Information Systems
Outline







Motivations and Goals
Project Description & Diagram
Project justification
Alternative consideration
Project timeline
System requirement
Implementation and Testing
Motivation and Goals

Motivation




網路遊戲有其發展潛力與市場
人機互動 vs. 人與人互動
Server crash problem
Goals




提供多人連線遊戲伺服器的基礎架構
實作簡易的大富翁遊戲
容易操作的使用者介面
當server當機或斷線時,其他server會自動回復正在線上的
遊戲
Project Description


提供多人連線遊戲的架構
此架構提供

Reliability & Stability



Fault Tolerance & Recovery


允許server crash,其他server會負責回復玩家遊戲
Flexibility & Scalability


同一個遊戲中的玩家看到的game view相同
當遊戲回復時,會回到此遊戲最近的game view
可以再繼續開發其他遊戲而不需變動目前架構
在此架構下實作線上大富翁遊戲
Project Description (cont’d)

遊戲方式





玩家必須先註冊帳號
取得帳號後便可連上任一伺服器與其他玩家對戰
玩家可以選擇開新遊戲或是加入其他玩家遊戲開的
遊戲,當遊戲人數達四人便可開始
遊戲規則大致與一般大富翁遊戲之規則相同,我們
會稍加修改遊戲方式
每局遊戲結束後,會評量各玩家的勝敗成績並給予
戰績排名
Project Diagram
………
Server 1
Client
Server 2
Server N
Client
Client
Client
Client
Client
Client
Client
Client
Client
Create
Query
Join
Close
Game_Agent
isAlive
Server
ResetServer
{
Cerate
Join
Game_Rccovery
}
Client
)
(2
ery ) 4)
)
Qu (3me (
(6
a
nG
me
Joi
Ga
e
os
Cl
Cr Le
ea av
te e
Ga (5
m )
e(
1
)
Update Game and User List
Server
Client
isAlive
update
Election
Server
Client Flow
Chart
Start
Disconnected Stage
Auto
Connect
Lobby Stage
Query
Create
Game
Game Stage
Communication
among Clients
Game Stage
Continue
Game
Join
Game
Close
Operation
Sever
Fails
Reconnection
Create or Join
Recovery Info
Server
List
Database
Server Flow
Chart
Start
Disconnected Stage
GetAllServerData
Start Server
Service
Update Server
Serve Requests
Server List
Information
Server-to-Server
Server-to-Client
Game Session
and Clients
Information
Server Daemon
Open
Game
isAlive
Close
Game
Join
Game
Query
Update
Recovery
GetAll
Data
Failure
Detection
Session
Multicast
Session
Multicast
Session
Multicast
Session
Multicast
Reopen
Game
Close
Operation
Project Justification

Multi-Server的架構


可達到Fault Tolerance
Server Daemon要負責檢查其它Server
是否正運作,若Crash,則要負責接收
其所服務的Game Sessions & Clients

利用交換Server裡的Client資訊, 而且定時
檢查是否有其它的Server當掉
Advanced consideration

當每個server新開遊戲或有新的玩家加入時,此server便觸發
update事件,通知其他server要update (Game & User List)

Fault tolerance

Server crash:其他server會馬上接手此server所負責的
game,並且具有Load Balancing機制

Client Recovery:玩家的遊戲中,每個事件都會加入
timestamp,在Recover時,會回復所有玩家的狀態

系統中,遊戲資訊完全由Client端掌控,開發新遊戲時對Server
而言只需提供該遊戲對應的Game Agent即可
Project timeline
Nov 2001
ID
Task Name
Start
Finish
Dec 2001
Duration
28/10 4/11 11/11 18/11 25/11 2/12 9/12 16/12 23/12 30/12
1
Java Study & preliminary SA
2001/10/29
2001/11/9
2w
2
Complete SA and group communication
2001/11/12
2001/11/23
2w
3
Server implementation
2001/11/19
2001/12/28
6w
4
Client implementation
2001/11/26
2001/12/28
5w
5
System testing
2001/12/31
2002/1/4
1w
System Requirement




Platform : JVM (Java Virtual Machine)
Middleware : Java RMI
Development : Java Language
Database : MySQL
Implementation and Testing


Java RMI
Multithread programming



每當開一個新game都會開一個新的GameThread
來處理這個game,而且對每個玩家也都各別有一
個Thread來負責messages的傳遞
server和server之間的通訊亦有其Thread負責
Testing – windows platform


Server Crash Testing
Client (Game Creator) Crash Testing