Flags in Operation subclass

edited May 2011 in Photon Server
Hi everyone!
It is description of Operation class:
public class Operation
     Member of Photon.SocketServer.Rpc

This class is a common base class for operations THAT HAVE PROPERTIES FLAGGED WITH the Photon.SocketServer.Rpc.RequestParameterAttribute.

I raised two questions:
1 ) Operation Move properties flaged:
         [RequestParameter (Code = (short) ParameterCode.ItemId, IsOptional = true)]
         [ResponseParameter (Code = (short) ParameterCode.ItemId)]
                   public string ItemId {get; set;}
Why use the flags and how to use them? For example, if I Uberall flags of the Position property, then the object on Island Demo stops moving...
2 ) Do I understand correctly:
to handle the operation Move ( for example, to save its position on the server ), I need to add a Case for OperationCode.Move in MmoPeer.OnOperationRequest ()?
3) Where defined max number of threads for thread pool (NumberOfConcurrentThreads) in engine of Photon for IOCP (can I change this?) and how many of them now?
ps: Sorry if 've made mistakes, my english bit weak :)


  • Boris
    Boris ✭✭
    1) when an operation request arrives the parameters are just objects in a dictionary. Using the Operation base class is a comfortable way to convert the dictionary to a class with properties that have a strong type. The attributes tell us which dictionary entry goes where.
    2) more or less correct. MmoPeer handles operation requests before operation EnterWorld. It then switches the operation handler to MmoActor. This is where Move is dispatched.
    3) the threads in the config file are just the number of threads that feed operations to your .Net code. The peer base class queues all requests to it's request fiber and from that moment on the normal .net threadpool is used so you don't really have to worry about it. .net threadpool size can be configured with the ThreadPool class, properties MinThreads, MaxThreads etc. Per default it's 25 threads per CPU core.
  • Thanks!