Where I can put custom operation in LoadBalancing
Options
Hai guys, iam tired for searching where i can put custom operation in loadbalancing ? i already read for add operation documentation in photon but where exactly i must change the code to allow custom operation,
I send OperationRequest like this
client.peer.OpCustom(1, "Hello World", true)
but i get still error
OperationRespone !: ReturnCode: -2 (unknow operation code).parameter{}
can anyone tell me where i can put custom operation in loadbalancing project? Thanks
I send OperationRequest like this
client.peer.OpCustom(1, "Hello World", true)
but i get still error
OperationRespone !: ReturnCode: -2 (unknow operation code).parameter{}
can anyone tell me where i can put custom operation in loadbalancing project? Thanks
0
Best Answer
-
Hi, @doolangames
As you know probably that LoadBalancing has two servers: Master and GameServer. First connection is established to master server. then you create game and client reconnects to game server.
so, if you try to send your custom opertion to server before game creation then you should modify master server code. MasterClientPeer.cs is file where you should take a look for opertion handlers
if you try to send your operation after Game creation then you need to modify GameServer code. Well, this part more comples. You need to add handler to peer and probably also to HiveGame
best,
ilya5
Answers
-
Hi, @doolangames
As you know probably that LoadBalancing has two servers: Master and GameServer. First connection is established to master server. then you create game and client reconnects to game server.
so, if you try to send your custom opertion to server before game creation then you should modify master server code. MasterClientPeer.cs is file where you should take a look for opertion handlers
if you try to send your operation after Game creation then you need to modify GameServer code. Well, this part more comples. You need to add handler to peer and probably also to HiveGame
best,
ilya5 -
Thanks a lot @chvetsov you very helpful0