예제 #1
0
파일: RPCData.cs 프로젝트: chartly/flood
 public RPCData(RPCPeer peer, RPCManager rpcManager, Serializer serializer)
 {
     Serializer = serializer;
     Peer = peer;
     RPCManager = rpcManager;
     Header = new RPCDataHeader(Serializer);
     Flags = RPCFlags.None;
 }
예제 #2
0
파일: RPCData.cs 프로젝트: chartly/flood
 public RPCData(RPCPeer peer, RPCManager rpcManager, int localId, int remoteId, RPCDataType type, RPCFlags flags = RPCFlags.None)
     : this(peer, rpcManager)
 {
     Flags = flags;
     Header.CallType = type;
     Header.RemoteId = remoteId;
     Header.LocalId = localId;
     Header.Write();
 }
예제 #3
0
 private static PacketFlags ConvertFlags(RPCFlags flags)
 {
     switch (flags)
     {
         case RPCFlags.None:
             return 0;
         case RPCFlags.Encrypted:
             return PacketFlags.Encrypted;
         case RPCFlags.Signed:
             return PacketFlags.Signed;
         case RPCFlags.Compressed:
             return PacketFlags.Compressed;
         default:
             throw new NotImplementedException();
     }
 }
예제 #4
0
        private static PacketFlags ConvertFlags(RPCFlags flags)
        {
            switch (flags)
            {
            case RPCFlags.None:
                return(0);

            case RPCFlags.Encrypted:
                return(PacketFlags.Encrypted);

            case RPCFlags.Signed:
                return(PacketFlags.Signed);

            case RPCFlags.Compressed:
                return(PacketFlags.Compressed);

            default:
                throw new NotImplementedException();
            }
        }
예제 #5
0
파일: RPCData.cs 프로젝트: chartly/flood
 public RPCData(RPCData call, RPCDataType type, RPCFlags flags = RPCFlags.None)
     : this(call.Peer, call.RPCManager ,call.Header.LocalId, call.Header.RemoteId, type, flags)
 {
 }
예제 #6
0
        public static RPCData Create(RPCPeer peer, int localId, int remoteId, RPCDataType type, RPCFlags flags = RPCFlags.None)
        {
            var data = new RPCData(peer);

            data.Peer            = peer;
            data.Flags           = flags;
            data.Header.CallType = type;
            data.Header.RemoteId = remoteId;
            data.Header.LocalId  = localId;
            data.Header.Write();

            return(data);
        }
예제 #7
0
 public static RPCData Create(RPCProxy proxy, RPCDataType type, RPCFlags flags = RPCFlags.None)
 {
     return(Create(proxy.Peer, proxy.Id, proxy.RemoteId, type, flags));
 }
예제 #8
0
 public static RPCData Create(RPCData call, RPCDataType type, RPCFlags flags = RPCFlags.None)
 {
     return(Create(call.Peer, call.Header.LocalId, call.Header.RemoteId, type, flags));
 }