How can I handle custom operation after joining room?

I wrote custom operation handler and set it in MasterClientPeer, and the client sends and receives a custom operation through LoadBalancingClient.LoadBalancingPeer.SendOperation function. This worked fine.

However, when calling the same function after joining a room, I got the following error. (my custom op code is 100)

'Got DisconnectMessage. Code: -37 Msg: "OpCode_100 is blocked". Debug Info: {}'

I think I need to write the logic in a different way after connecting to the game server, but I don't know what to do specifically.


  • hi, @gravity_jinung

    you added your handler on MasterServer in MasterClientPeer but you join games on GameServer. so, you have to update GameClientPeer to handle this operation

    also you have to update setup for InboundController, so that it accepts your operation. You can do it in GameApplication.GetInboundController.

    you also need to update Operations.OperationCode.LoadBalancingMin constant to increase range of allowed operations.



  • thanks to chvetsov

    I updated the settings for the InboundController and verified that HivePeer accepts my custom operation. I can now handle it.😄

    But I still don't know what OperationCode.LoadBalancingMin does. I haven't modified this value yet, but it seems to be fine. To solve a potential problem, I would like to know more precisely what this code means.


  • @gravity_jinung

    OperationCode.LoadBalancingMin and OperationCode.LoadBalancingMax define range of operations that we accept. if flag 'blockNonRegisteredOps' is set to 'true', InboundController will block non registered operations