|
ActionType.DeleteCharacter
[DataAttribute(ActionType.DeleteCharacter)]
public unsafe static void DeleteCharacter(Client.GameClient client, ServerSockets.Packet msg, ActionQuery* data)
{
if (client.Player.OnMyOwnServer == false)
return;
if (client.Player.SecurityPassword == data->dwParam)
{
if (client.Player.MyGuild != null)
{
#if Arabic
client.SendSysMesage("Please remove your guild.");
#else
client.SendSysMesage("Please remove your guild.");
#endif
return;
}
if (client.Player.MyClan != null)
{
#if Arabic
client.SendSysMesage("Please remove your clan.");
#else
client.SendSysMesage("Please remove your clan.");
#endif
return;
}
client.Player.Delete = true;
client.Socket.Disconnect();
}
else
{
#if Arabic
client.SendSysMesage("wrong password.");
#else
client.SendSysMesage("wrong password.");
#endif
}
}
protected unsafe override void OnDequeue
protected unsafe override void OnDequeue(object obj, int time)
{
try
{
if (obj is string)
{
string text = obj as string;
if (text.StartsWith("[DemonBox]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "DemonBox" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
else if (text.StartsWith("[Chat]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "Chat" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
else if (text.StartsWith("[Item]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "Item" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
else if (text.StartsWith("[CallStack]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "CallStack" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
else if (text.StartsWith("[CallStack2]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "CallStack2" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
else if (text.StartsWith("[Pocker]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "Pocker" + dt.Month + "-" + dt.Day + "";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
if (text.StartsWith("[GMLogs]"))
{
const string UnhandledExceptionsPath = "Loggs\\";
var dt = DateTime.Now;
string date = "GMLogs";
if (!Directory.Exists(Application.StartupPath + UnhandledExceptionsPath))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
if (!Directory.Exists(Application.StartupPath + "\\" + UnhandledExceptionsPath + date))
Directory.CreateDirectory(Application.StartupPath + "\\" + UnhandledExceptionsPath + date);
string fullPath = Application.StartupPath + "\\" + UnhandledExceptionsPath + date + "\\";
if (!File.Exists(fullPath + date + ".txt"))
{
File.WriteAllLines(fullPath + date + ".txt", new string[0]);
}
using (var SW = File.AppendText(fullPath + date + ".txt"))
{
SW.WriteLine(text);
SW.Close();
}
}
//GMLogs
}
else if (obj is Role.GameMap)
{
UpdateMapRace(obj as Role.GameMap);
}
else if (obj is Role.Instance.Guild.Member)
{
UpdateGuildMember(obj as Role.Instance.Guild.Member);
}
else if (obj is Role.Instance.Guild.UpdateDB)
{
UpdateGuildMember(obj as Role.Instance.Guild.UpdateDB);
}
else if (obj is Role.Instance.Union.Member)
{
UpdateUnionMember(obj as Role.Instance.Union.Member);
}
else if (obj is Role.Instance.Clan.Member)
{
UpdateClanMember(obj as Role.Instance.Clan.Member);
}
else
{
Client.GameClient client = obj as Client.GameClient;
if (client.Player != null && client.Player.Delete == true)
{
if (client.Map != null)
client.Map.View.LeaveMap<Role.Player>(client.Player);
DateTime Now64 = DateTime.Now;
MyConsole.WriteLine("Client " + client.Player.Name + " delete he account.");
if (File.Exists(Program.ServerConfig.DbLocation + "\\Users\\" + client.Player.UID + ".ini"))
File.Copy(Program.ServerConfig.DbLocation + "\\Users\\" + client.Player.UID + ".ini", Program.ServerConfig.DbLocation + "\\BackUp\\Users\\" + client.Player.UID + "date" + GenerateDate() + ".ini", true);
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersSpells\\" + client.Player.UID + ".bin"))
File.Copy(Program.ServerConfig.DbLocation + "\\PlayersSpells\\" + client.Player.UID + ".bin", Program.ServerConfig.DbLocation + "\\BackUp\\PlayersSpells\\" + client.Player.UID + "date" + GenerateDate() + ".bin", true);
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersProfs\\" + client.Player.UID + ".bin"))
File.Copy(Program.ServerConfig.DbLocation + "\\PlayersProfs\\" + client.Player.UID + ".bin", Program.ServerConfig.DbLocation + "\\BackUp\\PlayersProfs\\" + client.Player.UID + "date" + GenerateDate() + ".bin", true);
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersItems\\" + client.Player.UID + ".bin"))
File.Copy(Program.ServerConfig.DbLocation + "\\PlayersItems\\" + client.Player.UID + ".bin", Program.ServerConfig.DbLocation + "\\BackUp\\PlayersItems\\" + client.Player.UID + "date" + GenerateDate() + ".bin");
if (File.Exists(Program.ServerConfig.DbLocation + "\\Users\\" + client.Player.UID + ".ini"))
File.Delete(Program.ServerConfig.DbLocation + "\\Users\\" + client.Player.UID + ".ini");
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersSpells\\" + client.Player.UID + ".bin"))
File.Delete(Program.ServerConfig.DbLocation + "\\PlayersSpells\\" + client.Player.UID + ".bin");
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersProfs\\" + client.Player.UID + ".bin"))
File.Delete(Program.ServerConfig.DbLocation + "\\PlayersProfs\\" + client.Player.UID + ".bin");
if (File.Exists(Program.ServerConfig.DbLocation + "\\PlayersItems\\" + client.Player.UID + ".bin"))
File.Delete(Program.ServerConfig.DbLocation + "\\PlayersItems\\" + client.Player.UID + ".bin");
if (File.Exists(Program.ServerConfig.DbLocation + "\\Quests\\" + client.Player.UID + ".bin"))
File.Delete(Program.ServerConfig.DbLocation + "\\Quests\\" + client.Player.UID + ".bin");
Role.Instance.House house;
if (client.MyHouse != null && Role.Instance.House.HousePoll.ContainsKey(client.Player.UID))
Role.Instance.House.HousePoll.TryRemove(client.Player.UID, out house);
// PrestigeRanking.Remove(client.Player.UID);
if (File.Exists(Program.ServerConfig.DbLocation + "\\Houses\\" + client.Player.UID + ".bin"))
File.Delete(Program.ServerConfig.DbLocation + "\\Houses\\" + client.Player.UID + ".bin");
Role.Instance.Chi chi;
if (Role.Instance.Chi.ChiPool.ContainsKey(client.Player.UID))
{
Role.Instance.Chi.ChiPool.TryRemove(client.Player.UID, out chi);
WindowsAPI.IniFile write = new WindowsAPI.IniFile("\\BackUp\\ChiInfo.txt");
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Dragon", chi.Dragon.ToString());
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Phoenix", chi.Phoenix.ToString());
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Turtle", chi.Turtle.ToString());
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Tiger", chi.Tiger.ToString());
}
Role.Instance.Flowers flow;
if (Role.Instance.Flowers.ClientPoll.ContainsKey(client.Player.UID))
{
Role.Instance.Flowers.ClientPoll.TryRemove(client.Player.UID, out flow);
}
Role.Instance.InnerPower innerpower;
if (Role.Instance.InnerPower.InnerPowerPolle.ContainsKey(client.Player.UID))
{
Role.Instance.InnerPower.InnerPowerPolle.TryRemove(client.Player.UID, out innerpower);
WindowsAPI.IniFile write = new WindowsAPI.IniFile("\\BackUp\\InnerPower.txt");
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Dragon", innerpower.ToString());
}
Role.Instance.JiangHu Jiang;
if (Role.Instance.JiangHu.Poll.ContainsKey(client.Player.UID))
{
Role.Instance.JiangHu.Poll.TryRemove(client.Player.UID, out Jiang);
WindowsAPI.IniFile write = new WindowsAPI.IniFile("\\BackUp\\JiangHuInfo.txt");
write.WriteString(client.Player.UID.ToString() + "date" + GenerateDate() + "", "Jiang", Jiang.ToString());
}
Role.Instance.Associate.MyAsociats Associate;
if (Role.Instance.Associate.Associates.TryGetValue(client.Player.UID, out Associate))
{
Role.Instance.Associate.Associates.TryRemove(client.Player.UID, out Associate);
}
Client.GameClient user;
Database.Server.GamePoll.TryRemove(client.Player.UID, out user);
if (Server.NameUsed.Contains(user.Player.Name.GetHashCode()))
{
lock (Server.NameUsed)
Server.NameUsed.Remove(user.Player.Name.GetHashCode());
}
client.Player.Delete = false;
return;
}
if ((client.ClientFlag & Client.ServerFlag.RemoveSpouse) == Client.ServerFlag.RemoveSpouse)
{
DestroySpouse(client);
client.ClientFlag &= ~Client.ServerFlag.RemoveSpouse;
return;
}
if ((client.ClientFlag & Client.ServerFlag.UpdateSpouse) == Client.ServerFlag.UpdateSpouse)
{
UpdateSpouse(client);
client.ClientFlag &= ~Client.ServerFlag.UpdateSpouse;
return;
}
if ((client.ClientFlag & Client.ServerFlag.SetLocation) != Client.ServerFlag.SetLocation && (client.ClientFlag & Client.ServerFlag.OnLoggion) == Client.ServerFlag.OnLoggion)
{
Game.MsgServer.MsgLoginClient.LoginHandler(client, client.OnLogin);
}
else if ((client.ClientFlag & Client.ServerFlag.QueuesSave) == Client.ServerFlag.QueuesSave)
{
if (client.Player.OnTransform)
{
client.Player.HitPoints = Math.Min(client.Player.HitPoints, (int)client.Status.MaxHitpoints);
}
SaveClient(client);
}
}
}
catch (Exception e) { MyConsole.SaveException(e); }
}
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشكله بخصوص سورس ماتركس | AdmAhmed | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-05-09 09:30 AM |
مشكله stone progress في سورس رايزو و ماتركس | magdy | مشكلات السيرفيرات كونكر الشخصيه | 8 | 2020-03-17 05:15 AM |
مشكله stone progress في سورس رايزو و ماتركس | AliNasser | مشكلات السيرفيرات كونكر الشخصيه | 9 | 2020-03-11 09:33 AM |
فيه مشكلة في سورس متركس كل لما اعمل التور والفانه سوكت بيختفو | Mawdo3jded | مشكلات السيرفيرات كونكر الشخصيه | 7 | 2020-01-22 10:38 PM |
محتاج سيستم الشي والجنج لسورس mr banda | kotb | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-07-25 03:19 AM |