Quantcast
Channel: Photon Server — Photon Engine
Viewing all 1557 articles
Browse latest View live

what deffrentce beetween serverpeer and ClientSDK for performance test.

$
0
0
I'm developing load test.

and looking at performance test.
https://doc.photonengine.com/zh-cn/onpremise/current/performance/performance-tests

It's says
"But if you try to build a "load test client" with Photon's Client SDKs, the clients will be the bottleneck and you will get bad, misleading results."

now I'm wonduling what deffrentce beetween serverpeer and ClientSDK.
because I want to make a Real Performance test (I will use couple of server for client)

could you tell me advantage or disadvantage or any limitation as well.

Has anyone tried deploying with Docker?

$
0
0
Quick question. Has anyone tried deploying Proton Server to a Docker instance? Seems like a really nice mix of tech for arbitrary amounts of servers to setup and host.
If so, is there a tutorial or image somewhere I can work from? I'm not very familiar with Powershell but I'm sure I'll eventually need to learn it.

https://www.docker.com/

Server need for turnbased game

$
0
0
I want to host 1v1 game. It's turn based, and it will run one Unity .exe file/instance per 2 players (one match). What is the difference between Photon Server Unlimited and Photon Server Enterprise? Those exe files will run physics and communication logics. Will Photon Server Unlimited be enough for 1000 instances (matches) per hour?

Secure UDP communication and custom encryption.

$
0
0
Hi,

I've required to use BCrypt lib in order to secure UDP communications. Is that possible using photon servers ? (no PUN, no Bolt).

Experimenting with Loadbalancer SDK (Questions)

$
0
0
So I finally started to experiment with the Loadbalancer API (SDK) and now I have a few questions which I couldn't find in the documentation.

1) So on default - you can join with multiple identical UserIDs - even when using custom authentication. Since you could login multiple times and join different rooms with them - I was really surprised, why is this like that?

Since my Master Server will be in authoritative control of everything - I have to ensure that each player will only be available once. Sure you could do this in custom authentication - but updating values based on connection status in a database would be very troublesome to keep consistent.

So what I did now is I am checking the PlayerCache in the DoCustomAuthenticationResult - here I know the user has validated itself but then I do:

((MasterApplication)ApplicationBase.Instance).DefaultApplication.PlayerOnlineCache.playerDict.ContainsKey(this.UserId)

to check if the user is already available and if yes - I change the ReturnCode to something like UserBlocked.... (i made the playerDict public)

Now I wonder if this is the best approach in case I don't want the same user logged in multiple times?

2) Since I will only use the rooms for the actual battles between players and AI 0- the main logic will all be handled authoritative in the master client. So actually once the user logged in I don't need to tell them about rooms - this is something I will handle on the server - so a player initiates a "battle" (e.g. clicking on the npc) and then Ill create a room and the player will be transferred to the game server fighting against it and then be returned to the lobby/master afterwards.

So now I wonder if this is something feasable to achieve with the loadbalancer setup - or am I working completely against the basic design of the loadbalancer approach and their rooms? BUt I thought that I could greatly misuse the rooms for the battles which are in slow realtime and handle the game events on the master.

3) Is there anyway I could transfer some properties after redirecting back from game server to master server - so that the master server knows e.g. the battle succeeded - or do I need to handle this over the database - so that both game and master have access to it and update values there etc.?

4) In order to get my rooms hidden - I tried to override the default IsVisible Property server side. However since the client is still able to override this and the logic is not in loadbalancer API, rather in Hive itself - the most easy way to prevent players from changing this property - I guess I can simply override it in the GameClientPeer OnOperationRequest method like this:

if( request.Parameters.ContainsKey(248) && ((System.Collections.Hashtable)request.Parameters[248]).ContainsKey((byte)254))
((System.Collections.Hashtable)request.Parameters[248])[(byte)254] = false;
Would this be the correct way?

Thanks in advance for your time,
Oliver

is there any implements of HTTP request handle and response?

$
0
0
It's would be great if the photon can be treated as an HTTP server.

Can't Start Photon Server

$
0
0
Hello everyone!

