protected override void InitializeRemoteProcedures() { LogInError = DefineRemoteProcedure(); SendOnlineUsers = DefineRemoteProcedure(IEnumerableReliableBitConverter.GetInstance(StringBitConverter.ASCIIReliableInstance)); SendSoundBytes = DefineRemoteProcedure(ReliableBitConverter.GetInstance(IEnumerableVariableLengthBitConverter.GetInstance(ByteBitConverter.Instance))); SendRequestToEntryConference = DefineRemoteProcedure(Int32BitConverter.Instance, StringBitConverter.ASCIIReliableInstance, IEnumerableReliableBitConverter.GetInstance(StringBitConverter.ASCIIReliableInstance)); SendRequestToCreateConference = DefineRemoteProcedure(Int32BitConverter.Instance, StringBitConverter.ASCIIReliableInstance, IEnumerableReliableBitConverter.GetInstance(StringBitConverter.ASCIIReliableInstance)); SendUpdatedConferenceUsers = DefineRemoteProcedure(IEnumerableReliableBitConverter.GetInstance(StringBitConverter.ASCIIReliableInstance)); }
public int Add(int a, int b) { var servers = _discovery.GetInstances <T>(); //服务发现 var server = _selector.Select(servers); //负载均衡 var desc = new RemoteProcedure(_version, typeof(ICalculator), _addMethodInfo); //rpc描述 return((int)_caller.Call(server, desc, new IProcedureParameter[] { new ProcedureParameter(nameof(a), a), new ProcedureParameter(nameof(b), b) })); //rpc调用 }
protected override void InitializeRemoteProcedures() { ReliableBitConverter<IEnumerable<int>> iEnumerableBacteriumId = ReliableBitConverter.GetInstance(IEnumerableVariableLengthBitConverter.GetInstance(Int32BitConverter.Instance)); SignUp = DefineRemoteProcedure(StringBitConverter.UnicodeReliableInstance, StringBitConverter.UnicodeReliableInstance, StringBitConverter.UnicodeReliableInstance); LogIn = DefineRemoteProcedure(StringBitConverter.UnicodeReliableInstance, StringBitConverter.UnicodeReliableInstance); IsEmailExists = DefineRemoteProcedure(StringBitConverter.UnicodeReliableInstance); IsNicknameExists = DefineRemoteProcedure(StringBitConverter.UnicodeReliableInstance); GetOtherAccount = DefineRemoteProcedure(Int32BitConverter.Instance); FindGame = DefineRemoteProcedure(); RequestSendViruses = DefineRemoteProcedure(iEnumerableBacteriumId, Int32BitConverter.Instance); }
public void NativeUpdateSchedule() { UpdateSharedData.Instance.Processor = this; NoUpdateFinalProcedure noUpdateFinalProcedure = new NoUpdateFinalProcedure(); NativeDownloadProcedure nativeDownloadProcedure = new NativeDownloadProcedure(); AnalyzeCatalogProcedure analyzeCatalogProcedure = new AnalyzeCatalogProcedure(nativeDownloadProcedure); DownloadCatalogProcedure downloadCatalogProcedure = new DownloadCatalogProcedure(analyzeCatalogProcedure); ConfirmDownloadProcedure confirmDownloadProcedure = new ConfirmDownloadProcedure(downloadCatalogProcedure, noUpdateFinalProcedure); RemoteProcedure remoteProcedure = new RemoteProcedure(confirmDownloadProcedure); LocalProcedure localProcedure = new LocalProcedure(remoteProcedure); localProcedure.StartProcedure(); }
public void AllUpdateSchedule() { UpdateSharedData.Instance.Processor = this; NoUpdateFinalProcedure noUpdateFinalProcedure = new NoUpdateFinalProcedure(); DownloadAssetsProcedure downloadAssetsProcedure = new DownloadAssetsProcedure(); AnalyzeCatalogProcedure analyzeCatalogProcedure = new AnalyzeCatalogProcedure(downloadAssetsProcedure); DownloadCatalogProcedure downloadCatalogProcedure = new DownloadCatalogProcedure(analyzeCatalogProcedure); ConfirmDownloadProcedure confirmDownloadProcedure = new ConfirmDownloadProcedure(downloadCatalogProcedure, noUpdateFinalProcedure); RemoteProcedure remoteProcedure = new RemoteProcedure(confirmDownloadProcedure); LocalProcedure localProcedure = new LocalProcedure(remoteProcedure); UnzipProcedure unzipProcedure = new UnzipProcedure(localProcedure); DownloadPackageProcedure downloadPackageProcedure = new DownloadPackageProcedure(unzipProcedure); downloadPackageProcedure.StartProcedure(); }