محمد ياسر
2019-07-20, 06:48 PM
السلام عليكم ورحمة الله وبركاته
نظام التريد لوج ذي الي منزله RIDER في السورس سورس KhaledMohamed V3 Golden Edition Update (عفواً لايمكن عرض الروابط في الإرشيف)
الي نزله من امبارح
عفواً لايمكن عرض الروابط في الإرشيف
النظام ده يخليك تعرف مين ترد مع مين وترد ايه وامتا وكل معلومه صغيره وكبيره
يلا نبداء الاضافه
هتفتح
PacketHandler
تدور على
static void AcceptTrade
اقفله من السالب وبدله بده
private static void AcceptTrade(CoFans.Network.GamePackets.Trade trade, GameState client)
{
GameState state = null;
if (Kernel.GamePool.TryGetValue(client.Trade.TraderUI D, 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })), "\r\n", 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })), "\r\n", 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str3))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str3);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })), "\r\nTrader:", 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, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })) + "\r\n-------------------------------------------------------------------");
trade.Type = 5;
trade.dwParam = client.Entity.UID;
client.Send(trade);
trade.dwParam = state.Entity.UID;
state.Send(trade);
state.Trade = new CoFans.Game.ConquerStructures.Trade();
client.Trade = new CoFans.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);
}
}
}
بعد كدا نفتح
ServerBase,Constants.cs
ندور على
public static Message Accuracy
نحط فوقها بالظبط الكود دا
public const string Unhandledgmlog = @"gmlog";
ممكن يظهر لبعض الناس ايرور فى
Application
هتخليها كدا
System.Windows.Forms.Application
ممكن يظهر ايرور فى
ConquerItemInformation
هتخليها كدا
CoFans.Database.ConquerItemInformation
طبعا غير اسم البروجيكت الى هو CoFans
تكمله للموضوع فى ناس عاوزه تشوف الشات بس فى حاجه هنا
موضوع الشات هيجبلك كل يوم جديد لما اللعبه ترستر ايرور 1
موضوع سهل و خفيف و مفيد فى نفس الوقت
اللسستم ده قديم كان بتاع واحد اسمه khalidwepas
وياريت يكون موضوع مفيد
نظام التريد لوج ذي الي منزله RIDER في السورس سورس KhaledMohamed V3 Golden Edition Update (عفواً لايمكن عرض الروابط في الإرشيف)
الي نزله من امبارح
عفواً لايمكن عرض الروابط في الإرشيف
النظام ده يخليك تعرف مين ترد مع مين وترد ايه وامتا وكل معلومه صغيره وكبيره
يلا نبداء الاضافه
هتفتح
PacketHandler
تدور على
static void AcceptTrade
اقفله من السالب وبدله بده
private static void AcceptTrade(CoFans.Network.GamePackets.Trade trade, GameState client)
{
GameState state = null;
if (Kernel.GamePool.TryGetValue(client.Trade.TraderUI D, 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })), "\r\n", 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str, @"\", time.Day, ".txt" })), "\r\n", 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 + @"gmlog\\Trade"))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade");
}
if (!Directory.Exists(Application.StartupPath + @"\gmlog\\Trade\" + str3))
{
Directory.CreateDirectory(Application.StartupPath + @"\gmlog\\Trade\" + str3);
}
if (!File.Exists(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })))
{
File.CreateText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }));
}
File.WriteAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }), string.Concat(new object[] { File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })), "\r\nTrader:", 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, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" }), File.ReadAllText(string.Concat(new object[] { Application.StartupPath, @"\gmlog\\Trade\", str3, @"\", now.Day, ".txt" })) + "\r\n-------------------------------------------------------------------");
trade.Type = 5;
trade.dwParam = client.Entity.UID;
client.Send(trade);
trade.dwParam = state.Entity.UID;
state.Send(trade);
state.Trade = new CoFans.Game.ConquerStructures.Trade();
client.Trade = new CoFans.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);
}
}
}
بعد كدا نفتح
ServerBase,Constants.cs
ندور على
public static Message Accuracy
نحط فوقها بالظبط الكود دا
public const string Unhandledgmlog = @"gmlog";
ممكن يظهر لبعض الناس ايرور فى
Application
هتخليها كدا
System.Windows.Forms.Application
ممكن يظهر ايرور فى
ConquerItemInformation
هتخليها كدا
CoFans.Database.ConquerItemInformation
طبعا غير اسم البروجيكت الى هو CoFans
تكمله للموضوع فى ناس عاوزه تشوف الشات بس فى حاجه هنا
موضوع الشات هيجبلك كل يوم جديد لما اللعبه ترستر ايرور 1
موضوع سهل و خفيف و مفيد فى نفس الوقت
اللسستم ده قديم كان بتاع واحد اسمه khalidwepas
وياريت يكون موضوع مفيد