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

How can I check connecting client on correctness?

$
0
0
Hi,

I have photon server on my self-hosted server. I try to make some "protection" from clients who are trying to connect to my server from different client.

For example: I have "Game 1" (right) and "Game 2" (bad). All operations have to work only from client "Game 1". If someone connect from "Game 2" (and join the same room) this will break all operations in "Game 1" and create a lot of exceptions.



I checked this: I started my own game (connected and joined in room) after I started game from PUN examples and joined the same room and got a lot of exceptions. (In my game all rooms have to be with property Visible = true, so don't want to hide rooms, I want to don't let client with "Game 2" do smth on my photon server)

How can I mind "Game 2" connect and join rooms on my server? Mb using unique id of game or smth like that:
if (ConnectedClientGameId != TrueGameId)
{
Kick(client);
}
Or mb I can set some property inside room to clients which doesn't know this property couldn't join this room.

But I think that the best solution - just kick from server any clients who connected from different game.

Thanks

Viewing all articles
Browse latest Browse all 1557

Trending Articles