Photon——What’s in Photon 3 Photon3凡啊

Changed 改变

1. Lite and Lite Lobby Code-Cleanup Lite和Lite Lobby代码清理

     Event-, Operation- and Parameter-Codes are cleaned up. Everything
was reassigned and the predefined codes should be out of your way now.
There is an extra page which lists each old and new value.



2. Type of Codes 代码的门类

     We decided to keep using bytes as type for codes. It’s just
effective and lean. If needed, any operation or event could get
sub-codes (not supported out of the box).The ReturnCode for
operation responses was of type int. This is now short-typed. Not
extremely lean. But short.



3. Protocol Cleanup 协议清理 

     We cleaned up the protocol for Photon 3. This is next to invisible
for you, but has some benefits. Most of all, the new protocol does no
longer hard-code any codes. Any code for operations, results, parameters
or events can be defined by your code.



4. Error Handling 错误处理

     The error handling was re-designed to


  • always call the unhandled exception event handler
  • it is no longer required to initialize the logging facade
  • introduced three policies for unhandled exceptions: ignore, restart
    application, end process
  • consistent behavior: before unhandled exceptions in threads
    controlled by Photon where logged and then ignored, those in other
    threads usually terminated the process. 

  • 连调用未处理的要命事件处理
  • 不再要初始化 logging facade
  • 对此未处理的可怜出以下三单政策:忽略、 重启应用程序、终止进程
  • 同样的所作所为:在线程通过Photon登录以及忽略来决定不处理的老之前,其他线程通常会告一段落之过程。

     Note: due to a bug in 2.6 sometimes exceptions where “transformed”
into ThreadAbortException or the application was unloaded without
being loaded again (this is also fixed with 2.6.28).


5. Server SDK Changes (breaking) 服务器SDK改变(破坏)

  • Peer classes are now required to inherit from class ‘PeerBase’. The
    former interface IPeer and class PhotonPeer were removed. Take a
    thorough look at the PeerBase class definition as it is a central
    piece of your application.
  • Applications are now required to inherit from class
    ‘ApplicationBase’. Like PeerBase this is one of the most important
  • Classes ResponseParameterAttributeRequestParameterAttribute and EventParameterAttribute have
    been substituted with class DataMemberAttribute. As a
    consequence, request and response parameters can not be part of the
    same container class anymore.
  • The Params property of
    classes EventDataOperationRequest and OperatioResponse has
    been substituted wth the new property Parameters. This
    dictionary’s keys are now of type byte.
  • The property EventData.EventCode has been renamed
    to ‘Code’ and its type was changed to byte.
  • The type of the
    properties OperationRequest.OperationCode and OperationResponse.OperationCode has
    been changed to byte.
  • The new class DataContract substitutes
    classes Operation and Event. While class Operation remains
    part of the framework it is not mandatory to use it in order to
    convert the parameters to class properties anymore.
  • Methods Event.GetEventData and Operation.GetOperationResponse have
    been removed. Instead use the
    new OperationResponse and EventData constructors.
  • PhotonPeer.SendBufferFull was removed.
    Override PeerBase.OnSendBufferFull to respond to a full send
    buffer. The counterpart PeerBase.OnSendBufferEmpty is called
    when Photon is ready to send more data.

  • Peer类现在内需继承类自PeerBase。接口IPeer和类PhotonPeer
  • 应用程序现在须继承自类
  • 仿佛 ResponseParameterAttribute 、 RequestParameterAttribute 和
    EventParameterAttribute 被类DataMemberAttribute
  • 类 EventData , OperationRequest 和 OperatioResponse
  • 属于性EventData.EventCode 已经更名为 “Code” 和其的门类变更吧byte。
  • OperationRequest.OperationCode 和 OperationResponse.OperationCode
  • 此新类DataContract
    替代了类 Operation 和 Event。虽然看似的操作是framework的平等局部,为了更换参数为接近的习性它是勿强制被利用的。
  • 方 Event.GetEventData 和 Operation.GetOperationResponse
    已于移除。而利用新的 OperationResponse 和 EventData 构造函数。
  • PhotonPeer.SendBufferFull 已被移除。覆盖 PeerBase.OnSendBufferFull
    PeerBase.OnSendBufferEmpty 会被调用。

6. Client SDK Changes (breaking) 客户端SDK改变(破坏)

  • renamed IPhotonListener interface
    member OperationResult to OnOperationResponseEventAcion to OnEvent and PeerStatusCallback to OnStatusChanged.
  • The different parameters of the
    old OperationResult (OperationCodeParameters, …) are
    passed in one object OperationResponse. Same applies
    to OnEvent now has one parameter EventData.
  • Support for invocation ID was removed.

  • 再也称IPhotonListener接口成员 OperationResult 为 OnOperationResponse
    、 EventAcion 为 OnEvent 和 PeerStatusCallback 为 OnStatusChanged 。
  • 原来的 OperationResult ( OperationCode , 参数
    ,…)的异参数为传送在一个 OperationResponse 对象里。同样适用于
    OnEvent 有一个参数 EventData。
  • 支撑调用ID已被移除。

  • PhotonHostRuntime version attribute was removed from the config file
    and is no longer required – we recommend to remove it to ease
    feature updates.

  • The application NetSyncObjects is no longer part of the SDK.
  • Changed default for dump files from mini to full
  • Added version display to log file during start up.

  1. PhotonHostRuntime
  2. 应用程序NetSyncObjects不再是SDK的一律有。
  3. 改转储文件的默认选项从迷你及总体。
  4. 长版显得到日志文件于开行之上。

