static int _CreateUtil_Timer(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(float), typeof(float))) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); Util.Timer obj = new Util.Timer(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(float), typeof(bool))) { float arg0 = (float)LuaDLL.luaL_checknumber(L, 1); bool arg1 = LuaDLL.luaL_checkboolean(L, 2); Util.Timer obj = new Util.Timer(arg0, arg1); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Util.Timer.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private IEnumerator StartConnection() { yield return(new WaitForSeconds(0.1f)); int i = 0; ConnectionProgressBar.Progress = 0; ConnectionProgressBar.Caption = "Connecting..."; Util.Timer connClock = new Util.Timer(); _blnIsConnecting = true; Display(true); connClock.StartTimer(); Net.ClientConnect(); while (!Net.IsConnected && connClock.GetTime <= Net.CONNECTION_TIMEOUT) { yield return(null); i++; ConnectionProgressBar.SetProgress(connClock.GetFloatTime, Net.CONNECTION_TIMEOUT); yield return(null); } connClock.StopTimer(); _blnIsConnecting = false; _blnAutoConnect = false; ConnectionProgressBar.Caption = ""; if (!Net.IsConnected && connClock.GetFloatTime > Net.CONNECTION_TIMEOUT) { Display(); } connClock = null; }
static int OnCompleteCallback(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Util.Timer obj = (Util.Timer)ToLua.CheckObject(L, 1, typeof(Util.Timer)); System.Action arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (System.Action)ToLua.CheckObject(L, 2, typeof(System.Action)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(System.Action), func) as System.Action; } Util.Timer o = obj.OnCompleteCallback(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_KillDo(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Util.Timer obj = (Util.Timer)o; System.Action arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (System.Action)ToLua.CheckObject(L, 2, typeof(System.Action)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(System.Action), func) as System.Action; } obj.KillDo = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index KillDo on a nil value" : e.Message)); } }
private IEnumerator DoStart() { yield return(new WaitForSeconds(1.0f)); if (!_blnLoadAllAtStart) { _blnInitialized = true; yield break; } Util.Timer clock = new Util.Timer(); clock.StartTimer(); int i = 0; while (!Database.IsConnected && clock.GetTime < 10) { i++; yield return(null); } clock.StopTimer(); if (clock.GetTime > 10) { // DO NOTHING } else if (Database.IsConnectedCheck) { LoadAll(false); } clock = null; _blnInitialized = true; }
// stored procedures public IEnumerator GetIDBSPstring(string strSP, string strParamList = "") // PIPE ("|") SEPARATED STRING { bool blnDone = false; _blnProcessing = true; Util.Timer clock = new Util.Timer(); _strDBresponse = ""; // split parameter list string on pipe character string[] strParams = strParamList.Split('|'); // open the connection to the database if (DAL.IsConnected) { // add the parameters DAL.ClearParams(); foreach (string st in strParams) { DAL.AddParam(st.Split('=')[0], st.Split('=')[1]); } // make the stored procedure call _strDBresponse = DAL.GetSPString(strSP); clock.StartTimer(); // wait for the response while (!blnDone && clock.GetTime < QUERY_TIMEOUT) { blnDone = (_strDBresponse != ""); yield return(null); } // dispose of timeout timer clock.StopTimer(); clock = null; // if no results returned on time, send back empty if (!blnDone) { _strDBresponse = ""; } // return value _blnProcessing = false; yield return(_strDBresponse); } else { #if is_debugging #if uses_applicationmanager App.AddToDebugLog("Database not connected"); App.AddToDebugLog("Queries:\n" + DAL.SQLqueries); App.AddToDebugLog("Errors:\n" + DAL.Errors); #endif #endif _strDBresponse = ""; } _blnProcessing = false; }
// STORED PROCEDURES public IEnumerator GetIDBSPstring(string strSP, string strParamList = "") // PIPE ("|") SEPARATED STRING { bool blnDone = false; _blnProcessing = true; Util.Timer clock = new Util.Timer(); _strDBresponse = ""; // SPLIT PARAMETER LIST STRING ON PIPE CHARACTER string[] strParams = strParamList.Split('|'); // OPEN THE CONNECTION TO THE DATABASE if (DAL.IsConnected) { // ADD THE PARAMETERS DAL.ClearParams(); foreach (string st in strParams) { DAL.AddParam(st.Split('=')[0], st.Split('=')[1]); } // MAKE THE STORED PROCEDURE CALL _strDBresponse = DAL.GetSPString(strSP); clock.StartTimer(); // WAIT FOR THE RESPONSE while (!blnDone && clock.GetTime < QUERY_TIMEOUT) { blnDone = (_strDBresponse != ""); yield return(null); } // DISPOSE OF TIMEOUT TIMER clock.StopTimer(); clock = null; // IF NO RESULTS RETURNED ON TIME, SEND BACK EMPTY if (!blnDone) { _strDBresponse = ""; } // RETURN VALUE _blnProcessing = false; yield return(_strDBresponse); } else { #if IS_DEBUGGING #if USES_APPLICATIONMANAGER App.AddToDebugLog("Database not connected"); App.AddToDebugLog("Queries:\n" + DAL.SQLqueries); App.AddToDebugLog("Errors:\n" + DAL.Errors); #endif #endif _strDBresponse = ""; } _blnProcessing = false; }
public Attacker() { m_timer = new Util.Timer(500, true); m_timer.Execute += m_timer_Execute; NonLootAbleCreatures = new List <string>(); NonLootAbleCreatures.Add("Snake"); NonLootAbleCreatures.Add("Slime"); }
public Looter() { CorpseList = new List <Corpse>(); timer = new Util.Timer(500, true); Core.client.HookProxy.TileAddThing += HookProxy_TileAddThing; LastCorpeses = new byte[16]; timer.Execute += Timer_Execute; }
public MiniMap1(Client cl) { client = cl; Path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Tibia\\Automap\\"; GridSize = 256;// 256* 256 grid = new MyPathNode[256, 256]; // LoadTibiaMap(); m_walkTimer = new Util.Timer(800, true); m_walkTimer.Execute += m_walkTimer_Execute; }
public IEnumerator GetIDBSQLdataTable(string strSQL) { bool blnDone = false; Util.Timer clock = new Util.Timer(); _strDBresponse = ""; _blnProcessing = true; _dtDBresponse = null; // OPEN THE CONNECTION TO THE DATABASE if (DAL.IsConnected) { DAL.ClearParams(); // MAKE THE SQL CALL _dtDBresponse = DAL.GetSQLSelectDataTable(strSQL); clock.StartTimer(); // WAIT FOR THE RESPONSE while (!blnDone && clock.GetTime < QUERY_TIMEOUT) { blnDone = (_dtDBresponse != null); yield return(null); } // DISPOSE OF TIMEOUT TIMER clock.StopTimer(); clock = null; // IF NO RESULTS RETURNED ON TIME, SEND BACK EMPTY if (!blnDone) { _dtDBresponse = null; } // TURN OFF PROCESSING FLAG _blnProcessing = false; // RETURN VALUE yield return(_dtDBresponse); } else { #if IS_DEBUGGING #if USES_APPLICATIONMANAGER App.AddToDebugLog("Database not connected"); App.AddToDebugLog("Queries:\n" + DAL.SQLqueries); App.AddToDebugLog("Errors:\n" + DAL.Errors); #endif #endif _strDBresponse = ""; _dtDBresponse = null; } _blnProcessing = false; }
public IEnumerator GetIDBSPdataTable(string strSP, string[] strParamList = null) { bool blnDone = false; _blnProcessing = true; Util.Timer clock = new Util.Timer(); _strDBresponse = ""; _dtDBresponse = null; // open the connection to the database if (DAL.IsConnected) { // add the parameters DAL.ClearParams(); foreach (string st in strParamList) { DAL.AddParam(st.Split('=')[0], st.Split('=')[1]); } // make the stored procedure call _dtDBresponse = DAL.GetSPDataTable(strSP); clock.StartTimer(); // wait for the response while (!blnDone && clock.GetTime < QUERY_TIMEOUT) { blnDone = (_dtDBresponse != null); yield return(null); } // dispose of timeout timer clock.StopTimer(); clock = null; // if no results returned on time, send back empty if (!blnDone) { _dtDBresponse = null; } // return value _blnProcessing = false; yield return(_dtDBresponse); } else { Debug.Log("Database not connected"); Debug.Log("Queries:\n" + DAL.SQLqueries); Debug.Log("Errors:\n" + DAL.Errors); _strDBresponse = ""; _dtDBresponse = null; } _blnProcessing = false; }
public AddWaypoint(KonjoBot.Objects.Bot.Waypoint w = null,int index = 0) { InitializeComponent(); m_timer = new Util.Timer(300, true); ComboBox1.SelectedIndex = 0; ComboBox2.SelectedIndex = 0; if (w != null) { IsEdit = true; Editindex = index; TextBox1.Text = Convert.ToString(w.Location.X); TextBox2.Text = Convert.ToString(w.Location.Y); TextBox3.Text = Convert.ToString(w.Location.Z); TextBox4.Text = w.Comment; FastColoredTextBox1.Text = w.Script; switch (w.Type) { case Constants.WaypointType.Walk: ComboBox1.SelectedIndex = 0; break; case Constants.WaypointType.Rope: ComboBox1.SelectedIndex = 2; break; case Constants.WaypointType.Shovel: ComboBox1.SelectedIndex = 1; break; case Constants.WaypointType.UpUse: ComboBox1.SelectedIndex = 3; break; case Constants.WaypointType.DownUse: ComboBox1.SelectedIndex = 4; break; case Constants.WaypointType.Door: ComboBox1.SelectedIndex = 5; break; } } else { this.TopMost = true; Core.client.Window.Activate(); m_timer.Execute += m_timer_Execute; } /* FastColoredTextBox1.ClearStylesBuffer(); FastColoredTextBox1.AddStyle(SameWordsStyle); */ }
public IEnumerator GetIDBSQLdataTable(string strSQL) { bool blnDone = false; Util.Timer clock = new Util.Timer(); _strDBresponse = ""; _blnProcessing = true; _dtDBresponse = null; // open the connection to the database if (DAL.IsConnected) { DAL.ClearParams(); // make the sql call _dtDBresponse = DAL.GetSQLSelectDataTable(strSQL); clock.StartTimer(); // wait for the response while (!blnDone && clock.GetTime < QUERY_TIMEOUT) { blnDone = (_dtDBresponse != null); yield return(null); } // dispose of timeout timer clock.StopTimer(); clock = null; // if no results returned on time, send back empty if (!blnDone) { _dtDBresponse = null; } // turn off processing flag _blnProcessing = false; // return value yield return(_dtDBresponse); } else { Debug.Log("Database not connected"); Debug.Log("Queries:\n" + DAL.SQLqueries); Debug.Log("Errors:\n" + DAL.Errors); _strDBresponse = ""; _dtDBresponse = null; } _blnProcessing = false; }
static int GoOn(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); Util.Timer obj = (Util.Timer)ToLua.CheckObject(L, 1, typeof(Util.Timer)); obj.GoOn(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public Alarms() { InitializeComponent(); checkBox1.Checked = Core.Global.PlayerOnScreen; checkBox2.Checked = Core.Global.Message; checkBox3.Checked = Core.Global.PrivateMessage; checkBox4.Checked = Core.Global.lowHp; checkBox5.Checked = Core.Global.LowMana; numericUpDown1.Value = Core.Global.lowHpValue; numericUpDown2.Value = Core.Global.LowManavalue; m_timer = new Util.Timer(600, true); m_timer.Execute += m_timer_Execute; }
static int RemoveTimer(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); Util.TimerManager obj = (Util.TimerManager)ToLua.CheckObject(L, 1, typeof(Util.TimerManager)); Util.Timer arg0 = (Util.Timer)ToLua.CheckObject(L, 2, typeof(Util.Timer)); obj.RemoveTimer(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Start(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); Util.Timer obj = (Util.Timer)ToLua.CheckObject(L, 1, typeof(Util.Timer)); Util.Timer o = obj.Start(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_KillDo(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Util.Timer obj = (Util.Timer)o; System.Action ret = obj.KillDo; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index KillDo on a nil value" : e.Message)); } }
// Use this for initialization protected override void Init() { player = PlayerManager.Get().GetPlayer(PlayerIndex); player.PlayerFinishesEvent += new OnPlayerFinishesHandler(OnPlayerFinishes); timerText = GetComponent <GUIText>(); //timerText.enabled = false; playerTimer = new Util.Timer(-1, -1, true); cam = CameraManager.Get().GetCamera(PlayerIndex); if (cam == null) { Debug.LogError("No camera for player " + PlayerIndex + " HUD found!"); return; } base.Init(); }
static int get_IsStop(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Util.Timer obj = (Util.Timer)o; bool ret = obj.IsStop; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index IsStop on a nil value" : e.Message)); } }
static int get_StopTime(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Util.Timer obj = (Util.Timer)o; double ret = obj.StopTime; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index StopTime on a nil value" : e.Message)); } }
static int set_LoopTime(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Util.Timer obj = (Util.Timer)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.LoopTime = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index LoopTime on a nil value" : e.Message)); } }
private static void ComputeBenchmarks(TestSummation.Summation2 sigma) { Util.Timer t = new Util.Timer(false); t.Tick("sigma=" + sigma); double value = sigma.Compute(); t.Tick("compute=" + value); NUnit.Framework.Assert.AreEqual(value, sigma.Compute_modular()); t.Tick("compute_modular"); NUnit.Framework.Assert.AreEqual(value, sigma.Compute_montgomery()); t.Tick("compute_montgomery"); NUnit.Framework.Assert.AreEqual(value, sigma.Compute_montgomery2()); t.Tick("compute_montgomery2"); NUnit.Framework.Assert.AreEqual(value, sigma.Compute_modBigInteger()); t.Tick("compute_modBigInteger"); NUnit.Framework.Assert.AreEqual(value, sigma.Compute_modPow()); t.Tick("compute_modPow"); }
private IEnumerator InitializeDatabase(bool blnReadSettingsFile = true) { // DO NOT RE-INITIALIZE IF ALREADY OPEN if (!_blnInitialized) { // CONNECT TO DATABASE. IF NOT CONNECTED IN TIMEOUT PERIOD, CLOSE APPLICATION Util.Timer clock = new Util.Timer(); OpenDatabase(blnReadSettingsFile); bool blnCont = IsConnected; clock.StartTimer(); while (clock.GetTime < CONNECTION_TIMEOUT && !blnCont) { blnCont = IsConnected; yield return(null); } clock.StopTimer(); clock = null; if (!blnCont) { #if USES_STATUSMANAGER Status.Status = "Unable to Connect to Database."; #endif } else { _blnInitialized = true; } if (!KeepConnectionOpen) { // WAIT FOR THE CONNECTION TO COMPLETE, THEN CLOSE IT yield return(new WaitForSeconds(1.2f)); CloseDatabase(); } } yield return(new WaitForSeconds(1.5f)); #if USES_STATUSMANAGER Status.UpdateStatus(); #endif yield return(null); }
private IEnumerator DoStart() { // WE'RE GOING TO TEST IF WE CAN CONNECT TO THE DATABASE BY OPENING A CONNECTION THEN CLOSE IT int i = 0; Util.Timer clock = new Util.Timer(); clock.StartTimer(); while (!Database.IsConnected && clock.GetTime < 4) { yield return(null); i++; } ResultText = "Database Connected = " + Database.IsConnectedCheck.ToString() + " (After " + clock.GetTime + " seconds, " + i.ToString() + ")"; if (!Database.KeepConnectionOpen) { Database.CloseDatabase(); } clock.StopTimer(); }
/// <summary>main</summary> /// <exception cref="System.IO.IOException"/> public static void Main(string[] args) { Util.Timer t = new Util.Timer(false); ComputePi(t, 0); ComputePi(t, 1); ComputePi(t, 2); ComputePi(t, 3); ComputePi(t, 4); Util.PrintBitSkipped(1008); ComputePi(t, 1008); ComputePi(t, 1012); long b = 10; for (int i = 0; i < 7; i++) { Util.PrintBitSkipped(b); ComputePi(t, b - 4); ComputePi(t, b); ComputePi(t, b + 4); b *= 10; } }
void Start() { this.m_Provider = this.leapProviderObj.GetComponent <LeapServiceProvider>(); this.handUtil = new HandUtil(player); FingerMapper.Load(this.mappedPoints); this.isStartedLighting = false; this.inactivePoints = new List <Vector3>(); foreach (Transform point in mappedPoints.transform) { this.inactivePoints.Add(point.position); } //線を描画する処理に使う this.line = new Line() { currentPoint = Vector3.zero, nextPoint = Vector3.zero, progress = 0.0f, drawingSpeed = LINE_DRAWING_SPEED }; this.lineTimer = new Util.Timer(2.5f); this.light3Timer = new Util.Timer(6.0f); }
private IEnumerator StartConnection() { int i = 0; ConnectionProgressBar.SetProgress(0, 100); ConnectionProgressBar.Caption = "Loading..."; Util.Timer connClock = new Util.Timer(); connClock.StartTimer(); if (_blnForceConnection) { Net.ClientConnect(); } while (!Net.IsConnected && connClock.GetTime <= Net.CONNECTION_TIMEOUT) { yield return(null); i++; ConnectionProgressBar.SetProgress(connClock.GetFloatTime, Net.CONNECTION_TIMEOUT); yield return(null); } connClock.StopTimer(); ConnectionProgressBar.Caption = ""; if (!Net.IsConnected && connClock.GetFloatTime > Net.CONNECTION_TIMEOUT) { ConnectionProgressBar.Caption = "Unable to Load."; if (Net.IsClient) { Net.ClientDisconnect(); // if (Net.UsesMatchMaking) // { // PanelManager.Instance.ShowMatchMakingPanel(); // Net.StartMatchMaking(); // } else PanelManager.Instance.ShowConnectPanel(); } } connClock = null; }
public Walker() { m_timer = new Util.Timer(500, true); m_timer.Execute += m_timer_Execute; }