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

Some newbie questions regarding self hosting

$
0
0
Hey Forum,

I would love if you guys could help me better understand some things regarding self hosting. To be clear I am not a programmer on this project.
We are getting ready to release our 50 player shooter game, which is expected to have around 2-10k CCU at any given time.

We decided to go with Photon OnPremise, self hosting, instead of with Cloud as we needed server authority.
For testing we have been running the master on our own machines so far, but as we move towards large ish scale internal testing so we need to support a fair amount of players.

I am a little bit confused regarding the best self hosting method for us, from what I can tell there are quite a few options, AWS EC2/Azure for cloud hosting, and various options for "bare metal" dedicated servers. I have a decent understanding of the difference between cloud/fully dedicated servers.

Here are some questions:

1. What would be the best hosting option for us, supporting a heavy shooter game, 50 players per instance with high CCU (2-10k)
2. What are the upsides/down sides of cloud vs bare metal?
3. Which is easier to setup/update the master frequently?


Thanks!


Show Rooms only for certain users

$
0
0
Hi,

We want to create rooms, which can be listed/e.g. seen only by certain users (player-a/b/c).

Creating the Room:
RoomOptions roomOptions = new RoomOptions();
            roomOptions.MaxPlayers = 8;
            roomOptions.PublishUserId = true;
            roomOptions.IsVisible = false; //not everybody should see this room
            roomOptions.IsOpen = true;
            roomOptions.CustomRoomPropertiesForLobby = new string[] { "C0" };
            roomOptions.CustomRoomProperties = new Hashtable() { { "C0", "' player-a player-b player-c '" } }
            
            TypedLobby typedLobby = new TypedLobby();
            typedLobby.Name = GetTypedLobbyName();
            typedLobby.Type = LobbyType.SqlLobby;
            
            b = PhotonNetwork.CreateRoom(roomName,
                roomOptions,
                typedLobby);

Filtering the Room:
TypedLobby sqlLobby = new TypedLobby(GetTypedLobbyName(), 
                LobbyType.SqlLobby);
            string sqlLobbyFilter = "C0 LIKE ('% " + "player-a" + " %')";
            PhotonNetwork.GetCustomRoomList(sqlLobby, sqlLobbyFilter);


This should show in "OnReceivedRoomListUpdate" some results, but the method is not called.

It gets called when "roomOptions.IsVisible" is set to "true", but in this case, the "sqlLobbyFilter" and "PhotonNetwork.GetCustomRoomList" does not make much sense, because everybody can see the room (without setting the filter, or calling GetCustomRoomList).

Have you an Idea?

The only solution we came up with:
Store room names somewhere else (web/api) and retrieve the names from there and call "JoinRoom" explicitly with the names from the "web/api"?

Thank you very much

How reliable is execution timing?

$
0
0
For example if i Instantiate object, then immediately call RPC on it
will it guarantee that its always called on same frame before Start() for all clients?

var my = PhotonNetwork.Instantiate("my");
my.RPC("Constructor",param1,param2,param3);


or is it if on bad network it may happen that object is instanciated, then on other frame "Constructor" called?

(Sorry I posted this to wrong topic, should go to PUN)

Closing Connection to client from server LoadBalancing

$
0
0
Hi, I just wanted to know if there is a way to close the clients connection. So when an admin bans the player they are disconnected from their current game. Since I am using custom auth, they won't be able to re-join but I need a server sided way of disconnecting them. Thanks

Photon Server Public IP not Work!

$
0
0
So, I downloaded the "Self-Hosted" photon sdk to create and run a proper server, but when I choose "Local IP" on the photon control game server, I can connect to the same network (as expected), however when I choose "public IP" or "Public ip detect", it does not enter.

When I Execute The Action Of "run client test" by the photon gives error, and does not connect ("Games dont exist").

I saw that several people had the same problem, already tried everything, open router ports, leave ip fixed !, but nothing works.

I read on photon's website that the minimum requirements to run the sdk server would be:

-Windows 8 ... (I have the 7)

or even asking for windows server 2012.

I'll have to format my PC? to install windows server? or windows 8? how confusing

Public IP is A IP of Computer Or Lan?

$
0
0
a question, No Photon Control, Does the ip of my router appear right? if I check this option "public IP" do I need to pass the IP from the router or from the computer to the "ServerSettings" within unity? help me on this...

How can I send user data from client to InitRequest on the server?

$
0
0
Hello, I notice that when create peer on the server side. It has InitRequest as an argument. InitRequest has UserData as a public object variable. My client is Unity. I'm using Photon plugin for Unity (Photon3Unity3D.dll). I have PhotonPeer on the client side to connect to server. But its connect method only has serverAddress and applicationName as arguments. I can currently connect and communicate with the server just fine using connect method. But how can I send UserData from the client and use it in CreatePeer on the server?

