|
المشاركات 1,940 |
+التقييم 0.96 |
تاريخ التسجيل Apr 2019 |
الاقامة Egypt |
نظام التشغيل windows 7 |
رقم العضوية 1 |
static void AcceptTrade
private static void AcceptTrade(CoFans.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 + @"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);
}
}
}
public static Message Accuracy
public const string Unhandledgmlog = @"gmlog";
System.Windows.Forms.Application
CoFans.Database.ConquerItemInformation
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
نظام لوتري (Lucky) | Tyranny-Team's | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2020-05-07 09:34 AM |
نظام الدوننيش | mohamedomar | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2020-05-03 04:45 PM |
كيفيه منع التريد ف ماب معينه | photog | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-03-17 02:07 PM |
نظام VIP Name Changer | محمد ياسر | تطوير سيرفرات كونكر | 4 | 2019-05-31 11:01 PM |
نظام الترقيات | محمد ياسر | المنتدي الاداري والاخبار والاعلانات والقوانين | 0 | 2019-04-18 08:35 AM |