Is there any way to do it?
The problem is that I have a room with PlayerTTL > 0 and EmptyRoomTTL> 0 in order to make possible the disconnected players to reconnect the room. Everything works fine. But after the game is over and all players have left the room the room is still alive until EmptyRoomTTL expires. And nevertheless IsOpen and IsVisible properties of the room are both equal to false, inactive players are still able to rejoin this room. So, if one of those players initializes random matchmaking it is possible that he will join that room. And I'd like to prevent this possibility and close this room or make it inaccessible to random matchmaking.
P.S. I'm sorry for my English! )
↧
Close the room from plugin
↧
Moved: 2 Person multiplayer (Help: Camera issue)
This discussion has been moved.
↧
↧
AuthSettings
Hi!
I'm trying to handle reconnect routine. I have a player that creates new room, loses connection, reconnects to master and then rejoins the room. Everything goes well with AuthSettings set to true. If AuthSettings is set to false, reconnect goes well and rejoin attempt leads to an error:
Operation failed: OperationResponse 226: ReturnCode: 32746 (Join failed: UserId '00000000-0000-0000-0000-000000000000' already joined the specified game (JoinMode=3).). Parameters: {} Server: GameServer
So what exactly does AuthSettings set to true? Is there any way to rejoin without setting it to true? Maybe there's something I did wrong? Why is UserId equal to '00000000-0000-0000-0000-000000000000'?
P.S. I'm sorry for my English!
↧
Unity WebGL build with Photon Server
Hello!
We have our game, that works on mobile platforms, and communicates with Photon Servers, that are hosted on different remote machines.
Now, we decided to make WebGL version of our game, however, we have met following problem:
WebGL build does not work with UDP, and expects WS/WSS.
How can we achieve that with our current setup?
Should we rewrite our servers? Or is there any adapter we might use for our servers to work with both webgl/mobile apps?
We use SDK_v4-0-29-11263 for server, it is just modified LoadBalancing app, that communicates with client through RPC, Operation Request/Response.
Many thanks, hope we will get some help here!
↧
Blocking room is safe?
I am carrying out a blocking web operation (with timeout) so that data room data is synced to our cloud before closing room. I am Holding off IBeforeCloseRoomInfo.Continue() call until this timed loop finishes, can some one verify if, blocking this room does not affect other rooms?
In other words is each room run on different thread(Physical or Virtual)?
↧
↧
Cannot get custom plugin to load on room creation.
I keep getting the default plugin bounced back at me even when specifying which one to load on connection. I cannot load any of the test plugins either, if someone could point me in the right direction it would be a great help.
Photon: Warn: opCreateRoom() failed: Plugin Mismatch requested='BasicsTestsPlugin' got='Default'
Return code is always: 32751
Connection code:
RoomOptions myRoomOptions;
myRoomOptions.setCustomRoomProperties(props);
JVectorpluginsRequired;
pluginsRequired.addElement(JString(L"BasicsTestsPlugin")); // DISPlugin for mine
myRoomOptions.setPlugins(&pluginsRequired);
mpDTc->opCreateRoom(RoomName, myRoomOptions);
Logging::get().logToOutput(L"Creating room " + RoomName);
My Plugin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Photon.Hive.Plugin;
namespace DT.HivePlugin
{
public class DISPlugin : PluginBase
{
public override string Name
{
get
{
return "DISPlugin";
}
}
}
}
My plugin Factory:
using System;
using System.Collections.Generic;
using Photon.Hive.Plugin;
using Photon.Hive.Plugin.WebHooks;
namespace DT.HivePlugin
{
public class PluginFactory : Photon.Hive.Plugin.IPluginFactory
{
public IGamePlugin Create(IPluginHost sink, string pluginName, Dictionary config, out string errorMsg)
{
var plugin = new DISPlugin();
if (plugin.SetupInstance(sink, config, out errorMsg))
{
return plugin;
}
return null;
}
}
}
Settings
Property:
DISPlugin
DISPlugin.dll
DT.HivePlugin.PluginFactory
Output in config file:
I'm a bit lost.
↧
How to Start and Where to Start?
I totally new in Photon server. I create multiplayer Unity Game but I need a API for connection and create user, room creation, Fetch data from photon server. I don't know thing about photon server.
How to and where started work Photon server?
How to connect photon server and how to configuration to photon server to unity game?
What type of programming language are use in photon?
If I create API and how to configuration to unity3d (Game to photon server)?
Help Me!!!
I new in Photon server
↧
Photon Cloud is not triggering webhooks
I have troubles getting webhooks to work on photon cloud. My custom authentication provider is working, whereas all other webhooks are not triggered. The webhooks are hosted in aws lambda and working, as I tested them with Postman. I currently only use the pathcreate and pathjoin webhooks, but none of them are triggered.
Can you please help me setting up the webhooks?
↧
How to reconnect before connection timeout?
Hello, I experience this behavior of photon server plugin:
1) I am an user in a room X (player TTL is 1sec, Room TTL 3mins)
2) the client dies (without proper disconnect)
3) I immediately try to reconnect and re-join to the same room with the same user (before connection timeout expires)
4) re-join attempt fails. related log messages on server side:
WARN Photon.Hive.HiveGame -
JoinApplyGameStateChanges: Game 'Room_sgl:gikx-syrk-n3in-nd65_Singleplayer_491705' userId 'sgl:gikx-syrk-n3in-nd65' failed to join. msg:Join failed: UserId 'sgl:gikx-syrk-n3in-nd65' already joined the specified game (JoinMode=3). -- peer:GameClientPeer: PID 15, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 10/16/2018 3:22:06 PM in Room Room_sgl:gikx-syrk-n3in-nd65_Singleplayer_491705, IP 192.168.2.55:41673,
5) join attempt fails too
WARN Photon.Hive.HiveGame -
JoinApplyGameStateChanges: Game 'Room_sgl:gikx-syrk-n3in-nd65_Singleplayer_491705' userId 'sgl:gikx-syrk-n3in-nd65' failed to join. msg:Join failed: UserId 'sgl:gikx-syrk-n3in-nd65' already joined the specified game (JoinMode=0). -- peer:GameClientPeer: PID 17, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 10/16/2018 3:22:07 PM in Room Room_sgl:gikx-syrk-n3in-nd65_Singleplayer_491705, IP 192.168.2.55:40362,
If I wait for cca 1min, the client connection timeotes and I am able to join the same room with the same user. But I need to do this BEFORE the timeout. Any suggestion?
than you
↧
↧
Photon Self hosted, can't connect second client to room
Hey,
So I've got the photon sdk installed on my windows server 2016 machine. When I go to my w10 pc, and say; I'll launch the game in a unity build, it connects, creates a room, and I'm free to move around.
If I now go into the editor, run the game, and try to join that room, it logs that it's connecting to gameserver for 20 frames, then goes back to logging its status as connected to masterserver.
I'm just trying to get it working for Lan before I expand to public. The PhotonServerSettings are set to the LAN IP (192.168.178.94) the port is set to 5055 and protocol set to UDP.
Anyone got any ideas?
↧
How to use photon S2S feature to do performance test on self hosted server
I follow the following document:
https://doc.photonengine.com/en-us/server/current/app-framework/server-to-server-introduction
But I think it is not detailed enough.My steps are as follows:
1. Implementing the in bound shared library(DLL)
source code
It generates a DLL PerformanceTest.dll,then edit the PhotonServer.config, add the following items:
I replace the "< >" with "()" since XML cannot be displayed.
(!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. --)
(TCPListeners)
(!-- TCP listener for Game clients on Master application --)
(TCPListener
IPAddress="0.0.0.0"
Port="4532"
OverrideApplication="PerformanceTest"
PolicyFile="Policy\assets\socket-policy.xml"
InactivityTimeout="10000")
(/TCPListener)
(/TCPListeners)
Then add a new Application item:
(!-- Defines which applications are loaded on start and which of them is used by default. Make sure the default application is defined. --)
(!-- Application-folders must be located in the same folder as the bin_win32 folders. The BaseDirectory must include a "bin" folder. --)
(Applications Default="Master")
...
//here a Application for performance test
(Application
Name="PerformanceTest"
BaseDirectory="PerformanceTest"
Assembly="PerformanceTest"
Type="PerformanceTest.MyInboundApplication"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config")
(/Application)
(/Appications)
Then copy the PerformanceTest relevant files to Photon\deploy\ folder like CounterPublisher then run the Photon server.
The listening port 4532 is OK:
C:\Users\Administrator>netstat -a -n -p TCP
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:843 0.0.0.0:0 LISTENING
TCP 0.0.0.0:943 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:4520 0.0.0.0:0 LISTENING
TCP 0.0.0.0:4530 0.0.0.0:0 LISTENING
TCP 0.0.0.0:4531 0.0.0.0:0 LISTENING
TCP 0.0.0.0:4532 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9090 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9091 0.0.0.0:0 LISTENING
TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING
2. Implement a out bound exe ,the codes are as follows:
source code
then run the app, the MyOutboundPeer.isconnected is always flase and 4532 cannot be connected succcessfully ......
↧
Custom Events and RPCs on self hosted server
Hi everyone, I'm super new to photon's self hosted server with unity, but I did play around with the cloud version before.
I am trying to setup my own server logic on top of the load balance template, but I need a bit of direction to start.
I want to setup my own events from and to the server.
For example, I want the master server to send a call to the user (who is in the lobby) when something on the server happens (eg. get a friend request, message, etc)
I'm also looking to create something similar with the game server itself
what is the best way to approach this?
Also, how do I send a specific event from unity? for example, I want to create an event on the server an event to generate a random reward, how do I trigger it from the client in Unity?
Thanks!
↧
How to send messages between master server and game server
Hi,I'm using photon loadbalancing to build my own server, and is works very nice so far, bu i'facing a problem now. i want to send events between my master server and my game server, but i only found that my master server can use IncomingGameserverPeer class to receive event from game server, and games server can use outgoingMasterServerPeer to send events to master server, but i wonder how can master server send events to game server and how can game server receive events from master server ?
↧
↧
Server abort abnormally
Hello, my server program automatically aborted, here is the log. Please help me analyze the cause of the problem. In addition, I'd like to ask if the service has this feature: if the server stops abnormally, can I get an email or text message notification?
2088: 07:14:48.884 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
5308: 07:15:06.602 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
2952: 07:15:06.606 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
2952: 07:15:06.624 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
2952: 07:15:06.627 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
2088: 07:15:06.634 - CManagedHost::OnTimeout() - OPR_FinalizerRun - eUnloadAppDomain
2088: 07:15:06.634 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
2192: 07:15:06.665 - CFilterDataBase::OnSocketReleased() - References still held: 2
2272: 07:15:06.669 - CFilterDataBase::OnSocketReleased() - References still held: 2
2192: 07:15:06.850 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 38
2272: 07:15:06.882 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 14
2272: 07:15:07.042 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
2272: 07:15:07.224 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
2192: 07:15:07.774 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
5500: 07:15:08.639 - Unloading Domain: ApplicationName = 'P2PLiveServer', DomainId='2'
2192: 07:15:09.806 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
2272: 07:15:13.107 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
2272: 07:15:13.674 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message type, expected: 0x00 got: 0x82
2192: 07:15:13.879 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
2272: 07:15:14.086 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 33
2272: 07:15:14.626 - CThreadPool::Process - Exception - PeerAppSelection() - Init: Unexpected message length, need at least 40 bytes, got: 18
2088: 07:15:23.678 - CManagedHost::OnTimeout() - OPR_AppDomainUnload - eRudeUnloadAppDomain
8868: 07:15:23.679 - CManagedHost::OnFailure() - FAIL_CriticalResource - eThrowException
8868: 07:15:23.679 - CManagedHost::OnFailure() - FAIL_OrphanedLock - eNoAction
2088: 07:15:23.689 - CManagedHost::OnTimeout() - OPR_AppDomainRudeUnload - eDisableRuntime
2088: 07:15:23.689 - CManagedHost::OnDefaultAction() - OPR_ProcessExit - eDisableRuntime
2088: 07:15:23.689 - CManagedHost::OnCLRDisabled()
2088: 07:15:23.689 - Shutdown request from PhotonHostRuntime: CLR Disabled Exit code: 107
2088: 07:15:23.689 - Shutdown requested.
5292: 07:15:23.696 - Service is stopped...
5292: 07:15:23.696 - Server shutting down...
5292: 07:15:23.696 - Shutdown monitoring enabled, 30000ms before process abort
5292: 07:15:23.696 - Notifying CLR applications of shutdown...
5292: 07:15:23.696 - RequestApplicationStop: 3
5292: 07:15:23.698 - RequestApplicationStop - Exception: CManagedHost::RequestApplicationStop() - Failed to request application to stop in AppDomain: 3 - The process terminated unexpectedly.
5292: 07:15:23.698 - RequestApplicationStop: 2
5292: 07:15:23.698 - RequestApplicationStop - Exception: CManagedHost::RequestApplicationStop() - Failed to request application to stop in AppDomain: 2 - The process terminated unexpectedly.
5292: 07:15:23.698 - RequestStop: defalt app domain
5292: 07:15:23.698 - RequestApplicationStop - Exception: CManagedHost::RequestStop() - Failed to request default app domain to stop - The process terminated unexpectedly.
5292: 07:15:23.698 - Shutting down WebSocket Outbound Connection Manager...
5292: 07:15:23.698 - Shutting down TCP Outbound Connection Manager...
5292: 07:15:23.698 - Shutting down ENet Outbound Connection Manager...
5292: 07:15:23.698 - Disconnecting all outbound peers...
5292: 07:15:23.698 - Shutting down ENet host...
5292: 07:15:23.698 - Disconnecting all peers...
5292: 07:15:23.698 - Shutting down socket servers...
5292: 07:15:23.705 - Shutting down ENet thread pool...
5292: 07:15:23.705 - Shutting down TCP inactivity timers...
5292: 07:15:23.705 - WaitingForShutdownToComplete: NativePolicy:0.0.0.0:843
5292: 07:15:23.705 - OnShutdownCompleted: NativePolicy:0.0.0.0:843
5292: 07:15:23.705 - WaitingForShutdownToComplete: NativePolicy:0.0.0.0:943
5292: 07:15:23.705 - OnShutdownCompleted: NativePolicy:0.0.0.0:943
5292: 07:15:23.705 - WaitingForShutdownToComplete: NativePolicy::::843
5292: 07:15:23.705 - OnShutdownCompleted: NativePolicy::::843
5292: 07:15:23.705 - WaitingForShutdownToComplete: NativePolicy::::943
5292: 07:15:23.705 - OnShutdownCompleted: NativePolicy::::943
5292: 07:15:23.705 - WaitingForShutdownToComplete: TCP:0.0.0.0:4520
5292: 07:15:23.705 - OnShutdownCompleted: TCP:0.0.0.0:4520
5292: 07:15:23.705 - WaitingForShutdownToComplete: TCP:0.0.0.0:4530
3488: 07:15:23.707 - CCLRApplicationCollection::Application::OnDisconnect() - Unabled to obtain COM error, treating hr as lastError: The process terminated unexpectedly.
3908: 07:15:23.707 - CCLRApplicationCollection::Application::OnDisconnect() - Unabled to obtain COM error, treating hr as lastError: The process terminated unexpectedly.
↧
Set up an App IDF
Hello,
I'm using a self hosted photon server.
On the client side in the app i can set up an App ID but where can i set the app id on my server.
If i don't have an app id, the server is open everyone who knows my server ip? How can i prevent, that other apps
are using my server?
knuppel
↧
Bug report - OnLeave() callback called when a player with a clashing userId tries to join the room
Hello,
Apologies if this has already been reported (I did a quick search and didn't find anything similar).
This is a Photon plug-in issue.
When two or more players with the same userId try to join the same room, the 2nd player will correctly fail to join.
However, the photon plug-in will call OnLeave() callback for that 2nd player (even though OnJoin() for that player was not called).
This makes the plug-in assume that the 1st player, left the room (while in fact it may still be connected).
The use case scenario when it may be relevant is when a user have the game installed on more than one PC and try to run the game on both.
I am currently using Photon server version 4.0.28.2962.
Thanks,
Sylwester
↧
Client not receiving data from Plugin Broadcast event
Hello,
I've trying to send information from a plugin down to a client using a scheduled event and a timer, the event code fires in the client but the Hashtable is empty.
Dictionary wDataToSend = new Dictionary();
wDataToSend.Add(1, (int)recDisStruct.X);
wDataToSend.Add((byte)2, (int)recDisStruct.Y);
wDataToSend.Add((byte)3, (int)recDisStruct.Z);
wDataToSend.Add((byte)4, recDisStruct.A);
wDataToSend.Add((byte)5, recDisStruct.B);
wDataToSend.Add((byte)6, recDisStruct.C);
this.RaiseEvent(12, wDataToSend);
public void RaiseEvent(
byte eventCode,
object eventData,
byte receiverGroup = ReciverGroup.All,
int senderActorNumber = 0,
byte cachingOption = CacheOperations.DoNotCache,
byte interestGroup = 0,
SendParameters sendParams = default(SendParameters))
{
Dictionary parameters = new Dictionary();
parameters.Add(245, eventData);
parameters.Add(254, senderActorNumber);
PluginHost.BroadcastEvent(receiverGroup, senderActorNumber, interestGroup, eventCode, parameters, cachingOption, sendParams);
}
In the client:
void DTListener::customEventAction(int playerNr, nByte eventCode, const Object& eventContentObj)
{
ExitGames::Common::Hashtable eventContent = ExitGames::Common::ValueObject(eventContentObj).getDataCopy();
if (eventCode == 12)
{
...
}
}
I also tried without the helper or wrapper classes, but there isn't any data in the received Object?
↧
↧
Number of Players Supported by Photon Cloud?
How many players can Photon Cloud Handle and still Perform pretty well?
I have a project I worked on previously where I limited the Game Sessions to 10 Max Players, and if I reached the Max Players of 10, the Game would Lag like Crazy!
I was never sure if it was the Code, or it was Photon Cloud Server not able to Handle more than a Few Players...
What is a Safe Number of Players per Game Session should we allow when using Photon Cloud?
I have a project I worked on previously where I limited the Game Sessions to 10 Max Players, and if I reached the Max Players of 10, the Game would Lag like Crazy!
I was never sure if it was the Code, or it was Photon Cloud Server not able to Handle more than a Few Players...
What is a Safe Number of Players per Game Session should we allow when using Photon Cloud?
↧
User ID Not Set
We are setting up PhotonServer locally but can only connect and join a room once (one player). Any secondary attempts throw the following error:
Operation failed: OperationResponse 226: ReturnCode: -2 (Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.)
From what I've read, this is a known issue since last year, and the suggestions have been to send a UserID from the client by setting it before connecting. This shouldn't be a problem because we authenticate users elsewhere and already have unique identifiers we can use. The question is WHERE do we set the UserID needed by Photon? What is the syntax? What class or property is accessed? I can find no documentation that works.
↧
How to maintain player connections.
Hello. I have a question. I want to maintain a list of connections for all players. I might add, remove, or retrieve a player's connection to this list. For example, when a player goes online, I need to add his connection to the list, and when the player drops, I need to remove the connection. Can you give me a suggestion on what data structures to use to maintain this list. List or Dictionary. Do I need to focus on multithreaded access. Do I need to use thread locks.
↧