图片 1

What’s in Photon 3 Photon3是什么

1. High Performance S2S API (Native/C++) 高性能的S2S API

     A while back we introduced the TCPClient a managed class better
suited for server to server communication than the standard client
library. The TCPClient had two disadvantages: First the programming
model on both ends of the connection was different (TCPClient on one
side, peer on the other), second it was designed for low-bandwidth
communication. With this release Photon can setup a connection to other
Photon instances leveraging the networking power of the Photon Core
while allowing to use the same programming model using peers on both
ends of the connection.



2. Load Balancing 负载均衡


     With Photon Load Balancing, developers are enabled to create
scalable multi-node solutions. It includes out of the box a master
server hosting the lobby and game servers to host the active games. The
Lite Lobby Application is delivered with a set of matchmaking methods
and a load balancing component that distributes the load (where to
create new games).

 Photon负载均衡,开发人员能够创立而扩大的多节点的缓解方案。它包括了一个主服务来托管大厅与多只戏服务来托管游戏。这个Lite Lobby应用程序是通过设置配对方法以及以负载均衡组件分配负载来开展提交工作之。


3. Event Caching 事件缓存

     So far, Lite had “Properties” for rooms and actors to store values
for players who join later on. They are a nice idea but a bit clumsy to
use: Whenever something has to be stored, you had to set properties. In
all other cases, you send events.The new Lite Application combines both
and gives you caching for events. Per player and event, you could cache
the values in it. If anyone joins, the events are sent immediately, like
they were just raised.



4. Extended Data Type Support 支撑数据类型的扩充

     Photon now supports more data-types than ever: Null values,
dictionaries, arrays of objects (each with its own type) and even custom
classes can be integrated and used in events.



5. The Peer has new properties Peer的新属性

     NetworkProtocol, LocalIP, LocalPort.


6. Up to now you configured a global default

     Now it is also possible to define a default application per



Bug Fixes Bug修复

  1. Fixed a memory leak when canceling actions scheduled on a fiber.
  2. S2S.TCPClient did not close the socket at disconnect which caused an
    error when calling Connect again.
  3. Flash policy file is claimed malformed with a top-level XML tag that
    is not, see\_security.html\#\_Malformed\_Policy\_Files
  4. Fixed CLR startup to ensure GC Server is used (issue affected .net
    4.0 only).
  5. Fixed ENet fragmented buffering flow control bug.
  6. Fixed TCP magic byte issues – fragmented pings where not parsed
    correctly and an issue in the internal handling of the size of
    packets could lead to parsing errors (bigger packets and high load).
  7. Fixed Photon hang on shutdown trying to log on a dead logging
  8. Fixed the method Peer GetRemoteAddress – due to a caching issue
    the result was wrong in some cases.
  9. Fixed mini dumps – now obey configured limits.
  10. Changed PhotonPeer::GetRemotePort so that it doesn’t rely on a
    cached port.

  1. 修正了当取消线程池的倒经常内存的透漏。
  2. S2S。
  3. Flash策略文件给声称也畸形的最高等级的XML标记,其实她不是,看到\_security.html
  4. 修正了CLR启动时因担保GC服务器是可用的。
  5. 修正了eNet分散缓冲流控制的不当。
  6. 修正了TCP魔法字节问题——不得法的辨析ping
  7. 修正了Photon在关机时准备在一个关门的日记实例进行记录。
  8. 修正了方peer GetRemoteAddress
  9. 修正迷你转储——现在听安排的界定。
  10. 改了 PhotonPeer::GetRemotePort ,因此,它不因让一个缓存的端口。





图片 2

    • 聚关系



    • 关联类 

图片 3


  • 贯彻关系

图片 4


    • 双向关联
  • 基本上重值和它们的代表





图片 5


属性名称 属性类型
flightNumber Integer
departureTime Date
flightDuration Minutes

Instance Name : Class Name



  • 分类
    • interface
    • utility
    • abstract(斜体表示)


  • 软件包




  • 实例


图片 6



  • 接近的属性





图片 7

图片 8

图片 9


  • 类图

图片 10


    • 结关系


图片 11




 在达到图中,继承关系由每个父类的独门的丝画起,这是在IBM Rational
Rose和IBM Rational

图片 12


name : attribute type
flightNumber : Integer

知道 BankAccount 类,而且知道 BankAccount
类并不知道它和 OverdrawnAccountsReport 相关联。

图片 13


  • 其间的结构










  • 关系关系
      • 属性关联类型

图片 14


图片 15

图片 16

  • 依靠关系
  • 延续关系
  • 角色
    • 照关系





图片 17




      • 属于性默认值



  • 可见性
      •  public
    • #  protected
      •   private
    • ~  package
    • 不过为关联 






name(parameter list) : type of value returned
操作名称 返回参数 值类型
Name Type
numberOfMinutes Minutes
getArrivalTime N/A Date



  • 接近的操作


name : attribute type = default value





图片 18