I want to connect photons with javaSctipt client,but " Failed to locate certificate "


Photon Log Error

$
0
0
Hello. I always got these errors. Can u guys give me some advice about this.

10000: 09:00:59.305 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
2472: 09:03:05.740 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
9272: 09:03:26.564 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:03:43.663 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
10000: 09:04:13.465 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:04:51.496 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:05:15.466 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:08:53.502 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 8
10000: 09:09:14.042 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x6
10000: 09:12:45.282 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
10000: 09:17:01.628 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 20
9272: 09:19:48.234 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 8
9272: 09:19:52.977 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 38
10000: 09:23:17.262 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
10000: 09:24:57.652 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
2472: 09:26:40.241 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
9272: 09:26:40.661 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:34:01.759 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 8
10000: 09:34:19.665 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:36:35.994 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
10000: 09:38:08.892 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9272: 09:40:23.728 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
10000: 09:42:23.876 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9272: 09:44:06.009 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
10000: 09:44:31.228 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
10000: 09:45:57.402 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
10000: 09:50:37.937 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9272: 09:52:16.326 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 26
9272: 09:53:48.393 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
10000: 09:55:01.437 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9272: 09:55:43.084 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
9272: 09:56:43.860 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
9272: 09:56:46.888 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
10000: 09:59:47.786 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
9464: 10:04:31.965 - CTCPSocketServer::ReadCompleted - Exception - CTCPStreamProcessor::ProcessDataStream() - Invalid message format: 0xfe - 2 - FE 01 - ..
10000: 10:04:48.133 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9272: 10:05:13.111 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
9464: 10:07:29.878 - CFilterDataBase::OnSocketReleased() - References still held: 2
10000: 10:07:44.068 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x2
9272: 10:08:36.789 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
2472: 10:08:40.458 - CFilterDataBase::OnSocketReleased() - References still held: 2
10000: 10:09:39.571 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
9272: 10:09:41.618 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14

Photonserver starts and immediately crashes on win2016 server

$
0
0
Hi all
OS = Windows server 2016 64 bits
Photon On Premise Server SDK v4-0-29-11263
.Net Framework 4.6 and 3.5 installed
(if some of you want to know how to install .Net Framework 3.5 on win 2016 server , just ask me)

When I launch ...\deploy\bin_Win64\PhotonControler.exe , I get (almost immediately 'Photon stopped'

CLR log shows
2018-08-22 17:06:15,095 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - Getting license information:
2018-08-22 17:06:15,189 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - Failed to get PhotonLicensing instance: Exception has been thrown by the target of an invocation.
2018-08-22 17:06:15,189 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - ERROR: failed to load PhotonLicensing.dll. Going to shutdown.

What I've tried
To do the same on win10, win 2012 server : it works

I corrupted the PhotonLicensing.dll to identify if the file could be found and read
In this case CRL log shows
2018-08-22 18:04:13,446 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - Getting license information:
2018-08-22 18:04:13,462 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - Failed to get PhotonLicensing instance: Could not load file or assembly 'PhotonLicensing.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
2018-08-22 18:04:13,462 [ 1] ERROR PhotonHostRuntime.PhotonDomainManager - ERROR: failed to load PhotonLicensing.dll. Going to shutdown.


Nota : PhotonLicensing.dll file is not 'blocked'

No additional relevant info in the Photon-loadbalancing log

Please advise .
I can't change my server which needs to run win2016 server.

Thanks

What are "Game Server" and "Master Server"???

setDisconnectTimeout is not working

$
0
0
Hello, I am using client version: photon-androidndk-sdk_v4-1-10-2, server version: Photon-OnPremise-Server-SDK_v4-0-29-11263. I found that the setDisconnectTimeout function is not working. When I turned off wifi, I got Status Code 1025 immediately. That means "the PhotonPeer just disconnected." My initial Code is like:

_peer = new PhotonPeer(*this, ConnectionProtocol::TCP);
_peer->setDebugOutputLevel(DebugLevel::INFO);
_peer->setDisconnectTimeout(15000);

Moved: setDisconnectTimeout is not working

In which order to do everything?

$
0
0
Hello! I used to use Photon Cloud for games with rooms for 2-5 people. It's time to try to make an MMO prototype game. For this, I want to use a server. I'm using Unity3d 2018.

Where do I start? I downloaded the server and the license. What should I download for Unity3d? Can I use the same Asset I used for Photon Cloud which is on assetstore?

I downloaded SDK v4.1.1.17 and inserted in Unity3d 2018 in the log in a clean project there were errors, what did I do wrong?




Moved: In which order to do everything?


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.

Photon server and PUN 2 samples

$
0
0
tell a newbie please.
Installed the last server. I installed the last PUN2 in the new unit project. Set the correct connection address in the settings 127.0.0.1:5056. But when I try to connect, I get an error

Got a unexpected Disconnect in LoadBalancingClient State: Disconnected. Server: MasterServer Trace: at Photon.Realtime.LoadBalancingClient.OnStatusChanged(StatusCode statusCode) in C:\!Unity\TestPhoton\Assets\Photon\PhotonRealtime\Code\LoadBalancingClient.cs:line 2302
at ExitGames.Client.Photon.PeerBase+<>c__DisplayClass100_0.b__0() in C:\Dev\photon-sdk-dotnet\PhotonDotnet\PeerBase.cs:line 895
at ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands() in C:\Dev\photon-sdk-dotnet\PhotonDotnet\EnetPeer.cs:line 429
at ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands() in C:\Dev\photon-sdk-dotnet\PhotonDotnet\PhotonPeer.cs:line 1422
at Photon.Pun.PhotonHandler.FixedUpdate() in C:\!Unity\TestPhoton\Assets\Photon\PhotonUnityNetworking\Code\PhotonHandler.cs:line 126
UnityEngine.Debug:LogWarning(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1814)
Photon.Realtime.LoadBalancingClient:OnStatusChanged(StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2304)
ExitGames.Client.Photon.<>c__DisplayClass100_0:b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:895)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:429)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1422)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:126)

