Exemple #1
0
        public void DoRequest <T>(Operation.S2SOperationCode opCode, T obj)
        {
            byte[] data = PackageHelper.Serialize <T>(obj);

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

            customParameters[0] = data;

            SendOperationRequest(new OperationRequest {
                OperationCode = (byte)opCode, Parameters = customParameters
            }, new SendParameters());
        }
Exemple #2
0
        public void SendEvent <T>(Operation.S2SOperationCode 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());
        }