public RPCData(RPCPeer peer, RPCManager rpcManager, Serializer serializer) { Serializer = serializer; Peer = peer; RPCManager = rpcManager; Header = new RPCDataHeader(Serializer); Flags = RPCFlags.None; }
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(); }
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(); } }
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(); } }
public RPCData(RPCData call, RPCDataType type, RPCFlags flags = RPCFlags.None) : this(call.Peer, call.RPCManager ,call.Header.LocalId, call.Header.RemoteId, type, flags) { }
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); }
public static RPCData Create(RPCProxy proxy, RPCDataType type, RPCFlags flags = RPCFlags.None) { return(Create(proxy.Peer, proxy.Id, proxy.RemoteId, type, flags)); }
public static RPCData Create(RPCData call, RPCDataType type, RPCFlags flags = RPCFlags.None) { return(Create(call.Peer, call.Header.LocalId, call.Header.RemoteId, type, flags)); }