Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this


  1. 1. Web Game Design 授課教師 江素貞
  2. 2. <ul><li>Server Introduction </li></ul>
  3. 3. ElectroServer 4 <ul><li>ElectroServer is free and unrestricted for up to 25 connected users (at the same time). You can download and install it at www.electro-server.com/downloads.aspx. </li></ul>
  4. 4. ElectroServer 4 概述 <ul><li>ElectroServer works by allowing client applications, such as Flash, Java, or Silverlight, to connect via socket to it and log in. </li></ul><ul><li>The server is highly extensible using what are called extensions. An extension is a collection of 1 or more ActionScript or Java files/classes that are used to add more functionality to the server. </li></ul>
  5. 5. ElectroServer 4 Features <ul><li>Unlike any other socket-server platform, ES4 moves beyond simple multiplayer game development, combining the support of streaming Audio/Video to enable A/V conferencing, recording, and streaming live events to thousands of users. </li></ul>
  6. 6. ElectroServer 4 Features <ul><li>Unprecedented Scalability </li></ul><ul><li>ElectroServer 4 has the ability to support hundreds of thousands of gamers - load testing has proven that the system can reliably manage 200,000 concurrent players. This level of scalability is achieved by distributing the load across multiple machines, allowing players to connect to one of many gateway servers. ES4 intelligently shuffles users between gateways to minimize the message traffic. Each player can see and interact with other players connected to any gateway! </li></ul>
  7. 7. ElectroServer 4 Features <ul><li>Extensions Give Developers More Control </li></ul><ul><li>Using multiple hooks - Extensions - ElectroServer 4 lets game developers extend a server's functionality. Comprised of a collection of Java or ActionScript files, these server extensions put control in the hands of the developer. Three types of server extensions are available to increase server capabilities with Java or server-side ActionScript: plugins, managed object factories, and event handlers. </li></ul>
  8. 8. ElectroServer 4 Features <ul><li>Dual Server Modes Suit Future Growth </li></ul><ul><li>ElectroServer 4 operates in either standalone or distributed mode. ElectroServer 4 Professional runs in standalone mode only, which can be employed for one installation and one start-up process to ensure blazing fast throughput. ElectroServer 4 Enterprise supports distributed mode, which allows for installation across many machines. Through multiple gateway server installations, ES4 manages player connections seamlessly. This version also supports standalone mode option for maximum application flexibility. </li></ul>
  9. 9. ElectroServer 4 Features <ul><li>Streaming Audio & Video </li></ul><ul><li>ElectroServer 4 is a premier Flash Media Server alternative that gives developers the tools to build and execute scalable, massive multiplayer online games, communities, and social networking sites. ES4 helps developers progress from hosting traditional streaming live-events hosting to efficiently incorporating the use of Webcams and microphones into the application. Leveraging the streaming A/V tool set, developers can transform live-event streaming such as TV shows or concerts to a real-time online experience for thousands of players. ES4's A/V recording capabilities can also capture an event in real-time and store it for future playback. </li></ul>
  10. 10. ElectroServer 4 Features <ul><li>A Cost-effective Solution for all Development Levels </li></ul><ul><li> ElectroServer 4 helps game developers avoid common roadblocks found when creating games on other servers. This accelerates development time and minimizes man hours - giving companies true ROI. ElectroServer's flexible tiered licensing adapts an anticipated number of concurrent users on one or multiple machines, making it a great value proposition for applications on all scales and development levels. </li></ul>
  11. 11. ES4 Licensing Architecture
  12. 12. Server Concepts <ul><li>We look at ElectroServer concepts and some terminology. </li></ul><ul><ul><li>Users </li></ul></ul><ul><ul><li>Rooms </li></ul></ul><ul><ul><li>Zones </li></ul></ul><ul><ul><li>Chat </li></ul></ul><ul><ul><li>Buddies </li></ul></ul><ul><ul><li>EsObjects </li></ul></ul><ul><ul><li>Extensions </li></ul></ul>
  13. 13. Users <ul><li>A user is a representation of a client connected to the server (and logged in). </li></ul><ul><li>It is possible for a single client to establish more than one connection to the server and still be seen as a single user. </li></ul><ul><ul><li>For instance, to stream video from the server to a client using ElectroServer, a user establishes a second connection to handle the audio/video stream. </li></ul></ul>
  14. 14. Rooms <ul><li>In ElectroServer, a room is a way for one to many users to see each other and interact. </li></ul><ul><li>If a user is in room, then that user can send a chat message, which is then broadcast to all users in that room. </li></ul><ul><li>A user can be in multiple rooms at a time. </li></ul>
  15. 15. Rooms <ul><li>There are two types of rooms in ElectroServer: </li></ul><ul><li>Persistent : A room that always exists, even if there are no users in it. Persistent rooms are created using the web-based administrator. </li></ul><ul><li>Dynamic : A room that is created for a single use. A dynamic room is automatically removed when there are no more users in that room. This is the most common type of room. </li></ul>
  16. 16. Zones <ul><li>A zone is a collection of rooms. Every room must exist in a zone. A room cannot exist in more than one zone. </li></ul><ul><li>Rooms within a zone must be uniquely named. </li></ul><ul><li>During the room creation, a zone is specified. If that zone does not exist, then it is created. </li></ul><ul><li>A zone is removed when there are no more rooms in that zone. </li></ul>
  17. 17. Chat <ul><li>Chat is the primary method by which users interact with each other while connected to a socket server. </li></ul><ul><li>In ElectroServer, as in many other socket server solutions, there are public and private chat messages. </li></ul>
  18. 18. Buddies <ul><li>Social networking is an enormous part of the typical multiplayer experience. In addition to playing games and competing, users like to form relationships that transcend a single play session. They like to flag each other as buddies to add to a list. </li></ul><ul><li>A user can then message any of her buddies that are currently online and even challenge them to a game. </li></ul>
  19. 19. EsObjects <ul><li>An EsObject is a class that exists in identical form on both the server and the client. A new instance of the class is created and data is then stored on this object. </li></ul><ul><li>The Object can then be exchanged between the client and the server easily, because the transaction layer knows how to serialize and deserialize the object. </li></ul>
  20. 20. Extensions <ul><li>The server is highly extensible using what are called extensions. An extension is a collection of one or more ActionScript or Java files/classes that are used to add more functionality to the server. </li></ul><ul><li>These extensions can be used as server-level event handlers, such as the Login Event Handler, as Managed Objects which come in handy for things like database connection pooling, or as Plugins. </li></ul><ul><li>Plugins are run at the server level or at the room level and are frequently used to execute game logic. </li></ul>
  21. 21. EsObject and Plugin <ul><li>One of the most attractive benefits of an EsObject is that it allows for data to be sent across languages cleanly and easily. </li></ul><ul><li>A plugin written in ActionScript can create an EsObject and send it to a Java client and both sides will treat it consistently. There is no need to perform any messy conversions. </li></ul>
  22. 22. EsObject and Plugin <ul><li>For example: A Flash client can create an EsObject, populate it with strings, numbers and arrays of information, and then just send it to a server plugin. The plugin receives this EsObject and can access all of that information. </li></ul>
  23. 23. <ul><li>Installation </li></ul>
  24. 24. ElectroServer 4 installation <ul><li>ElectroServer is a Java application. This means that any computer that can run the Java. </li></ul><ul><li>Windows 98/ME/NT/2000/XP, Solaris, and Linux are among the supported operating systems. </li></ul>
  25. 25. ElectroServer 4 installation <ul><li>此畫面是選擇安裝的 ElectroServer 的版本 , 一般而言 Professional 的版本較適合高效能的即時遊戲;而 Enterprise 版本,較適合製作回合制的遊戲或是聊天室使用 </li></ul><ul><li>請安裝 Professional 的版本 </li></ul>
  26. 26. ElectroServer 4 installation <ul><li>設定伺服器的 IP 或是伺服器的名稱、 Port 和是否支援 SSL 模式 </li></ul>
  27. 27. ElectroServer 4 installation <ul><li>設定 ES 伺服器的管理者名稱和密碼 </li></ul><ul><li>預設的 Username 為 administrator </li></ul><ul><li>預設的 Password 為 password </li></ul>
  28. 28. ElectroServer 4 installation <ul><li>此畫面是選擇當作業系統啟動時,是否要將 ElectroServer 也啟動,可選可不選。 </li></ul>
  29. 29. Start up ElectroServer <ul><li>ElectroServer_4_0_6_Windows.exe </li></ul>
  30. 30. <ul><li>Administration </li></ul>
  31. 31. Web Based Administrator <ul><li>ElectroServer comes with a full-featured web-based administrator. </li></ul><ul><li>Almost all server configuration and maintenance is done through this tool. This includes managing extensions, creating server-level plugins, persistent rooms, configuration filters, setting up gateways,managing license files, and much more. </li></ul>
  32. 32. Web Based Administrator <ul><li>To use the web-based administrator ElectroServer must be running. </li></ul><ul><li>The admin is served up using ElectroServer’s built-in web server. The settings for the web server are the only server configuration settings that happen outside of the admin. </li></ul><ul><li>The web server settings are configured here: [installation directory] serverconfigES4Configuration.xml </li></ul>
  33. 33. Administration Panel <ul><li>You must ensure that the ElectroServer’s settings are configured to your needs. </li></ul><ul><li>Let us introduce the administration panel, which exists to allow configuration of ElectroServer’s many options. </li></ul>
  34. 34. Administration Panel <ul><li>If all server default settings are used during installation, then you can access the admin here: </li></ul><ul><li>https://localhost:8080/admin/ </li></ul><ul><li>If you left the username and password as the default during installation then they are: administrator / password. </li></ul>
  35. 35. The Web Admin Sections <ul><li>( 附件: ElectroServer 4 Manual.pdf --- 3 Administration ) </li></ul><ul><li>We’ll look here at the three that are most commonly used: </li></ul><ul><ul><li>Gateways Menu </li></ul></ul><ul><ul><li>Extensions Menu </li></ul></ul><ul><ul><li>Persistent Rooms Menu </li></ul></ul>
  36. 36. Gateways Menu <ul><li>The Gateways menu provides the configuration for adding addresses and ports to enable socket communications between ElectroServer and connecting clients. </li></ul>If you need to edit any of these addresses, click on Edit StandAlone, which will bring up the configuration for these listeners.
  37. 37. Edit Gateway <ul><li>After editing, restart the server. </li></ul>
  38. 38. Extensions Menu <ul><li>In the Extensions menu, you can install and configure any server extensions to be used with ElectroServer. </li></ul>
  39. 39. Extensions Menu <ul><li>The front screen of the Extensions menu provides a list of currently installed extensions as well as the option of installing new ones. </li></ul>
  40. 40. Setting Up the Sample Extension <ul><li>The ZIP FILE that you downloaded contains an extension that you can deploy in your ElectroServer installation without needing to be able to compile Java. </li></ul><ul><li>In the book_files/examples_extension/extension folder, find and copy the GameBook subfolder. Paste this into your ES4 installation folder/server/extensions. Reboot the ES4, and then add the server-level components. </li></ul>
  41. 41. Server-Level Components <ul><li>After deploying the extension, restart ElectroServer and open the administration panel. </li></ul><ul><li>Go to the Extensions tab. Click the plus button (+) for GameBook, and then click the New Server-Level Component button. The next screen should show the Extension name of GameBook. </li></ul><ul><li>Choose TimeStampPlugin from the Plugin Handle drop-down menu, and then type TimeStampPlugin into the Plugin Name field. </li></ul><ul><li>Repeat this process with GMSInitializer, and then restart ElectroSerer again. </li></ul>
  42. 42. Persistent Rooms Menu <ul><li>This menu provides a means of creating rooms and zones that will persist while ElectroServer is running. </li></ul><ul><li>A persistent room is a room that is not removed when the user list is empty. Most rooms are dynamic and are removed when empty. </li></ul>