المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ادي للاعب بان ماك :MacAddress


Commander
2019-08-05, 01:56 AM
بسم الله الرحمن الرحيم
اولا انا هكرر كلمتي قبل كدا الماك ادرس مهم جدا من حيث انك لو عايز تدي بان لواحد واديتو بان اي بي بيغير الاي بي في ثواني وبيفتح ويغلبك طب ما تديلو بان ماك
قبل ما تنفذ الموضوع دا لازم تكون منفئ الموضوع الي منزلو قبل كدا
عفواً لايمكن عرض الروابط في الإرشيف
نبتدي بقي الاضافه
اول حاجه هتعمل كلاس جديد وترزع فيه ده وتغير اسم البروجكت متنساش
using ResidentEvil.Client; using ResidentEvil.Database; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ResidentEvil.Database { public class MacBan { public string mac; public static Dictionary<int, string> BannedMac; public static void Load() { BannedMac = new Dictionary<int, string>(); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bann edMac")) using (var reader = new MySqlReader(cmd)) { if (reader.Read()) { int asInt = reader.ReadInt32("Mac_int"); BannedMac.Add(asInt , reader.ReadString("Mac")); } } } public static bool IsBanned(string Mac) { return BannedMac.ContainsKey(Mac.GetHashCode()); } public static void Unban(string Mac) { BannedMac.Remove(Mac.GetHashCode()); using (var cmd = new MySqlCommand(MySqlCommandType.DELETE)) cmd.Delete("bannedMac", "Mac_int", Mac.GetHashCode()).Execute(); } public static void Ban(string Mac) { BannedMac.Add(Mac.GetHashCode() , Mac); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bann edMac")) using (var reader = new MySqlReader(cmd)) { if (!reader.Read()) using (var cmds = new MySqlCommand(MySqlCommandType.INSERT)) cmds.Insert("bannedMac").Insert("Mac_int", Mac.GetHashCode()).Insert("Mac", Mac).Execute(); } } } }


