vigo عـﮯـضـﮯـو مــتــــمـــيــــــز
اوسمه : المهنه : المزاج : آلـღـهـوآيـღـة : : الدوله : عدد المساهمات : 8 نقاط : 4098 السٌّمعَة : 0 تاريخ التسجيل : 13/03/2013 المزاج : روقنجى
| موضوع: نظام حمايه . EX الخميس مارس 14, 2013 9:08 am | |
| بسم الله الرحمن الرحيم , مقدمه كدا يـ جدعان ههههههههههههه و الله لولا فريد مكنت راجع , تمام حبيت و انا راجع اقدم حاجه جديده كـ العادة , ------------------------------------------------------------------ انهردا بقدم حاجه زى [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] جميل جدا , للى مش عنده يا جدعان , واحد هـ يقولى ايه دا يعنى , اقولوا بص يا رايق انت مثلآ اديت واحد بى ام فـ سيرفرك تمام , طيب افرض ادى اى حد حاجه تمام هـ تعرف ازاى اقولوا انا جاى علشان اعرفك , [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] ------------------------------------------------------------------- الاضافه يـ راجل , [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] ادخل المسار دا , Source/Network/PacketHandle.cs , تمام يا رايق ابحث عن دا , 0x7d1 لو عندك يا حبى ها تنزل لحد الكود دا , foreach (GameState state in Kernel.GamePool.Values) { و تشيل كل الى تحتيه لحد return; و تضيف دا
[flash(60,60)] if ((state != null) && (state.Entity.Name == message._To)) { DateTime now; string str; string str2; message.Mesh = client.Entity.Mesh; state.Send(message); if (client.Account.State == AccountTable.AccountState.GameMaster) { now = DateTime.Now; str = string.Concat(new object[] { now.Year, "-", now.Month, "//" }); str2 = now.Day + "//"; if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })) + "rn" + client.Entity.Name + " Talk to : [" + state.Entity.Name + "] Message: [" + message.__Message + "]"); } if (client.Account.State == AccountTable.AccountState.ProjectManager) { now = DateTime.Now; str = string.Concat(new object[] { now.Year, "-", now.Month, "//" }); str2 = now.Day + "//"; if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })) + "rn" + client.Entity.Name + " Talk to : [" + state.Entity.Name + "] Message: [" + message.__Message + "]"); } return; } } foreach (Friend friend in client.Friends.Values) { if (friend.Name == message._To) { message.__Message = message.__Message.Replace("", "x00b9"); client.OnMessageBoxEventParams = new object[] { client.Entity.UID, friend.ID, Conquer_Online_Server.Console.TimeStamp() + message.__Message }; if (action == null) { action = delegate { Conquer_Online_Server.Database.KnownPersons.UpdateMessageOnFriend(Convert.ToUInt32(client.OnMessageBoxEventParams[0]), Convert.ToUInt32(client.OnMessageBoxEventParams[1]), Convert.ToString(client.OnMessageBoxEventParams[2])); client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Message sent!", System.Drawing.Color.Green, 0x7dc)); }; } client.OnMessageBoxOK = action; if (action2 == null) { action2 = delegate { client.OnMessageBoxEventParams = new object[0]; }; } client.OnMessageBoxCANCEL = action2; client.Send(new NpcReply(6, "To " + friend.Name + ": rn" + message.__Message + "rnrnSend? (It will replace other messages.)")); return; } } client.Send(new Conquer_Online_Server.Network.GamePackets.Message("The player is not online.", System.Drawing.Color.Orange, 0x7de)); return;
[/flash] اشطه كدا و لو مش عندك ,
ابحث عن دا case 0x7d0: client.SendScreen(message, false); return;
و ضيف تحتيه ,[flash] case 0x7d1: foreach (GameState state in Kernel.GamePool.Values) { if ((state != null) && (state.Entity.Name == message._To)) { DateTime now; string str; string str2; message.Mesh = client.Entity.Mesh; state.Send(message); if (client.Account.State == AccountTable.AccountState.GameMaster) { now = DateTime.Now; str = string.Concat(new object[] { now.Year, "-", now.Month, "//" }); str2 = now.Day + "//"; if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })) + "rn" + client.Entity.Name + " Talk to : [" + state.Entity.Name + "] Message: [" + message.__Message + "]"); } if (client.Account.State == AccountTable.AccountState.ProjectManager) { now = DateTime.Now; str = string.Concat(new object[] { now.Year, "-", now.Month, "//" }); str2 = now.Day + "//"; if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogmsglog" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogmsglog" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogmsglog", str, @"", now.Day, ".txt" })) + "rn" + client.Entity.Name + " Talk to : [" + state.Entity.Name + "] Message: [" + message.__Message + "]"); } return; } } foreach (Friend friend in client.Friends.Values) { if (friend.Name == message._To) { message.__Message = message.__Message.Replace("", "x00b9"); client.OnMessageBoxEventParams = new object[] { client.Entity.UID, friend.ID, Conquer_Online_Server.Console.TimeStamp() + message.__Message }; if (action == null) { action = delegate { Conquer_Online_Server.Database.KnownPersons.UpdateMessageOnFriend(Convert.ToUInt32(client.OnMessageBoxEventParams[0]), Convert.ToUInt32(client.OnMessageBoxEventParams[1]), Convert.ToString(client.OnMessageBoxEventParams[2])); client.Send(new Conquer_Online_Server.Network.GamePackets.Message("Message sent!", System.Drawing.Color.Green, 0x7dc)); }; } client.OnMessageBoxOK = action; if (action2 == null) { action2 = delegate { client.OnMessageBoxEventParams = new object[0]; }; } client.OnMessageBoxCANCEL = action2; client.Send(new NpcReply(6, "To " + friend.Name + ": rn" + message.__Message + "rnrnSend? (It will replace other messages.)")); return; } } client.Send(new Conquer_Online_Server.Network.GamePackets.Message("The player is not online.", System.Drawing.Color.Orange, 0x7de)); return;
[/flash] ,
تمام كدا الاول ,
بعدين تبحث عن الكود دا ,
[flash] private static void AcceptTrade(Conquer_Online_Server.Network.GamePackets.Trade trade, GameState client)
[/flash] و لو مش عندك دا ابحث عن دا ,
[flash] private static void AcceptTrade
[/flash] و اقفله من علآمه - الى ع الجمب ,
و حط دا
[flash] private static void AcceptTrade(Conquer_Online_Server.Network.GamePackets.Trade trade, GameState client) { GameState state = null; if (Kernel.GamePool.TryGetValue(client.Trade.TraderUID, out state)) { client.Trade.Accepted = true; state.Send(trade); if (state.Trade.Accepted) { DateTime time; string str; if ((client.Inventory.Count + state.Trade.Items.Count) <= 40) { foreach (IConquerItem item in state.Trade.Items) { if (state.Inventory.ContainsUID(item.UID)) { client.Inventory.Add(item, Enums.ItemUse.Move); state.Inventory.Remove(item.UID, Enums.ItemUse.None, true); time = DateTime.Now; str = string.Concat(new object[] { time.Year, "-", time.Month, "//" }); string str2 = time.Day + "//"; if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" })), "rn", state.Entity.Name, " gaved ", client.Entity.Name, " item:", item.UID, " Plus:", item.Plus, " Name: ", ConquerItemInformation.BaseInformations[item.ID].Name })); } } } if ((state.Inventory.Count + client.Trade.Items.Count) <= 40) { foreach (IConquerItem item in client.Trade.Items) { if (client.Inventory.ContainsUID(item.UID)) { state.Inventory.Add(item, Enums.ItemUse.Move); client.Inventory.Remove(item.UID, Enums.ItemUse.None, true); time = DateTime.Now; str = string.Concat(new object[] { time.Year, "-", time.Month, "//" }); if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade" + str)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade" + str); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str, @"", time.Day, ".txt" })), "rn", client.Entity.Name, " gaved ", state.Entity.Name, " item:", item.UID, " Plus:", item.Plus, " Name: ", ConquerItemInformation.BaseInformations[item.ID].Name })); } } } if (state.Trade.Money <= state.Entity.Money) { state.Entity.Money -= state.Trade.Money; client.Entity.Money += state.Trade.Money; } if (client.Trade.Money <= client.Entity.Money) { client.Entity.Money -= client.Trade.Money; state.Entity.Money += client.Trade.Money; } if (state.Trade.ConquerPoints <= state.Entity.ConquerPoints) { state.Entity.ConquerPoints -= state.Trade.ConquerPoints; client.Entity.ConquerPoints += state.Trade.ConquerPoints; } if (client.Trade.ConquerPoints <= client.Entity.ConquerPoints) { client.Entity.ConquerPoints -= client.Trade.ConquerPoints; state.Entity.ConquerPoints += client.Trade.ConquerPoints; } DateTime now = DateTime.Now; string str3 = string.Concat(new object[] { now.Year, "-", now.Month, "//" }); if (!Directory.Exists(Application.StartupPath + @"gmlog")) { Directory.CreateDirectory(Application.StartupPath + @"gmlog"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade")) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade"); } if (!Directory.Exists(Application.StartupPath + @"gmlogTrade" + str3)) { Directory.CreateDirectory(Application.StartupPath + @"gmlogTrade" + str3); } if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" }))) { File.CreateText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" })); } File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" })), "rnTrader:", client.Entity.Name, ": TradeWith: ", state.Entity.Name, " Cps1: ", client.Trade.ConquerPoints, " Cps2: ", state.Trade.ConquerPoints, " Time: ", DateTime.Now })); File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"gmlogTrade", str3, @"", now.Day, ".txt" })) + "rn-------------------------------------------------------------------"); trade.Type = 5; trade.dwParam = client.Entity.UID; client.Send(trade); trade.dwParam = state.Entity.UID; state.Send(trade); state.Trade = new Conquer_Online_Server.Game.ConquerStructures.Trade(); client.Trade = new Conquer_Online_Server.Game.ConquerStructures.Trade(); client.Entity.Money = client.Entity.Money; state.Entity.Money = state.Entity.Money; client.Entity.ConquerPoints = client.Entity.ConquerPoints; state.Entity.ConquerPoints = state.Entity.ConquerPoints; EntityTable.UpdateCps(client); EntityTable.UpdateCps(state); } } }
[/flash] -------------------------------------------------------------- تمام كدا الباكت هندلر نخش ع المسار دا , Source/ServerBase/Constants.cs
و ضيف دول
[flash] public const string Unhandledgmlog = @"gmlog"; public const string UnhandledTradePath = @"TradeLog";
[/flash] تمام و ادخل المسار دا ,
Source/Bin/Debug
و تفك دا جوه ,
التحميل: {"http://www.gulfup.com/?wvFhvJ[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] "}
-------------------------------------------------------------------- صوره تأكيد ,
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]
الاكواد اهيه فـ ملف تكست معاهاا الشرح ,
>{" [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] "}<
------------------------------------------------------------------------------------------- و حيات النبى لو نقلتوا قولوا المصدر فـى ايه يا جدعان
السلآم عليكم . | |
|