I'm having trouble starting Photon Server. I've followed the instructions found here. but whenever I select LoadBalancing(MyCloud) > Start as application the server tries to start and fails with the following exception:
System.TypeInitializationException: The type initializer for 'Photon.CounterPublisher.SystemCounter' threw an exception. ---> System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at ExitGames.Diagnostics.Counter.PerformanceCounterReader.Initialize() in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Counter\PerformanceCounterReader.cs:line 134
at Photon.CounterPublisher.SystemCounter..cctor() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\SystemCounter.cs:line 36
--- End of inner exception stack trace ---
at...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Photon.CounterPublisher.SystemCounter' threw an exception. ---> System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at ExitGames.Diagnostics.Counter.PerformanceCounterReader.Initialize() in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Counter\PerformanceCounterReader.cs:line 134
at Photon.CounterPublisher.SystemCounter..cctor() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\SystemCounter.cs:line 36
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized)
at System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj)
at System.Reflection.RtFieldInfo.GetValue(Object obj)
at ExitGames.Diagnostics.Monitoring.CounterSamplePublisherFactory.InitializeCounterPublisher(CounterSamplePublisher counterSamplePublisher, Object counterSet, IEnumerable`1 memberList, String counterSetName) in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Monitoring\CounterSamplePublisherFactory.cs:line 256
at Photon.CounterPublisher.Application.Setup() in d:\dev\photon-socketserver-sdk_cloud\src-server\CounterPublisher\Application.cs:line 57
at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 1189
at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()
I'm trying to run the server on Windows 8.1 x64. Any help would be greatly appreciated.

Thanks

i have a problem ,my photon can not running, failed to load PhotonLicensing.dll

$
0
0
hi,i have a problem
Photon is running good in a few days ,but my photonserver can not be run now,and I don't see a file need to unlock
I tried run photon in other computer ,It runs very well
Or may be my computer environment problems, such as a port being used
And I downloaded the latest version of the SDK in website,also get the same results
this is log error--> failed to load PhotonLicensing.dll. Going to shutdown.
Who Can give me some suggestions,thanks
----------------------------------------------------------------------------------------
3080: 14:38:20.744 - ---
3080: 14:38:20.744 - Service: "Photon Socket Server" starting
3080: 14:38:20.778 - Config File: G:\unity3dProject\photonServer\Photon-OnPremise-Server-SDK_v3-4-28-8401\deploy\bin_Win64\PhotonServer.config
3080: 14:38:21.578 - Will produce at most: 10 crash dumps
3080: 14:38:21.699 - Action: run as exe
3080: 14:38:22.022 - Server Starting...
3080: 14:38:22.147 - Tick count: 18773987 (wraps in: 49.493 days)
3080: 14:38:22.147 - Tick count 64: 18774111
3080: 14:38:22.147 - Photon Version: 3.4.5.2597
3080: 14:38:22.147 - PID: 2800
3080: 14:38:22.243 - Config File: G:\unity3dProject\photonServer\Photon-OnPremise-Server-SDK_v3-4-28-8401\deploy\bin_Win64\PhotonServer.config
3080: 14:38:22.246 - Will NOT log unimportant exceptions
3080: 14:38:23.076 - Not using performance counters as they are not currently installed. Run the service with /InstallCounters to install them.
3080: 14:38:23.138 - Shutdown timeout enabled: 30000ms
3080: 14:38:23.263 - Starting I/O thread pool with 2 threads
3080: 14:38:23.346 - Using Standard allocator
3080: 14:38:23.510 - Max message size: 512000
3080: 14:38:23.705 - Starting business logic thread pool with the following settings
3080: 14:38:23.705 - InitialThreads: 4 threads
3080: 14:38:23.705 - MinThreads: 4 threads
3080: 14:38:23.705 - Thread pool is fixed size
3080: 14:38:23.706 - Starting ENet thread pool with the following settings
3080: 14:38:23.706 - InitialThreads: 2 threads
3080: 14:38:23.706 - MinThreads: 2 threads
3080: 14:38:23.706 - Thread pool is fixed size
3080: 14:38:23.707 - OnlyDispatchTimers: False
3080: 14:38:23.707 - S2S: flow control: Max pending writes: 50
3080: 14:38:23.707 - S2S: flow control: Max queued buffers: 200
3080: 14:38:23.800 - S2S: flow control: Max pending writes MUX: 500
3080: 14:38:23.800 - S2S: flow control: Max queued buffers MUX: 2000
3080: 14:38:23.800 - S2S: MaxInboundMessageSize: 512000
3080: 14:38:23.800 - S2S: MaxOutboundMessageSize: 512000
3080: 14:38:23.800 - S2S: No inactivity timeout
3080: 14:38:23.994 - WebSocket S2S: MaxInboundMessageSize: 512000
3080: 14:38:23.994 - WebSocket S2S: MaxOutboundMessageSize: 512000
3080: 14:38:23.994 - WebSocket S2S: No inactivity timeout
3080: 14:38:24.069 - Max Reliable Data In Transit (awaiting ACKs) per peer : 51200 bytes
3080: 14:38:24.069 - Per peer bandwidth limit
3080: 14:38:24.069 - Transmit Rate Limit: 256 KB/Sec
3080: 14:38:24.069 - Limit period: 200ms
3080: 14:38:24.069 - Limit per period: 52428 bytes
3080: 14:38:24.069 - Max queued data for transmission per peer: 512000 bytes
3080: 14:38:24.069 - Minimum retransmit timeout: 200
3080: 14:38:24.069 - Minimum ENet timeout: 5000ms
3080: 14:38:24.069 - Maximum ENet timeout: 30000ms
3080: 14:38:24.069 - Max Inbound Reliable Data Queued (awaiting resends of earlier sequence numbers) per peer : 163840 bytes
3080: 14:38:24.069 - Outbound ENet: MaxInboundMessageSize: 512000
3080: 14:38:24.069 - Outbound ENet: MaxOutboundMessageSize: 512000
3080: 14:38:24.159 - GetRuntime - About to load CLR - versions available:
3080: 14:38:24.159 - v2.0.50727
3080: 14:38:24.159 - v4.0.30319
3080: 14:38:24.159 - Configuration requests: "v2.0.50727"
3080: 14:38:24.159 - About to load version: "v2.0.50727"
3080: 14:38:24.292 - About to load runtime: PhotonHostRuntime.PhotonDomainManager from PhotonHostRuntime, Culture=neutral, PublicKeyToken=02C301B61B060C4D
3080: 14:38:24.293 - CLRBaseDirectory set to "G:\unity3dProject\photonServer\Photon-OnPremise-Server-SDK_v3-4-28-8401\deploy"
3080: 14:38:24.293 - Optimising event broadcast for 20 or more peers
3080: 14:38:24.303 - Start: About to load CLR - versions available:
3080: 14:38:24.303 - v2.0.50727
3080: 14:38:24.303 - v4.0.30319
3080: 14:38:24.303 - No preference in configuration file, will load latest.
3080: 14:38:24.303 - About to load version: "v4.0.30319"
3080: 14:38:24.333 - Loaded version: "v4.0.30319"
3080: 14:38:25.564 - Photon host runtime loaded
3080: 14:38:25.697 - ERROR: failed to load PhotonLicensing.dll. Going to shutdown.
3080: 14:38:25.698 - License has expired.
3080: 14:38:25.715 - Server shutting down...
3080: 14:38:25.715 - Shutdown monitoring enabled, 30000ms before process abort
3080: 14:38:25.716 - Notifying CLR applications of shutdown...
3080: 14:38:25.716 - RequestStop: defalt app domain
3080: 14:38:25.719 - Shutting down WebSocket Outbound Connection Manager...
3080: 14:38:25.723 - Shutting down TCP Outbound Connection Manager...
3080: 14:38:25.735 - Shutting down ENet Outbound Connection Manager...
3080: 14:38:25.735 - Disconnecting all outbound peers...
3080: 14:38:25.735 - Shutting down socket servers...
3080: 14:38:25.735 - Shutting down ENet thread pool...
3080: 14:38:25.735 - Shutting down TCP inactivity timers...
3080: 14:38:25.735 - Shutting down CLR applications...
3080: 14:38:25.739 - Shutting down business logic thread pool...
3080: 14:38:25.739 - Shutting down I/O thread pool...

-------------------------------------------------------------------------------------------------------------------------
2017-04-09 14:38:25,491 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - Initialize: ApplicationName = 'DefaultDomain', DomainID = '1'
2017-04-09 14:38:25,562 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - AppDomains with unhandled exceptions are usually not unloaded and restarted.
2017-04-09 14:38:25,572 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - Getting license information:
2017-04-09 14:38:25,690 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - Failed to get PhotonLicensing instance: 调用的目标发生了异常。
2017-04-09 14:38:25,692 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - ERROR: failed to load PhotonLicensing.dll. Going to shutdown.
2017-04-09 14:38:25,718 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - RequestStop: ApplicationName = 'DefaultDomain', DomainId='1'


Moved: Correct Client SDK for Photon Server, Unity 3D targeting Windows Store Universal 10

Moved: demo-particle-unity ArgumentNullException only on Parallel Desktop

Unclear where to start with rolling a Photon Server solution

$
0
0
Hey guys,

I'm working on a commercial product with a heavy hardware backend sending primitive data to Unity which is essentially being used just for visualization. Our existing implementation is Photon 3 with Lite (which is obsolete now, it seems). We had this outsourced ages ago and never put anymore work into it and the personnel with the knowledge aren't around anymore but we need to sort out some obscure issues we're having with communication and starting to think we need to just write a new implementation from scratch and port to Photon 4.1.x. We don't have a network specialist and I'm the only person with Unity knowledge, tasked to upgrade the existing stuff to the latest photon.

Thats where I need some feedback. We have Photon Control on a workstation with Unity and a separate workstation running some proprietary software which just sends messages over a TCP socket which Photon relays to Unity. This is a local scenario and isn't connected to the internet.

So from starting with the Unity Server SDK where should I start looking to facilitate this scope? I really just need Photon to listen on a port and bounce whatever comes across it over to the Unity client(s). The LoadBalancingAPI and examples seem very robust and over complicated for what we're trying to do, making it a slow process (for me) to find a solution.

Any feedback is appreciated.

Thanks

Where the photon server run at ?(Unity or Standalone)

$
0
0
I have a game that going to be released on steam. I made a network system with the Unity's network transport(low level).

And when I run my project on the windows server(desktop view) I see 100% CPU even if I put there empty project.(I know the CPU is low, but not that much.)

So my question is. If I will create dedicated servers for my game with photon, they will run in unity ?(as unity file ?)

Thanks ,
Aviv Oren.

OnReceivedRoomListUpdate() takes a while to receive, sometimes sends 0

$
0
0
Hi all. We're running our own Photon server, with a PUN client.

First, is there a built in way to force the room list to be sent by the server, so that EventCode.GameList or EventCode.GameListUpdate is received? We seem to be waiting several seconds for an OnReceivedRoomListUpdate() call. But sometimes a bunch of them come over the wire. I guess this is because people are leaving rooms and it sends an update. Is there a room list heartbeat time we can set to guarantee everyone in the lobby gets updated quickly?

Secondly, when we do get the call, we get a room list of size 0 at times, usually followed by the correct room number a few seconds later. Sometimes it sends 0 after we've already received correct room lists. This happens when people are logged in.

why 30% players 'disconnect' very frequently, others work fine

$
0
0
My online project using photon server in china, there are 30% of the players disconnect very frequently or cannot connect to server, other players work fine.
ps: use tcp

Forwarding unknown (complex) type "as is"

$
0
0
Feel like I am definitely misunderstanding something here.

I have a fairly complex object that I want to send/receive. Not keen to write serialisation/deserialization for it. The documentation states:

The Photon Server is able to forward unknown custom types "as is". This is why you don't need to register your types in the Photon Cloud.

However if I try to send the object using Peer.OpCustom, i get a cannot serialize() Exception.

Can anyone please clarify what is meant by the above documentation snippet?

Thanks
Vinnie.


Changing from local testing to public deployment

$
0
0
So I have a project that works fine when the PhotonServer applications GameServerIP is set to the local IP but when I change the setting to public IP the game no longer works the debugger is telling me that the game is connecting to my local IP for the MasterServer but when it attempts to connect to the GameServer it is attempting to connect to the public IP and that causes a timeout which obviously causes a crash. I am not sure what is wrong, I have not changed either of the loadbalancing ddl files and I am connecting with the ConnectUsingSettings command with my local IP in the server address box of the server settings. If I change that to my public IP I get a timeout so I am not sure where to go from here. Any help in transitioning from the LAN setting to a public server would be greatly appreciated.

Proxy Servers

$
0
0
How to deal with proxy servers. My game isn't establishing a connection on proxies.

Creating an authoritative .io/mmo style server using Photon's plugin SDK

$
0
0
Hello,

I think that after reading enough photon documentation I have an idea how to create a custom authoritative server by implementing a custom plugin and was hoping for some tips/feedback in that correct direction.

For background: I'm writing a photon server for a game that looks like a .io game (think agar.io,slither.io or more closely glor.io). I'm hoping to support up to 100-300 players on the same server in a single room. The clients will be using Unity and run across many platforms including web, pc, mobile and maybe even console one day. It's my understanding that the MMO example is now pretty old/out of date, and because I'd like Exit Games to host the code in the cloud that can't use the MMO example, and need to write plugin code anyways.

With that preamble in mind it looks like I need to do the following to create a custom authoritative game server:
  • Write a custom plugin based off of PluginBase
  • When a room is created, I create my own ServerGame instance which uses a repeating timer for the simulation tick.This tick runs the server side simulation of a bunch of game objects and AI elements.
  • Have the clients use RaiseEvent to send their inputs to the server (eg. I'm moving to the left, or I'm firing a bullet)
  • Use the IPluginHost.BroadcastEvent to send updates from the server to the clients who then do some interpolation etc. These events will only be send to clients in the correct "Interest Area", to reduce bandwidth requirements and get as many players as possible.
Is the above understanding roughly correct? Is there any code that I should steal from the older MMO example to make this easier?

Any feedback would be helpful!

Thanks,
Curt

what should to do if Master Server crash?

$
0
0
is there a way to do Active-Passive of Master Server? I am afraid if master server crash, any good suggestions?

Received game operation on peer without a game

$
0
0
I've implemented some simple server side checks during different loading periods of my game, where I wait for each client to send an operation before continuing. If they take too long, I remove them from the game using "RemovePeerFromCurrentRoom". What seems to happen some times is that the client doesn't get the message about being removed and just keeps sending operations, resulting in a lot of "Received game operation on peer without a game" messages on the server. Am I doing something wrong during the removal of the peer here?
Viewing all 1557 articles
Browse latest View live