Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net.Http;
- using Newtonsoft.Json;
- //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
- namespace GameServer
- {
- public static class Mwa8ytAlslah
- {
- //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
- public static uint SlaatAlfgrHour = 0;
- public static uint SlaatAlfgrMinute = 0;
- public static uint SlaatAlzhrHour = 0;
- public static uint SlaatAlzhrMinute = 0;
- public static uint SlaatAl3srHour = 0;
- public static uint SlaatAl3srMinute = 0;
- public static uint SlaatAlmghrbHour = 0;
- public static uint SlaatAlmghrbMinute = 0;
- public static uint SlaatAl3shaHour = 0;
- public static uint SlaatAl3shaMinute = 0;
- public static DateTime LastSlah;
- public static uint WaitingSlah;
- public static bool SlahNow = false;
- //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
- public static void LoadMwa8ytAlslah()
- {
- Console.Write("Loading Mwa8ytAlslah.....");
- HttpClient httpClient = new HttpClient();
- string uri = "http://api.aladhan.com/v1/timingsByCity?city=cairo&country=cairo&method=5";
- HttpResponseMessage responseMessage = httpClient.GetAsync(uri).Result;
- string response = responseMessage.Content.ReadAsStringAsync().Result;
- dynamic resultObject = JsonConvert.DeserializeObject(response);
- #region Alfgr
- {
- string Alfgr = (string)resultObject.data.timings.Fajr;
- string[] Alfgrs = Alfgr.Split(':');
- SlaatAlfgrHour = Convert.ToByte(Alfgrs[0]);
- SlaatAlfgrMinute = Convert.ToByte(Alfgrs[1]);
- }
- #endregion
- #region Alzhr
- {
- string Alzhr = (string)resultObject.data.timings.Dhuhr;
- string[] Alzhrs = Alzhr.Split(':');
- SlaatAlzhrHour = Convert.ToByte(Alzhrs[0]);
- SlaatAlzhrMinute = Convert.ToByte(Alzhrs[1]);
- }
- #endregion
- #region Al3sr
- {
- string Al3sr = (string)resultObject.data.timings.Asr;
- string[] Al3srs = Al3sr.Split(':');
- SlaatAl3srHour = Convert.ToByte(Al3srs[0]);
- SlaatAl3srMinute = Convert.ToByte(Al3srs[1]);
- }
- #endregion
- #region Almghrb
- {
- string Almghrb = (string)resultObject.data.timings.Maghrib;
- string[] Almghrbs = Almghrb.Split(':');
- SlaatAlmghrbHour = Convert.ToByte(Almghrbs[0]);
- SlaatAlmghrbMinute = Convert.ToByte(Almghrbs[1]);
- }
- #endregion
- #region Al3sha
- {
- string Al3sha = (string)resultObject.data.timings.Isha;
- string[] Al3shas = Al3sha.Split(':');
- SlaatAl3shaHour = Convert.ToByte(Al3shas[0]);
- SlaatAl3shaMinute = Convert.ToByte(Al3shas[1]);
- }
- #endregion
- /*Console.WriteLine("Alfgr: " + SlaatAlfgrHour + ":" + SlaatAlfgrMinute);
- Console.WriteLine("Alzhr: " + SlaatAlzhrHour + ":" + SlaatAlzhrMinute);
- Console.WriteLine("Al3sr: " + SlaatAl3srHour + ":" + SlaatAl3srMinute);
- Console.WriteLine("Almghrb: " + SlaatAlmghrbHour + ":" + SlaatAlmghrbMinute);
- Console.WriteLine("Al3sha: " + SlaatAl3shaHour + ":" + SlaatAl3shaMinute);*/
- System.Console.WriteLine(" Complete!!");
- }
- //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
- public static void Mwa8ytAlslahh(Client.GameClient client)
- {
- if (SlahNow)
- {
- if (!client.Player.OnAutoHunt)
- client.Socket.Disconnect();
- }
- }
- //These Codes Were Written By Mohammed Elbooshy And Modified For Alex Source (Steam Source) by Mahmoud Mohammed (Uchiha T3Alo)
- public static void ShutDownLSlah()
- {
- #region Mwa8ytAlslah
- if (DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlfgrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlfgrMinute ||
- DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlzhrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlzhrMinute ||
- DateTime.Now.Hour == Mwa8ytAlslah.SlaatAl3srHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAl3srMinute ||
- DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlmghrbHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlmghrbMinute ||
- DateTime.Now.Hour == Mwa8ytAlslah.SlaatAl3shaHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAl3shaMinute)
- {
- if (!SlahNow)
- {
- if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour == Mwa8ytAlslah.SlaatAlzhrHour && DateTime.Now.Minute == Mwa8ytAlslah.SlaatAlzhrMinute)
- WaitingSlah = 30;
- else
- WaitingSlah = 15;
- LastSlah = DateTime.Now;
- SlahNow = true;
- }
- }
- if (DateTime.Now > LastSlah.AddMinutes(WaitingSlah))
- {
- if (SlahNow) SlahNow = false;
- }
- if (DateTime.Now.Hour == 01 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
- LoadMwa8ytAlslah();
- #endregion
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement