2019-05-24 【网络】PUN2 自定义服务器

https://blog.csdn.net/qq_36565626/article/details/78710787
https://blog.csdn.net/a962035/article/details/80713726

优先级:00(这是一个系列的,但是我第一步跟着操作没能成功运行服务器)
优先级:01
优先级:02
大佬博客


For more infos see

http://doc.photonengine.com/en/onpremise/current/applications/loadbalancing/plugins
http://doc.photonengine.com/en/onpremise/current/applications/loadbalancing/plugins-faq

Quickstart of the Photon Server Plugin SDK

  1. extract photon-sdk-dotnet-demo-turnbased-console-X.X.X.XX-XXXX.zip

  2. IMPORTANT: downloaded files (selfextracting exes, zips or 7z files) should allways be unblocked before you unpack them!
    see here for details: https://blogs.msdn.microsoft.com/delay/p/unblockingdownloadedfile/

  3. Unpack Photon-OnPremise-Server-Plugin-SDK_vx-x-xx-xxxx.zip

  4. Unpack photon-sdk-dotnet-demo-turnbased-console-X.X.X.XX-XXXX.zip

  5. cd Photon-OnPremise-Server-Plugin-SDK_vx-x-xx-xxxx\src-server\Plugins

  6. Open WebHooks.sln
    IMPORTANT: per mouse click (or keyboard)
    NOTE: if you open the solution per file dialog in Visual Studio then F5 (start debug) will fail to start photon
    【注:修改位运行64位服务器,操作如下图】


    2019-05-24 【网络】PUN2 自定义服务器_第1张图片
    image.png
  1. Open WebhooksPlugin.cs. Go to the first line in OnCreateGame(...) and set a breakpoint.

  2. Press F5 to start Photon in debug mode
    【这步是从WebHooks启动服务器,启动之前要注意改一下ip地址为本机地址。最简单的方式是打开它提供的界面程序(服务器所在目录同目录),在界面修改。】

  3. cd demo-turnbased-console\demo-turnbased-console\bin\Debug

  4. Start TurnbasedConsole.exe - you should see the following output (once you press enter)
    【启动客户端】

    Enter player #: 0 (= default, press enter)
    connecting to:localhost:5055 as:MyPlayer0
    State: ConnectingToMasterserver - localhost:5055
    h | Help
    sa | Set Actor : actornr as int
    sr | Set Room : roomname
    c | Create Room : roomname
    j | Join Room : roomname
    jc | Join Or Create Room : roomname
    jr | Re-Join Room : roomname
    sro | Set Room isOpen : true|false
    srv | Set Room isVisible : true|false
    llr | List Lobby Rooms
    lsg | List Saved Games
    gsg | Get Saved Games
    d | Disconnect
    l | Leave (abandon)
    q | Quit
    ce | Cached Event (not forwarded) : event as string
    fe | Forward Event (non-cached) : event as string
    sii | Slice Increase Index
    ssi | Slice Set Index : index as int
    spi | Slice Purge Index : index as int
    spu | Slice Purge Up To Index : index as int
    spt | Set Property Turn : actornr as int

    For help (list of all available commands see above) press: h
    Note: commands and parameteres are entered in one line separated trough ':',
    for example c:myroom will create a room with name 'myroom'.

    ------------------------ continuing to connect ...
    StatusCode: Connect
    StatusCode: EncryptionEstablished
    State: ConnectedToMaster

  5. Next create a room by typing

    c

This should trigger the breakpoint. Press F5 to continue - you should see the following lines:

>>> Create Room:
State: ConnectingToGameserver - 127.0.0.1:5056
StatusCode: Disconnect
StatusCode: Connect
StatusCode: EncryptionEstablished
State: ConnectingToGameserver - 127.0.0.1:5056
a[1]: joined
  1. To get all available commands type

    h

你可能感兴趣的:(2019-05-24 【网络】PUN2 自定义服务器)