logo资料库

Photon Server文档翻译.doc

第1页 / 共104页
第2页 / 共104页
第3页 / 共104页
第4页 / 共104页
第5页 / 共104页
第6页 / 共104页
第7页 / 共104页
第8页 / 共104页
资料共104页,剩余部分请下载后查看
Glossary ACK A command (used internally) to make UDP reliable. Actor Players in a room are also called "Actor". An actor has an ActorNumber, valid in the room. Application Applications contain the game logic, written in C# and run by the Photon Core. They extend the abstract class Application for this. Binaries Folder The binaries folders contain platform specific builds of the Photon Core. They are prefixed with "bin_" and in the "deploy" folder of the Server SDK. Build script A batch file or MsBuild project to compile and copy applications for their deployment. Takes care of getting a clean build for deployment. Business Logic A game's logic, which runs on top of Photon Core. This "layer" handles operations and events. Channel Channels allow you to separate information into multiple sequences of operations and events. In a single channel, all operations and events are in order, each channel is being sequenced independently. This means, that Events of one channel will not be stalled because events of another channel are not available. By default Photon has two channels and channel zero is the default to send operations. The operations join and leave are always sent in channel zero (for simplicity). There is a "background" channel 255 used internally for connect and disconnect messages. This is ignored for the channel count. Channels are prioritized: the lowest channel number is put first. Data in a higher channel might be sent later when a UDP package is already full. Command Commands are used on the eNet protocol layer to transport your data or establish / shutdown connections. You won't write these, but we will explain them for your background knowledge. Connect Before clients can call operations on Photon, they need to connect and establish a connection. Custom Operation Any operation that is not in the client API or new to the server side (not in the Lite Application). Dashboard The dashboard aggregates counter data and generates graphs for monitoring purposes. Photon applications can be managed from their respective dashboard.
Deploy Folder In the Server SDK, this folder contains everything that is needed to run Photon. Namely: the binaries-folders and compiled Applications. Device In general: a mobile. Or any other system to runs your client application. Disconnect Ends a connection between client and server. Happens when a player wants to exit the client-app or there is a timeout. Also, the server logic could disconnect players. Event Events are asynchronous messages sent to clients. They can be triggered by operations (as side effect) or raised (as main purpose of an operation) and are identified by an event code. The origin is identified as ActorNumber. EvCode Short for EventCode. Identifies the type of Events and which information the event carries. Game Depending on context this means an entire application or a round / match between a few players. The Lite Application implements the latter by rooms where you play your game as group. Latency Time between request and ACK. Might differ on client and server. Lite Means the Lite Application, which is a basic business logic to get you started. Lobby Means either the Lite Lobby Application or a "lobby room" in it. Lobby Room A lobby room is a special room in the Lite Lobby Application. These rooms do not send join and leave events as the other players are not of interest. Instead, all players get lists of existing games so the player can choose. Log Files Photon is designed to run as service and does not have extensive GUI. There are two sets of log files used instead: Applications write into deploy/log. Photon Core writes into deploy/bin_*/log. Matchmaking The process of finding a game / match. The Lite Application does not have matchmaking, aside from being able to join any room by name. Lite Lobby adds listing of rooms. NNet The "old" name of our eNet RUDP protocol implementation. This was a mixture of "eNet" and "Neutron". Operation Another word for RPC functions on the Photon server side. Clients use operations to do anything on the server and even to send events to others. OpCode Short for operation code. A byte-value that's used to trigger operations on the server side. Clients get operation responses with opCodes to identify the type of action for the returned values.
Peer In short: Any client (independent of its platform) that is connected to Photon. To be exact, the Photon server is also a peer for the client-side but in all cases the only one. Photon Core The C++ core of Photon. It handles connections and the eNet protocol for you. PhotonControl This is Photon's Administration tool. Start the PhotonControl.exe to get a tray-bar menu and easily manage Photon's services. PhotonServer.config This is the configuration file for the Photon Core. It configures IPs, applications and performance settings. Formerly it was called PhotonSocketServer.xml and for a short time PhotonSocketServer.config. Policy File The Policy Application runs on Photon to send the crossdomain.xml. Webplayer platforms like Unity Webplayer, Flash and Silverlight request authorization before they contact a server. Reliable Reliable commands will reach the other side or lead to a timeout disconnect. They are sequenced per channel and dispatching will stall when a reliable command is temporarily missing. ReturnCode Primary result of every operation in form of a byte-value. Can be checked if an operation was done successfully (RC_OK == 0) or which error happened. Room A construct to group players or peers. This can be a game or simply a chat lobby or anything you make it. RUDP Reliable UDP. A protocol on top of UDP which makes sent commands reliable on demand. Socket Server Another name for the Photon Core. Timeout With eNet, client and server monitor if the other side is acknowledging reliable commands. If these ACKs are missing for a longer time, the connection is considered lost. Unreliable Unreliable commands are not ACKd by the other side. They are sequenced per channel but when dispatching, the sequence can have holes. Introduction 介绍 Welcome to the Photon Server documentation. If you are looking for the Photon Cloud documentation, please go over here . —— Photon 云文档 The documentation is split into three topics: Getting Started, Tutorials, References. Just
head over there using the links below and take a look. You will always have quick access to the topics via the navigation menu on the right. 分为三部分:开始,教程,参考文献 If you are completely new to the world of Photon scroll down to the comparison chart below. It will help you to understand the differences and what Photon product better suits your needs. 下表是 Photon 产品比较,便于你选择更适合的产品 Photon Server vs. Photon Cloud Photon 服务器与 Photon 云 Photon Server is a On Premise (OnPrem) server application that you can run and host on machines of your choice. Fully customizable and the authoritative control gives you the freedom to configure and set up your own infrastructure for multiplayer enabled applications. Photon 服务器 是一个服务器应用程序,可以在你选择的机器上运行,并且完全是自 定义和权威性的控制,你可以自由的配置和部署多人应用的基础设施。 Photon Cloud is a Software as a Service (SaaS) and as such a fully managed service. You can completely concentrate on your application client while hosting, server operations and scaling is all taken care of in the Photon Cloud. Photon 云 是一个软件即服务并且是完全的托管服务,你可完全关注于你的应用客户 端,而处理服务器操作和应用扩展是由 Photon 云负责。 Photon Cloud 云 Photon Server 服务器 Server Administration. Zero server hassle anymore. Sit back and relax while our experts take care of running the servers. 服务器管理:由云负责,零麻烦。 You gain full authority of running Photon for your applications. You run your own servers or rent fitting ones and make sure they are available for your users. Photon's logs and performance counters provide all necessary information about low level performance and stability. 你可以在你的服务器上运行你的应用,以确保对于你的用户是可用的,Photon 的日志和性 能监视器提供了最低水平的性能与稳定性的信息。 Scalability. The Photon Cloud scales automatically to accommodate all your users. Using our SDKs your client application is built for an efficient load balancing workflow. 可扩展性:Photon 云自动适应你所有的用户,使用我们的 sdk 客户端应用程序是建立了一个有效负载平衡的工 作流。 Our load balancing power-up is available in source code. It is a solid foundation to scale across multiple servers. Running the right number of servers for your customers is your responsibility. 在源代码中我们的负载均衡是可用的,它是固有的功能可跨越多个服务器,为你的用户提供 正确数量的服务器。 Licensing. Choose between various subscription models from indie development to enterprise solutions check out our different pricing models now . Why don't you just give it a try? Photon Cloud comes with a free Plan for up to 20 CCU per app . 许可:免费版有20个 CCU are bought through the shop and provided as download. Cheaper licenses limit the number of Licenses
concurrent users per server. Optionally, an Enterprise License is available for any number of servers upon request. 许可证是通过购买的,并提供下载,便宜的许可证是现在用户数量的,而企业许可证是可提 供任意数量的许可。 Game logic. All custom logic takes place on the application client to allow a zero-hassle experience. 游戏逻辑:让所有在客户端应用上的通用逻辑有一个零麻烦的体验 The server's logic can be fully customized in C#. Several pre-defined applications are available as source and provide a high performance framework for your application. Benefit from our protocols and abstraction of low level functionality and add any feature you might be missing. 服务端的逻辑完全是可定制的 C#代码,有几个内置应用可用于扩展,并且为你的应用提供 了一个高性能的框架,得益于我们的协议和抽象的底层功能,并且可以添加任意的功能。 Start instantly. Photon Cloud lets you register and immediately run your application. No setup needed. No server needed. 立即开始:Photon Cloud 使你可以注册并运行你的应用,并且不 需要配置和服务器设备。 Once downloaded, start in less than 5 minutes . Photon is easy to setup and runs locally as well as remote. 下载后,不到5分钟就可以开始了,Photon 是简单部署就可以运行了。 Feature Overview 功能概述 Photon is a real-time socket server and development framework that is fast, simple to use and flexible. Client SDKs are available for all major platforms: Photon 是一个快速、简单、灵活、实时的 Socket 服务器和开发框架,客户端 SDK 可 用于以下平台: The Photon high level architecture looks like this: Photon 的高级架构体系: Basic Architecture 基本架构 The Photon Core is written in native C++ for performance reasons It uses IO Completions Ports (IOCP) for high performance socket handling Implements the heavy “lifting” of the protocols (e.g. reliable UDP) Support relaible UDP, TCP and Web Sockets Photon Core 是用 C++编写的,这是出于性能考虑 它使用的是完成端口 IOCP,用于高性能套接字的处理 使用了更好的协议 支持可靠的 UDP,TCP 和 Web Sockets The Core hosts a .NET CLR which runs the business logic in C# Contains the applications running on Photon Written in C# (or any other .NET language)
Photon Core 托管着运行业务逻辑的.NET CLR 包括运行在 Photon 上所有的应用程序 用 C#编码 Server Applications (C#) 服务器应用程序 We provide several applications as starting point provided in source C# code Lite: Simple and powerful room based game logic LiteLobby: Lobby functionality and room logic Policy: Policy server for Unity3d, Flash and Silverlight LoadBalancing: Load balanced lite scaling across servers (this is powering our Photon Cloud) 我们提供了多种应用作为开始点 Lite:简单又强大的房间游戏逻辑基础 LiteLobby:大厅功能和房间逻辑 Policy:为 U3D,Flash,Silverlight 提供的策略服务 LoadBalancing:负载均衡的 Lite 扩展服务器 The apps are tuned for performance and can be used out of the box or extended 这些应用是性能调优和可扩展的 Convenient xcopy deploy (automatic or manual restart) 方便部署(自动或手动重启) Protocols 协议层 Photon Core supports the follwoing protocols reliable UDP (based on eNET) and specially tuned for Client-2-Server architectures Binary TCP Web Sockets Photon Core 支持以下协议 可靠的 UDP(基于 eNet),专门针对 Client-2-Server 架构 二进制 TCP Web Sockets Transfer protocol is very lean and slim 传输协议很精简 Photon wraps up the networking layer of each client platform Photon 包含了网络层的每个客户端平台 Communicate cross-platform and cross-protocol 通信是跨平台和跨协议的 Put your data in hashtables and send it: forget about de-/serialization 你的数据是放在 hashtables 中进行发送的,无需序列化和反序列化 Server Dev Framework (C#) 服务器 Dev 框架 All apps sit on top of a development framework that solves common tasks for you 置于所有应用程序之下的一个开发框架,为你解决通用的任务 Simple and flexible mapping of RPC calls to operation instances 简单和灵活的映射调用 RPC 去操作实例 Messages passing through fibers solve many threading problems 信息传递是通过线程池来解决多线程的一些问题 Designed to saturate bandwidth before the CPU becomes the bottleneck 在 CPU 成为瓶颈之前设计成饱和带宽
Server Development Tools 服务器开发工具 Fully running in Visual Studio » F5 » Debug right from your code! 完全运行在 VS 上,F5可以进行调试 Use all the first class tools from .NET Development Microsoft: Visual Studio Redgate: Memory Profiler, Performance Profiler, Reflector (see here ) Jetbrains: ReSharper, dotTrace, dotCover, dotPeek (see here ) 可使用的工具 Microsoft:VS Redgate:内存分析、性能分析 Jetbrains:ReSharper, dotTrace, dotCover, dotPeek Data Persistence (DBs) 数据持久层 Photon does not provide an persistence layer Photon 不提供数据持久层 .NET/Windows supports all major products SQL: MySQL, Postgres, MS SQL Server, SQLLite, … NoSQL: MongoDB , Redis , MemCached , … .NET/Windows 提供 SQL 和 NoSQL Usage of ORM (mapping) layers optional 可使用 ORM(对象关系映射) Vast Support of Client Platforms 支持的客户端平台 All client platforms interoprate (iOS vs Android vs PC) 支持所有的客户端平台 Major client platforms supported 主要的客户端平台 Unity3d: Inlcuding Web/Standalone (Win, MAC, Linux), iOS, Android (see here ) MAC: iOS (iPad, iPhone), Mac OSX Marmalade: iOS, Android, Bada, LG, BlackBerry (see here ) Flash & Air: Browser, Standalone, iOS, Android Windows 8, Windows 7, Vista, XP, Windows Server: Native & .NET Windows Phone 7+ HTML5: Javascript Android: Java and native (NDK) .NET Mono(跨平台的.Net 运行环境) Hosting 托管 Host Photon with any major provider PaaS: Platform as a Service IaaS: Infrastructure as a Service 主要提供者 平台即服务 基础设施即服务 Selected providers 可选供应商
微软 Azure、Leaseweb、SoftLayer、Rackspace、Amazon EC2 Support 支持 Responsive support by Exit Games staff Customers get email support Forum support: http://forum.exitgames.com/ Requirements 需求 For developing and setting up your own server the following additional software is needed: 为了开发和配置你的服务器,以下软件是必需: Operating System to Run Photon Server 运行 Photon 服务器操作系统 Windows XP, Windows Vista, Windows 7 or Windows 8 recommended development OS(开发环境系统): Windows 7 x64 recommended production OS(生产环境系统): Windows Server 2008R2 x64 .NET Framework & Visual Studio (VS) 开发环境 Microsoft .NET SDK 3.5 SP1 or .NET SDK 4.0 Microsoft VS 2008 or VS 2010 recommended: .NET SDK 4.0 & VS 2010 Photon Uses the Following Ports for Communication 通信端口 UDP: 5055, 5056 TCP: 4520, 4530, 4531 TCP: 843 for Unity3D Webplayer and Flash Crossdomain requests TCP: 943 for Silverlight Crossdomain requests Starting Photon in 5 Minutes 五分钟内开始 Photon is extremely easy to install and start. The SDK includes ready-to-use binaries which can be up and running within 5 minutes. Photon 是非常容易安装和启动的,SDK 中包含了可用的二进制文件,5分钟内即可启 动运行 Download 下载 The Photon Server SDKs are available on our website: www.exitgames.com/Download/Photon Choose Fitting Binaries 选择装配的二进制文件 Unzip the files anywhere on your machine. Locate the “deploy” folder and choose the fitting binaries for your system: 解压在你机器的任何位置,找到 deploy 文件夹,选择适合你的二进制文件 bin_Win32: 32 bit Windows Vista and up bin_Win32_xp: 32 bit Windows XP or 2003 bin_Win64: 64 bit Windows Vista and up bin_Win64_xp: 64 bit Windows XP or 2003
分享到:
收藏