public Rede(string ip, int porta, TextBox log, int Senha) { Rep = new REP(); this.IP = ip; this.Porta = porta; this.Log = log; this.Senha = Senha; }
private void frmExemplo_Load(object sender, EventArgs e) { //Instanciar o objeto. _REP = new REP(); CarregarComboSetConfig(); CarregarComboGetConfig(); cboTipoDoc.SelectedIndex = 0; cboTipoDoc_SelectedIndexChanged(cboTipoDoc, new EventArgs()); }
public void DTUltimaColeta(int IDREP, DateTime dtultimaColeta) { REP rep = new REP(); try { rep.CadastraUltimaColetaUsuario(IDREP, dtultimaColeta, dtultimaColeta.ToShortDateString()); } catch (Exception ex) { ex.ToString(); } }
public DateTime UltimaColetaREP(int IDREP) { DataSetREP dsR = new DataSetREP(); REP rep = new REP(); DateTime DD = new DateTime(1900, 01, 01); try { DD = rep.UltimaColetaREP(dsR, IDREP); } finally { } return(DD); }
private static void PullRepBroker() { var tasksToSend = new List <CommonRequest>(); var responsesToClient = new List <CommonReply>(); Pull <CommonRequest> pull = null; REP <CommonRequest, CommonReply> rep = null; var processClientRequest = new Func <CommonRequest, bool>(r => { Console.WriteLine("[x] Received request {0} from {1} ", r.RequestId, r.ClientId.ToString().Substring(30)); tasksToSend.Add(r); rep.AddTask(r); return(true); }); var fromClientTask = Task.Factory.StartNew(() => { pull = new Pull <CommonRequest>("tcp://127.0.0.1:5001", processClientRequest); pull.Start(); }); var processWorkerResponse = new Func <CommonReply, bool>(r => { Console.WriteLine("[x] Received reply {0} to {1} ", r.ReplyId, r.ClientId.ToString().Substring(30)); if (r.ClientId != default(Guid)) { responsesToClient.Add(r); } // TODO: Send response to client return(true); }); var toWorkerTask = Task.Factory.StartNew(() => { rep = new REP <CommonRequest, CommonReply>("tcp://127.0.0.1:5000", processWorkerResponse); rep.Start(); }); Task.WaitAll(fromClientTask, toWorkerTask); }
public bool CadUltimaRefREP(int IDEmpresa, int IDUsuario, string RefREP, string TokenAcesso, int IDREP) { if (TokenAcesso == "TentoWebServiceNovamente7x24dm12") { Cadastro Cad = new Cadastro(); REP rep = new REP(); try { RetCadREP = Cad.AlteraReferenciaREP(IDEmpresa, IDUsuario, RefREP); rep.CadastraRelacaoREPUsuario(IDUsuario, IDREP, IDEmpresa); } finally { RetCadREP = false; } } return(RetCadREP); }
public DataSetREP REPEmpresa(int IDEmpresa, string TokenAcesso) { DataSetREP dsR = new DataSetREP(); REP rep = new REP(); if (TokenAcesso == "TentoWebServiceNovamente7x24dm12") { PreencheTabela PT = new PreencheTabela(); try { rep.PreencheTBREPEmpresa(dsR, IDEmpresa); } finally { } } return(dsR); }
protected override void Shutdown() { try { lib.gameStatus = 0; if (lib.status == 0) { Utility.WindowText("Asheron's Call"); } else if (lib.Autorelog == false) { Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt")); if (lib.UseMacroLogic == true && lib.reason != "user") { Utility.ActivateWindow(); } } else if (lib.Autorelog == true && lib.longcycle == false) { Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt") + ". Relogger is set to " + lib.Timer + " seconds. Counter: " + lib.relogcounter); if (lib.UseMacroLogic == true) { Utility.ActivateWindow(); } } else if (lib.Autorelog == true && lib.longcycle == true) { Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt") + ". Relogger is on Long Cycle (10 minutes)."); lib.longcycle = false; if (lib.UseMacroLogic == true) { Utility.ActivateWindow(); } } lib.MyCore.CharacterFilter.Login -= Core_Login_Init; if (lib.AuthInstance > 0) { ATH.Dispose(); } if (lib.CommandsInstance > 0) { CMD.Dispose(); } if (lib.LoggingInstance > 0) { LGM.Dispose(); } if (lib.ViewControlInstance > 0) { VCT.Dispose(); } if (lib.ScannerInstance > 0) { SCN.Dispose(); } if (lib.DeathParseInstance > 0) { DTH.Dispose(); } if (lib.SoundInstance > 0) { SND.Dispose(); } if (lib.MacroInstance > 0) { MCL.Dispose(); } if (lib.VersInstance > 0) { VSC.Dispose(); } if (lib.HUDInstance > 0) { HUD.Dispose(); } if (lib.ReportInstance > 0) { REP.Dispose(); } if (SCN != null) { SCN = null; } if (SND != null) { SND = null; } if (ATH != null) { ATH = null; } if (VCT != null) { VCT = null; } if (DTH != null) { DTH = null; } if (CMD != null) { CMD = null; } if (VSC != null) { VSC = null; } if (LGM != null) { LGM = null; } if (MCL != null) { MCL = null; } if (HUD != null) { HUD = null; } if (REP != null) { REP = null; } if (ShrtTmr.Enabled == true) { ShrtTmr.Stop(); ShrtTmr.Dispose(); } if (LngTmr.Enabled == true) { LngTmr.Stop(); LngTmr.Dispose(); } if (LogTmr.Enabled == true) { LogTmr.Stop(); LogTmr.Dispose(); } PGCore = null; lib.PluginInstance--; lib.Dispose(); } catch (Exception ex) { Repo.RecordException(ex); } }
public void Core_Login_Retry() { try { if (lib.PluginInstance == 1) { if (lib.DFTEXT != null) { lib.DFTEXT.Dispose(); lib.DFTEXT = null; } if (lib.DF2TEXT != null) { lib.DF2TEXT.Dispose(); lib.DF2TEXT = null; } if (lib.AuthInstance > 0) { ATH.Dispose(); } if (lib.CommandsInstance > 0) { CMD.Dispose(); } if (lib.LoggingInstance > 0) { LGM.Dispose(); } if (lib.ViewControlInstance > 0) { VCT.Dispose(); } if (lib.ScannerInstance > 0) { SCN.Dispose(); } if (lib.DeathParseInstance > 0) { DTH.Dispose(); } if (lib.SoundInstance > 0) { SND.Dispose(); } if (lib.MacroInstance > 0) { MCL.Dispose(); } if (lib.VersInstance > 0) { VSC.Dispose(); } if (lib.HUDInstance > 0) { HUD.Dispose(); } if (lib.ReportInstance > 0) { REP.Dispose(); } if (SCN != null) { SCN = null; } if (SND != null) { SND = null; } if (ATH != null) { ATH = null; } if (VCT != null) { VCT = null; } if (DTH != null) { DTH = null; } if (CMD != null) { CMD = null; } if (VSC != null) { VSC = null; } if (LGM != null) { LGM = null; } if (MCL != null) { MCL = null; } if (HUD != null) { HUD = null; } if (REP != null) { REP = null; } CMD = new Commands(); CMD.InitCommands(PGCore); Core_Login_Check(); } } catch (Exception ex) { Repo.RecordException(ex); } }
public override bool Connect(int Terminal) { Rep = new REP(); return(true); }
public void Start(Func <DataRequest, DataReply> handleAction) { _req = new REP <DataRequest, DataReply>("tcp://127.0.0.1:5050", handleAction); _req.Start(); }