Can't connect with same username on Photon self hosted

$
0
0
Hi guys!

I'm using Unity 2017.4.3 and the "PUN 2 - FREE" Unity Asset to develop an app that is working fine with Photon Cloud.
I'm now trying to switch it to a Photon self hosted server, but it seems like there are a few differences.

I used to be able to join the same room with multiple clients sharing the same username. It doesn't work with self hosted, I get this response:
OperationResponse 226: ReturnCode: 32746 (Join failed: UserId 'ramji' already joined the specified game (JoinMode=1).). Parameters: {} Server: GameServer

Also, when I get the number of users in my room on another client, it displays 2, even though I just created my room and only the master is connected to it.

Any idea about what are the changes to do when switching from cloud to self hosted?

Thanks!

How to log and debug

$
0
0
In unity I simple write "Debug.Log(string)", it shows me the string content in the console. In eclipse for appwarp, I use System.PrintIn(string), it shows me the content as soon as I run the java content right from the editor. How to do similar logging and debugging in photon server code?

Authentication Token Issues

$
0
0
Hello,
Our company uses the Photon On-Premise server.

I recently rebuilt using the batch script: "C:\Photon Server\build\deploy.prompter.bat"
After I did this I went to run my game and I keep getting the following errors:

Error 1:
NETWORK: Operation failed: OperationResponse 230: ReturnCode: 32767 (Authentication token is missing). Parameters: {} Server: GameServer => Translation: Other Error.

UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1623)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
Error 2:
The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1655)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
Error 3(just debugging the cause from the OnFailedToConnectToPhoton() callback):
The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1655)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Extensions/Networking/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
I'm not entirely sure what to make of this.
it was working previously, and I hadn't changed anything in the source, I just was curious what the batch was for, (convenience I figured) and the Auth token is assigned in two separate locations:

internal virtual void OnConnectedToMaster() { print("NETWORK: Successful: Connected to Master.\n"); print("NETWORK: Joining Random Room...\n"); Debug.LogWarning("REMINDER: Create Proper Auth Values.\n"); PhotonNetwork.AuthValues = new AuthenticationValues(DateTime.Now.ToLongTimeString()); PhotonNetwork.JoinLobby(); //PhotonNetwork.JoinRandomRoom(); }

and as another check:
internal virtual void OnJoinedLobby() { print("NETWORK: Successful: Client connected and gets a room-list - Room-list is stored in PhotonNetwork.GetRoomList()\n"); print("NETWORK: Joining Random Room...\n"); if (!string.IsNullOrEmpty(PhotonNetwork.AuthValues.Token)) PhotonNetwork.JoinRandomRoom(); else { PhotonNetwork.AuthValues = new AuthenticationValues(); Debug.LogError("Null or Empty Photon Auth Token\n"); PhotonNetwork.JoinRandomRoom(); } }

But when debugging this, the AuthValues are empty, even after assigning it, both times.
Like I said, this used to work, and now it's not... What are your thoughts?
Viewing all 1557 articles
Browse latest View live