بعد كدا نروح نحط اللود في كلاس بروجرام
Database.MacBan.Load();
بعد كدا نروح نعمل الشفره
نروح كلاس باكت هاندلر ونبحث عن
case "ban":
ونحط فوقيها
case "banmac":
{
string bannedMac = "";
foreach (var Client in Program.Values)
{
if (Client.Account.State >= client.Account.State)
continue;
if (Client.Entity.LoweredName.Contains(Data[1]))
{
bannedMac = Client.Account.MacAddress;
Client.Account.State = Database.AccountTable.AccountState.Banned;
Client.Account.SaveState();
Database.MacBan.Ban(Client.Account.MacAddress);
Client.Disconnect();
client.Send(new ResidentEvil.Network.GamePackets.Message("[Name " + Client.Entity.Name + "]", System.Drawing.Color.Gold, GamePackets.Message.FirstRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("Username: " + Client.Account.Username, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("Password: " + Client.Account.Password, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("IP: " + Client.Account.IP, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("Mac: " + Client.Account.MacAddress, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("CPs: " + Client.Entity.ConquerPoints, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("Money: " + Client.Entity.Money, System.Drawing.Color.Green, GamePackets.Message.ContinueRightCorner));
client.Send(new ResidentEvil.Network.GamePackets.Message("Map: [" + Client.Entity.MapID + "] " + Client.Entity.X + "," + Client.Entity.Y, System.Drawing.Color.Green, GamePackets.Message.ContinueRightCorner));
break;
}
}
if (bannedMac == "")
Kernel.SendWorldMessage(new Message(client.Account.State.ToString() + " " + client.Entity.Name + " has banned the Mac: " + bannedMac, GamePackets.Message.Center));
foreach (var Client in Program.Values)
{
if (Client.Account.State >= client.Account.State)
continue;
if (Client.Account.MacAddress == bannedMac)
{
Client.Account.State = Database.AccountTable.AccountState.Banned;
Client.Account.SaveState();
Client.Disconnect();
}
}
break;
}
case "unbanmac":
{
Database.MacBan.Unban(Data[1]);
break;
}


بعد كدا برده في الباكت هاندلر هنبحث عن
void AppendConnect
وننزل لحد هنا
if (Account.State == Database.AccountTable.AccountState.Banned)
نضيف فوقيه ده
if (ResidentEvil.Database.MacBan.IsBanned(client.Acco unt.MacAddress))
{
DateTime banStamp = client["banstamp"];
banStamp = banStamp.AddHours(client["banhours"]);
Message = "^_^ You are Have ban mac ^_^";
}

بعد كدا نروح نرفع الملف ده في القاعده
عفواً لايمكن عرض الروابط في الإرشيف
والسلام عليكم ورحمة الله وبركاته

Hassan Emprator
2019-08-05, 02:01 AM
عاش الله ينور

Hassan Emprator
2019-08-05, 02:02 AM
حلو امعلم

Commander
2019-08-05, 02:14 AM
حلو امعلم

حبيبي يمعلم

ALz3em
2019-08-05, 03:17 AM
عاش استمر

Tefa
2019-08-05, 02:43 PM
عاش

MohamedModyAdel
2019-09-25, 09:59 PM
عاش

MohamedModyAdel
2019-09-25, 10:06 PM
ياريت تظبط الموضوع الكلاس سطر واحد
using ResidentEvil.Client; using ResidentEvil.Database; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ResidentEvil.Database { public class MacBan { public string mac; public static Dictionary<int, string> BannedMac; public static void Load() { BannedMac = new Dictionary<int, string>(); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bannedMac")) using (var reader = new MySqlReader(cmd)) { if (reader.Read()) { int asInt = reader.ReadInt32("Mac_int"); BannedMac.Add(asInt , reader.ReadString("Mac")); } } } public static bool IsBanned(string Mac) { return BannedMac.ContainsKey(Mac.GetHashCode()); } public static void Unban(string Mac) { BannedMac.Remove(Mac.GetHashCode()); using (var cmd = new MySqlCommand(MySqlCommandType.DELETE)) cmd.Delete("bannedMac", "Mac_int", Mac.GetHashCode()).Execute(); } public static void Ban(string Mac) { BannedMac.Add(Mac.GetHashCode() , Mac); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bannedMac")) using (var reader = new MySqlReader(cmd)) { if (!reader.Read()) using (var cmds = new MySqlCommand(MySqlCommandType.INSERT)) cmds.Insert("bannedMac").Insert("Mac_int", Mac.GetHashCode()).Insert("Mac", Mac).Execute(); } } } }
ياريت تظبطه

uncelsam
2019-10-23, 09:46 PM
حاجه فشخولا من الاخر

AbuMaryam
2019-10-27, 12:45 AM
تسلم ايدك على الموضوع الجميل دة

bisho2009
2019-11-04, 07:39 PM
شكرا

nonos
2019-11-07, 04:19 PM
تسلم

midoazoz
2019-11-18, 07:39 PM
عاش فشخ والله يا معلم

youssefabdelmanam
2019-12-07, 03:16 AM
شكرا

AlNa7oo
2019-12-24, 10:46 PM
عاش فشخ

MRonlineGvrix
2019-12-25, 02:13 AM
جميل ياريس

MRonlineGvrix
2019-12-25, 02:16 AM
using ResidentEvil.Client; using ResidentEvil.Database; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ResidentEvil.Database { public class MacBan { public string mac; public static Dictionary<int, string> BannedMac; public static void Load() { BannedMac = new Dictionary<int, string>(); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bann edMac")) using (var reader = new MySqlReader(cmd)) { if (reader.Read()) { int asInt = reader.ReadInt32("Mac_int"); BannedMac.Add(asInt , reader.ReadString("Mac")); } } } public static bool IsBanned(string Mac) { return BannedMac.ContainsKey(Mac.GetHashCode()); } public static void Unban(string Mac) { BannedMac.Remove(Mac.GetHashCode()); using (var cmd = new MySqlCommand(MySqlCommandType.DELETE)) cmd.Delete("bannedMac", "Mac_int", Mac.GetHashCode()).Execute(); } public static void Ban(string Mac) { BannedMac.Add(Mac.GetHashCode() , Mac); using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("bann edMac")) using (var reader = new MySqlReader(cmd)) { if (!reader.Read()) using (var cmds = new MySqlCommand(MySqlCommandType.INSERT)) cmds.Insert("bannedMac").Insert("Mac_int", Mac.GetHashCode()).Insert("Mac", Mac).Execute(); } } } }

naderatef
2020-01-23, 06:44 PM
عااش

amr69940
2020-01-31, 07:48 PM
goood

asd201230099
2020-02-21, 10:13 PM
عاااااااااااااااااااش بجد

yousefhtrikano
2020-03-24, 12:28 AM
3aa4

fady emad kamel
2020-03-29, 09:34 PM
شكرا

Diego
2020-04-01, 10:04 AM
عااااش

Mo Khalid
2020-04-16, 01:38 AM
عاش

Tyranny-Team's
2020-04-27, 01:54 AM
عاش

محمد اسامه
2022-01-03, 01:30 AM
3a4

محمد اسامه
2022-01-03, 01:31 AM
3a444

hamadajti
2022-02-28, 05:54 AM
Lindo

ismailgoda1
2022-03-02, 01:59 AM
عااش

Mr.MoZa
2022-03-02, 01:31 PM
عاااااااش

MahmoudElsndbad
2022-03-15, 05:11 PM
????

Rage
2022-04-18, 01:28 AM
niceeee

disco
2022-05-07, 06:24 PM
تسلم ي برنس الله ينور

nourhan
2023-04-10, 02:27 AM
asdasd

عمر23
2023-04-27, 12:26 AM
عاش

Saad Hydra
2023-10-02, 04:11 PM
عاش ولله

dwshabeh
2024-01-28, 07:38 AM
ممكن لينك ملف الفاعده

BoshaBosha
2024-01-29, 10:36 PM
عاااش

Eslamahmed
2024-02-15, 09:20 PM
عاس

aboessa
2024-02-19, 07:03 PM
عاش

Sherif Sabry
2024-04-19, 11:58 AM
جميل

yousef here
2024-04-25, 10:18 PM
عاش

يوسف كونكر
2024-07-03, 01:34 AM
1