Beispiel #1
0
    public void DoRequest(Operation.OperationCode opCode, byte[] bytes)
    {
        Dictionary <byte, object> customParameters = new Dictionary <byte, object>();

        customParameters[0] = bytes;
        PhotonEngine.Instance.Peer.OpCustom((byte)opCode, customParameters, true);
    }
Beispiel #2
0
    public void DoRequest <T>(Operation.OperationCode opCode, T obj)
    {
        byte[] data = PackageHelper.Serialize <T>(obj);

        Dictionary <byte, object> customParameters = new Dictionary <byte, object>();

        customParameters[0] = data;
        PhotonEngine.Instance.Peer.OpCustom((byte)opCode, customParameters, true);
    }
Beispiel #3
0
        public BaseHandler GetHandler(Operation.OperationCode opCode)
        {
            BaseHandler handler;

            if (!handlers.TryGetValue(opCode, out handler))
            {
                return(null);
            }
            return(handler);
        }
Beispiel #4
0
        public void SendEvent <T>(Operation.OperationCode opCode, T obj)
        {
            EventData data = new EventData();

            data.Code = (byte)opCode;

            byte[] bytes = PackageHelper.Serialize <T>(obj);

            Dictionary <byte, object> paramter = new Dictionary <byte, object>();

            paramter.Add(0, bytes);
            data.Parameters = paramter;
            SendEvent(data, new SendParameters());
        }
Beispiel #5
0
 private void UnregistRequest(Operation.OperationCode opCode)
 {
     handlers.Remove(opCode);
 }
Beispiel #6
0
 public void UnregisterHandler(Operation.OperationCode opCode)
 {
     handlers.Remove(opCode);
 }