Custom Event/Operation

zoultrex
zoultrex
edited November 2010 in Photon Server
I made an event/operation called collision
Its a duplicate of Move event/operation with reduced variables and different names.
The client sends the operation to the server just fine, the server receives the operation also fine.
I have 2 classes on the server, CollisionEvent.cs and CollisionOperation.cs, they are working just fine and they carry the variables on the server no problem.
On the MmoActor file I have set up the case:
   case OperationCode.CollisionOperation:
   {
      return this.OperationCollision(peer, operationRequest);
   }
And both:
private OperationResponse ItemOperationCollision
and
public OperationResponse OperationCollision
are being called correctly because I have logs everywhere =)

My problem is that this is never broadcasted back to the client, on the file WorldEntered my Handle never gets called, as I wasnt sure of which name to give I wrote both possibilities
HandleEventCollision
and
HandleEventCollisionEvent
But those never get called.

This is like one of those times that I frustrate myself for hours trying to remember what I am forgetting :(

Comments

  • The client that sends the operation to the server doesnt receive any warning or error or not even a call back from the server, but the other clients connected to the server receives a very strange warning:
    2f0f4478-bde2-4073-8ef6-45798a45346b: received callback QueueOutgoingAcksWarning
    
    Unity: unexpected return QueueOutgoingAcksWarning
    
    the code: 2f0f4478-bde2-4073-8ef6-45798a45346b being the unique id of the item that raised the event.
  • Found the problem...

    In the file WorldEntered there is a function with a switch...
            public void OnEventReceive(Game game, EventCode eventCode, Hashtable eventData)
            {
                switch (eventCode)
                {
    

    I forgot to add my new event in the end of this switch...
                    case EventCode.Collision:
                        {
                            HandleEventCollision(game, eventData);
                            return;
                        }