The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Any way to disable CloseConnection for master

2018-08-07 23:10:42

The issue I have is a hacked client is able to kick all the player out of the room.
I haven't found any way to prevent this or disable the functionality for the room.
Any help would be appreciated.


2018-08-08 09:48:48

Hi @sunstar3d,

Thank you for choosing Photon!

There is no way to disable it without changing client code.
So I suggest you comment out or delete all code related to CloseConnection, change GameVersion / AppVersion and then release a new client update preferably force updates if you have that feature.

2018-08-08 18:46:20

Hi John,
Thank you for responding. My issue is the client is hacked to send the OpRaiseEvent(PunEvent.CloseConnection... My client doesn't ever call anything related to close connection. My concern is any hacker can just send the low level OpRaiseEvent and the server will just kick
Whoever the hacker wants out. Nothing I do on the client side can prevent that if the server allows it.

[Deleted User]
2018-08-09 09:29:58

Hi @sunstar3d,

as @JohnTube already mentioned you can comment out all code related to the CloseConnection feature. This includes the handling of this certain event as well and is the most important part. Please have a look at the OnEvent function inside the NetworkingPeer class. In this function is a switch condition with a PunEvent.CloseConnection case. You can either remove or comment out the entire case or the code inside this case. This will remove the part of the CloseConnection feature, which is causing trouble in your specific case.

2018-08-09 18:23:51

Hi Christian

I will strip it of anything related to close connection. My concern is the hacker doesn't need to be using those functions and can just create the low level packet data itself and send it. Seems like a function to disable kick functionality from the server for this room would be the proper way to solve this. Seems like a big security hole where any player can take control of master and send closeconnection. This can be done to every app running on photon public cloud.

[Deleted User]
2018-08-14 08:45:30

If you remove the related lines of code from the OnEvent handler, nothing will happen, if a client receives a PunEvent.CloseConnection event. You can have a look at this yourself: whenever a client receives an event, NetworkingPeer.OnEvent is called. Each default (or build-in) event is already implemented and gets processed if necessary. If you now remove a certain event case from the OnEvent handler, this event simply won't work anymore.

Seems like a function to disable kick functionality from the server for this room would be the proper way to solve this.

Since there is no possibility to kick a client server-side (at least not for this case), the idea behind CloseConnection is, to make a client call PhotonNetwork.LeaveRoom(false);. So you basically ask him to leave the room on his own and don't become inactive. In this case the server just forwards this certain message to the certain player (the one who should be removed from the game).

Back to top