Creating custom operations

Hi,

I am testing out some code that sends custom operations (using Photon Cloud). I am working on Android (using the NDK library).

Just for the sake of testing, i have send a custom operation with OpCode 180, like this:

opCustom(180, true); // send a reliable message with id 180

I keep getting this error:
07-10 08:55:09.867: I/demo-loadBalancing(3337): 2013-07-10 08:55:09,871048 ERROR LoadBalancingClient.cpp onOperationResponse() line: 306 - OperationResponse - operationCode: 180, returnCode: -2 (Invalid operation code) {}

Can i define custom operations? how do i send custom messages of my own using Photon Cloud?

Comments

  • The Photon Cloud does not know your custom operations.
    You need to download the Photon Server SDK, add your custom operations as needed and host that.
    https://www.exitgames.com/download
  • Thanks. We are going to work with Photon Cloud at this point.
    Does that mean that i can only raise events, and not custom operations?

    What is the real difference between the 2 ?
  • Operations are what's executed on the server. OpRaiseEvent is one of those operations the server offers to forward your data to other players.
    As the Cloud can't run your own code, it can't know what you mean by custom operations.
    Events are fine to send info to others and in reaction to certain events you can call methods on those clients, too.
    In Photon Unity Networking we use Events to send RPCs and call methods by name.
  • Great, thanks !