I've asked this question on official Photon Server forums, but it's less active than this website, so there might be people who understand what I'm talking about, so please, if you have time and knowledge, share it. Thank you!
Here to comes...
So, I've got a really good working prototype of a server on Photon and a basic Unity3D client that talks to the Server. It was built from the examples on cjrgaming.
The client can: Connect, send request, establish and send encrypted request The server can: Create peer, receive operation request, send operation response or event to the client, as well, my small addition was: If a game has a lot of operations, you don't have to use a huge switch case statement, but rather, I have divided operations into categories (Classes) and I invoke them by using delegates and dictionary.
I will post a working examples of it when I feel like it's ready to be posted, but now, to my actual question.. (Sorry for the long post, I had to explain what I know and what I have so far):
What is actually an operation sent from client to the server? Or an Event raised by the server to client (all clients at once?)?
At first, I was thinking that each operation is particular user flow in the game. For example, operation code "1", means a Player X wants to shoot Player Y, do something. But then, I realized, that you cannot put all your game logic in only 255 operations, as per byte limit, without extending it to short int or something.
Then I found out that there's a channelID as well, which can be different on the same operation code request... which means for me, an operation code is not a user flow, but a data stream of the same/similar actions between client and server, and the channelID can be used to differentiate between requested operations to be calculated on the server.
Then...! I realized (oh dummy me), that there's parameters sent from client to server and vise versa in a dictionary, which adds another layer of possible user flows.
So.. now I suppose to understand things, but they just confused me even more.
Can anyone briefly explain the purpose of operation/event/channelID? For example, if you do a small multiplayer game, what you will use to make user (game) flows, like -> A Player hitting a target, player picks up an item in the world, player sends message. Would you use unique operation code for each of this flows, or you group your operations by meaning and use channels to differentiate between requests, or even here, you use same channelID for many user flows and differ them with some ID inside parameters?
Hope I made any sense.
Thanks a lot guys, for time, at least, for help if any!