SlideShare a Scribd company logo
1 of 12
網路遊戲設計 Web Game Design 授課教師 江素貞
Chapter 4  Login and Private Message ElectroServer Design Concepts
Event Handlers ElectroServer currently allow event handlers to be created for the following event types: Login Logout User Variable─User has updated the EsObject attached to the user object. Room Variable ─User has updated the EsObject attached to the room. Buddy List─User has updated his buddy list (add/edit/delete). Private/Public Messaging─User has sent a message to another entity (room/user).
The ElectroServer API ,[object Object]
There are three main types of message that can travel in either direction between the client and the server.
Requests ─ Objects created by the client and then sent to the server. (LoginRequest)
 Responses ─ Objects created by the server as a result of a request and then sent to the client. (LoginResponse)
Events ─ Messages (sent from the server to client) that did not necessarily originate from a request.,[object Object]
The ElectroServer class is the gateway to the entire API.vares:ElectroServer = new ElectroServer(); ,[object Object],es.addEventListener(…); ,[object Object],es.setProtocol(Protocol.XXX);
MessageType class This class stores static variables that act as a message definition. All messages (requests, responses, events) have a getMessageType() method. The value of it is one of the static variables in this class. ConnectionEvent LoginResponse PrivateMessageEvent ……
連線與登入流程 Main.as: new ConnServer ConnServer.as: 處理連線與登入 Connect: 讀檔取得ip及port,createConnection() Create Login UI: 連線成功後, new LoginScreen(),聆聽是否按下LoginScreen之[login]按鈕 Login: 讀取輸入之帳號名稱並登入伺服器,登入成功後,移除LoginScreen畫面 Send Message: 傳送訊息給自己測試
Chapter 4  Login and Private Message Send Private Message

More Related Content

What's hot

Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
Ahsanul Karim
 
Android Service Intro
Android Service IntroAndroid Service Intro
Android Service Intro
Jintin Lin
 
Android Service Patterns
Android Service PatternsAndroid Service Patterns
Android Service Patterns
Shree Kumar
 

What's hot (10)

Day 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts APIDay 15: Content Provider: Using Contacts API
Day 15: Content Provider: Using Contacts API
 
Building a YellowAnt application with .NET
Building a YellowAnt application with .NETBuilding a YellowAnt application with .NET
Building a YellowAnt application with .NET
 
SQL Injection attack
SQL Injection attackSQL Injection attack
SQL Injection attack
 
What is Dependency Injection in Spring Boot | Edureka
What is Dependency Injection in Spring Boot | EdurekaWhat is Dependency Injection in Spring Boot | Edureka
What is Dependency Injection in Spring Boot | Edureka
 
Android Service Intro
Android Service IntroAndroid Service Intro
Android Service Intro
 
Akka knolx
Akka knolxAkka knolx
Akka knolx
 
Android Service Patterns
Android Service PatternsAndroid Service Patterns
Android Service Patterns
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?
 
Android Context
Android ContextAndroid Context
Android Context
 
SQL injection implementation and prevention
SQL injection implementation and prevention SQL injection implementation and prevention
SQL injection implementation and prevention
 

Similar to Login and private message

Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docxCross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
mydrynan
 
Test DB user
Test DB userTest DB user
Test DB user
techweb08
 
test validation
test validationtest validation
test validation
techweb08
 
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docxCross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
mydrynan
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 

Similar to Login and private message (20)

IoT in salsa Serverless
IoT in salsa ServerlessIoT in salsa Serverless
IoT in salsa Serverless
 
Ivanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys LimitedIvanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys Limited
 
Case Study Design Pattern - Object Adapter
Case Study Design Pattern - Object AdapterCase Study Design Pattern - Object Adapter
Case Study Design Pattern - Object Adapter
 
Laravel 8 events and listeners with example
Laravel 8 events and listeners with exampleLaravel 8 events and listeners with example
Laravel 8 events and listeners with example
 
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docxCross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
 
Test DB user
Test DB userTest DB user
Test DB user
 
test validation
test validationtest validation
test validation
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024
 
Server-Sent Events in Action
Server-Sent Events in ActionServer-Sent Events in Action
Server-Sent Events in Action
 
Sending Email with Rails
Sending Email with RailsSending Email with Rails
Sending Email with Rails
 
Asp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answersAsp.net+interview+questions+and+answers
Asp.net+interview+questions+and+answers
 
Transfer data from iPhone to iWatch
Transfer data from iPhone to iWatchTransfer data from iPhone to iWatch
Transfer data from iPhone to iWatch
 
Inside Logic Apps
Inside Logic AppsInside Logic Apps
Inside Logic Apps
 
Metasploit Railguns presentation @ tcs hyderabad
Metasploit Railguns presentation @ tcs hyderabadMetasploit Railguns presentation @ tcs hyderabad
Metasploit Railguns presentation @ tcs hyderabad
 
Demystifying Reactive Programming
Demystifying Reactive ProgrammingDemystifying Reactive Programming
Demystifying Reactive Programming
 
Dependency Injection, Zend Framework and Symfony Container
Dependency Injection, Zend Framework and Symfony ContainerDependency Injection, Zend Framework and Symfony Container
Dependency Injection, Zend Framework and Symfony Container
 
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docxCross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
Cross-site scripting (XSS) Attacks Cross-site scripting (XSS) .docx
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
 

Recently uploaded

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Login and private message

  • 1. 網路遊戲設計 Web Game Design 授課教師 江素貞
  • 2. Chapter 4 Login and Private Message ElectroServer Design Concepts
  • 3. Event Handlers ElectroServer currently allow event handlers to be created for the following event types: Login Logout User Variable─User has updated the EsObject attached to the user object. Room Variable ─User has updated the EsObject attached to the room. Buddy List─User has updated his buddy list (add/edit/delete). Private/Public Messaging─User has sent a message to another entity (room/user).
  • 4.
  • 5. There are three main types of message that can travel in either direction between the client and the server.
  • 6. Requests ─ Objects created by the client and then sent to the server. (LoginRequest)
  • 7. Responses ─ Objects created by the server as a result of a request and then sent to the client. (LoginResponse)
  • 8.
  • 9.
  • 10. MessageType class This class stores static variables that act as a message definition. All messages (requests, responses, events) have a getMessageType() method. The value of it is one of the static variables in this class. ConnectionEvent LoginResponse PrivateMessageEvent ……
  • 11. 連線與登入流程 Main.as: new ConnServer ConnServer.as: 處理連線與登入 Connect: 讀檔取得ip及port,createConnection() Create Login UI: 連線成功後, new LoginScreen(),聆聽是否按下LoginScreen之[login]按鈕 Login: 讀取輸入之帳號名稱並登入伺服器,登入成功後,移除LoginScreen畫面 Send Message: 傳送訊息給自己測試
  • 12. Chapter 4 Login and Private Message Send Private Message
  • 14.
  • 15. Login To log in to ElectroServer, first a LoginRequest object is creted, a username is populated onto that object. var lr:LoginRequest = new LoginRequest(); lr.setUserName(“…”); es.send(lr); Capture the login response that send from server. es.addEventListener(MessageType.LoginResponse, “onLogin”, this);
  • 16.