منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   مشكلات السيرفيرات كونكر الشخصيه (https://code.vpscairo.com/forumdisplay.php?f=12)
-   -   مشكله في تشغيل سورس playconquer تعديل اسامه (https://code.vpscairo.com/showthread.php?t=1709)

AliNasser 2019-08-19 12:58 PM

مشكله في تشغيل سورس playconquer تعديل اسامه
 
السلام عليكم

دلوقتي انا حملت سورس بلاي كونكر بتاع ديشا بتعديل الاستاذ اسامه وغيرت الايبي ومعلومات الداتا بيز كالعاده عشان اشغله ....

دلوقتي واجهتني مشكله كبيره وهي كالاتي

[IMG]https://1.top4top.net/p_1326kb6v31.png[/IMG]

كلاس program.cs بيجبرني اشتغل بال private ip وانا البريفيت ايبي عندي مش شغاال فبشتغل بالpuplic ip

بس الكلاس بيجبرني انو اغيرو للبريفت ايبي فكل مره افتح الكونصول ...

فانا عاوز الغي الكود البيعمل تشبك علي الايبي خالص بس مهما حوالت مش عارف الغيه لان معرفتي بالسي شارب سطحيه ..

فيريت لو حد يتكرم ويساعدني , وشكرا مقدما ....

ودي اكواد program.cs


كود PHP:

using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using PlayConquer.Network;
using PlayConquer.Database;
using PlayConquer.Network.Sockets;
using PlayConquer.Network.AuthPackets;
using PlayConquer.Game;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using PlayConquer.Network.GamePackets;
using PlayConquer.Client;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Threading;
using PlayConquer;
using PlayConquer.Network.GamePackets.Union;
using ProtoBuf;
using PlayConquer.MaTrix;

namespace 
PlayConquer
{
    class 
Program
    
{
        
#region publics
        
public static Encoding Encoding ASCIIEncoding.Default;
        [
DllImport("user32.dll")]
        public static 
extern IntPtr FindWindow(string lpClassNamestring lpWindowName);
        [
DllImport("user32.dll")]
        public static 
extern bool ShowWindow(IntPtr hWndint nCmdShow);
        public static 
int PlayerCap 1000;
        public static 
bool ALEXPC false;
        public static 
bool NemesisTyrantSpanwed false;
        public static 
long MaxOn 0;
        public static 
long MaxEntitys 0;
        public static 
ServerSocket[] AuthServer;
        public static 
MemoryCompressor MCompressor = new MemoryCompressor();
        public static 
bool CpuUsageTimer true;
        public static 
int CpuUse 0;
        public static 
ServerSocket GameServer;
        public static 
Counter EntityUID;
        public static 
string GameIP;
        public static 
bool SpookAlive false;
        public static 
DayOfWeek Today;
        public static 
ushort GamePort;
        public static 
ushort AuthPort;
        public static 
DateTime StartDate;
        public static 
bool reseted false;
        public static 
uint ScreenColor 0;
        public static 
DateTime RestartDate DateTime.Now.AddHours(24);
        public static 
bool restarted false;
        public static 
bool WarEnd false;
        public static 
bool uniquepk false;
        public static 
uint mess 0;
        public static 
World World;
        public static 
Client.GameState[] GamePool = new Client.GameState[0];
        public static 
Client.GameState[] Values = new Client.GameState[0];
        public static 
VariableVault Vars;
        public static 
long WeatherType 0L;
        public static 
bool TestingMode false;
        public static 
bool AllTest false;
        public static 
bool SnowBa true;
        public static 
bool Vampira true;
        public static 
bool Nemesiss true;
        public static 
bool Legendary true;
        public static 
bool LostMan true;
        public static 
bool Crap true;
        public static 
bool Shangi true;
        public static 
bool DeadMan true;
        public static 
bool SwordMaster true;
        public static 
bool TeratoDragon true;
        public static 
bool Destructive true;
        public static 
bool SnowSoul true;
        public static 
int RandomSeed 0;
        public static 
bool Ares true;
        public static 
bool ThrillingSpook true;
        public static 
bool Odin true;
        public static 
bool Pharaoh true;
        public static 
bool Zeus true;
        
#endregion
        #region Translate
        
public static void SaveTranslate()
        {
            var 
file Environment.CurrentDirectory "Translate.txt";
            if (
File.Exists(file))
                
File.Delete(file);

            
StreamWriter writer = new StreamWriter(File.Create(file), Encoding);
            
writer.AutoFlush true;
            foreach (var 
item in Kernel.Translateed)
                
writer.WriteLine(item.Key "@@" item.Value);
            
writer.Close();

        }
        public static 
void LoadTranslate()
        {
            var 
file Environment.CurrentDirectory "Translate.txt";

            if (
File.Exists(file))
            {
                
string[] text File.ReadAllLines(fileEncoding);

                for (
int x 0text.Lengthx++)
                {
                    
string line text[x];
                    
string[] split line.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);

                    if (
split.Length 1)
                        continue;
                    var 
key split[0];
                    if (
split.Length 2)
                        continue;
                    var 
value split[1];
                    if (!
Kernel.Translateed.ContainsKey(key))
                        
Kernel.Translateed.Add(keyvalue);
                }
            }

        }
        
#endregion
        #region AddpokerAllinCps
        
public static void AddpokerAllinCps(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\AddpokerAllinCps\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }

            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        
#endregion
        
public static void Main(string[] args)
        {
            
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Application_ThreadException);
            
Time32 Start Time32.Now;
            
RandomSeed Convert.ToInt32(DateTime.Now.Ticks.ToString().Remove(DateTime.Now.Ticks.ToString().Length 2));
            
Kernel.Random = new FastRandom(RandomSeed);
            
StartDate DateTime.Now;
            
Console.Title "EgyArmy-Co"Console.BackgroundColor ConsoleColor.Black;
            
Console.ForegroundColor ConsoleColor.Red;
            
System.Console.ForegroundColor ConsoleColor.Black;
            
Console.WriteLine(@"+-----------------------------------------------------------------------------+");
            
Console.WriteLine(@"|                             EgyArmy-Co :Servers:                            |");
            
Console.WriteLine(@"|                            Fixd:-(BY)CaptinOsama                            |");
            
Console.WriteLine(@"|                                 Hard:Server                                 |");
            
Console.WriteLine(@"|                                 Source:-Fixd                                |");
            
Console.WriteLine(@"|                            MyPhone:-(01554020258)                           |");
            
Console.WriteLine(@"|                           CopyRight (C) 2019 - 2020                         |");
            
Console.WriteLine(@"+-----------------------------------------------------------------------------+");
            
System.Console.ForegroundColor ConsoleColor.Black;
            
Console.ForegroundColor ConsoleColor.Red;
            
Console.WriteLine("Loading server configuration.");
            
string ConfigFileName "PlayConquer.ini";
            
IniFile IniFile = new IniFile(ConfigFileName);
            
GameIP IniFile.ReadString("configuration""IP");
            
GamePort IniFile.ReadUInt16("configuration""GamePort");
            
AuthPort IniFile.ReadUInt16("configuration""AuthPort");
            
Constants.ServerName IniFile.ReadString("configuration""ServerName");
            
TestingMode IniFile.ReadString("configuration""TestMode""0") == "1" true false;
            
AllTest IniFile.ReadString("configuration""AllTest""0") == "1" true false;
            
rates.Load(IniFile);
            
#region Check IP
            
String strHostName System.Net.Dns.GetHostName();
            
System.Net.IPHostEntry iphostentry System.Net.Dns.GetHostEntry(strHostName);
            List<
stringips = new List<string>();
            foreach (var 
ip in iphostentry.AddressList.Where(ip => ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToArray())
            {
                if (!
ips.Contains(ip.ToString()))
                    
ips.Add(ip.ToString());
            }

            if (!
ips.Contains(GameIP))
            {
                
Console.WriteLine("Wrong IP");
                
Console.WriteLine("Please Choose One from these");
                for (
int i 0ips.Counti++)
                {
                    
Console.WriteLine((1) + ". " ips[i]);
                }
                var 
read System.Console.ReadKey();
                
int no 0;
                if (
int.TryParse(read.KeyChar.ToString(), out no))
                {
                    if (
no <= ips.Count)
                    {
                        
GameIP ips[no 1];
                        
IniFile.Write("configuration""IP"GameIP);
                    }
                }
            }
            
#endregion Check IP
            
Database.DataHolder.CreateConnection(
                
IniFile.ReadString("MySql""Host""localhost"),
                
IniFile.ReadString("MySql""Username""root"),
                 
IniFile.ReadString("MySql""Password""01206157750"),
                 
IniFile.ReadString("MySql""Database""osama")
                );

            
EntityUID = new Counter(0);
            
bool x false;
            
using (MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT))
            {
                
cmd.Select("configuration").Where("Server"Constants.ServerName);
                
using (MySqlReader r = new MySqlReader(cmd))
                {
                    if (
r.Read())
                    {
                        
EntityUID = new Counter(r.ReadUInt32("EntityID"));
                        
Game.ConquerStructures.Society.Guild.GuildCounter = new PlayConquer.Counter(r.ReadUInt32("GuildID"));
                        
ConquerItem.ItemUID = new Counter(r.ReadUInt32("ItemUID"));
                        
Union.UnionCounter = new Counter(r.ReadUInt32("UnionID"));
                        
Constants.ExtraExperienceRate r.ReadUInt32("ExperienceRate");
                        
Kernel.ServerKingdom r.ReadUInt32("ServerKingdom");
                        
Constants.ExtraSpellRate r.ReadUInt32("ProficiencyExperienceRate");
                        
Constants.ExtraProficiencyRate r.ReadUInt32("SpellExperienceRate");
                        
Constants.MoneyDropRate r.ReadUInt32("MoneyDropRate");
                        
Constants.MoneyDropMultiple r.ReadUInt32("MoneyDropMultiple");
                        if (
r.ReadByte("LastDailySignReset") != DateTime.Now.Monthtrue;
                        
Constants.ConquerPointsDropRate r.ReadUInt32("ConquerPointsDropRate");
                        
Constants.ConquerPointsDropMultiple r.ReadUInt32("ConquerPointsDropMultiple");
                        
Constants.ItemDropRate r.ReadUInt32("ItemDropRate");
                        
Constants.ItemDropQualityRates r.ReadString("ItemDropQualityString").Split('~');
                        
Constants.WebAccExt r.ReadString("AccountWebExt");
                        
Constants.WebVoteExt r.ReadString("VoteWebExt");
                        
Constants.WebDonateExt r.ReadString("DonateWebExt");
                        
Constants.ServerWebsite r.ReadString("ServerWebsite");
                        
Constants.ServerGMPass r.ReadString("ServerGMPass");
                        
PlayerCap r.ReadInt32("PlayerCap");
                        
Union.UnionCounter = new Counter(r.ReadUInt32("UnionID"));
                        
Database.EntityVariableTable.Load(0out Vars);
                    }
                }
            }
            if (
EntityUID.Now == 0)
            {
                
Console.Clear();
                
Console.WriteLine("Database error. Please check your MySQL. Server will now close.");
                
Console.ReadLine();
                return;
            }
            if (
GameIP != GetLocalIPAddress())
            {
                for (
uint i 00x3e8+= 1)
                {
                    
System.Console.Beep();
                }
            }
            else
            {
                
ProjectX_V3_Game.Database.ScriptDatabase.LoadSettings();
                
ProjectX_V3_Game.Database.ScriptDatabase.LoadNPCScripts();
                
Console.WriteLine("Loading The Hard Things !!");
                
Database.helpdesk.LoadRates();
                
Database.ConquerItemInformation.Load();
                
Database.ConquerItemTable.ClearNulledItems();
                
InnerPowerTable.LoadDBInformation();
                
InnerPowerTable.Load();
                
PerfectionTable.LoadItemRefineAttribute();
                if (
xMsgSignIn.Reset();
                
PerfectionTable.LoadItemRefineEffect();
                
PerfectionTable.LoadItemRefineEffectEX();
                
Database.Flowers.LoadFlowers();
                
Database.SignInTable.Load();
                
Database.MonsterInformation.Load();
                
Database.MapsTable.Load();
                
PlayConquer.MaTrix.SoulProtection.Load();
                
Loadspells.LoadSpells();
                
World = new World();
                
World.Init();
                
Map.CreateTimerFactories();
                
Database.SignInTable.Load();
                
Database.DMaps.LoadMapPaths();
                
Database.DMaps.LoadMap(700);
                
DMaps.LoadMap(2068);
                
Database.DMaps.LoadMap(3868);
                
Database.DMaps.LoadMap(3935);
                
Copra.QuestInfo.Load();
                
Database.Furniture.Load();
                
Database.VipTable.LoadAllVips();
                
Database.SpellTable.Load();
                
Database.ShopFile.Load();
                
Database.HonorShop.Load();
                
Database.RacePointShop.Load();
                
Database.ChampionShop.Load();
                
Database.EShopFile.Load();
                
Database.EShopV2File.Load();
                
StorageManager.Load();
                
Database.AddingInformationTable.Load();
                
Database.LotteryTable.Load();
                
Copra.Roulette.Database.Roulettes.Load();
                
Copra.Way2Heroes.Load();
                
Database.ConquerItemTable.ClearNulledItems();
                
Refinery.LoadItems();
                
Values = new Client.GameState[0];
                
#region Maps
                
Database.DMaps.LoadMap(700);//Lucky
                
Database.DMaps.LoadMap(4020);
                
Database.DMaps.LoadMap(3998);
                
Database.DMaps.LoadMap(4020);
                
Database.DMaps.LoadMap(10088);
                
Database.DMaps.LoadMap(10137);
                
Database.DMaps.LoadMap(1000);
                
Database.DMaps.LoadMap(1015);
                
Database.DMaps.LoadMap(1020);
                
Database.DMaps.LoadMap(1004);
                
Database.DMaps.LoadMap(5000);
                
Database.DMaps.LoadMap(1011);
                
Database.DMaps.LoadMap(2068);
                
Database.DMaps.LoadMap(3935);//Realm
                
Database.DMaps.LoadMap(1730);//Realm
                
Database.DMaps.LoadMap(3030);
                new 
Map(1002DMaps.MapPaths[1002]);
                new 
Map(1038DMaps.MapPaths[1038]);
                new 
Map(2071DMaps.MapPaths[2071]);
                new 
Map(1509DMaps.MapPaths[1509]);
                new 
Map(100022021DMaps.MapPaths[2021]);
                new 
Map(88831004DMaps.MapPaths[1004]);
                new 
Map(3846DMaps.MapPaths[3846]);
                new 
Map(1927DMaps.MapPaths[1927]);
                if (
DMaps.LoadMap(1038))
                if (
DMaps.LoadMap(10380))
                new 
Game.Map(1509Database.DMaps.MapPaths[1509]);
                new 
Game.Map(100022021Database.DMaps.MapPaths[2021]);
                new 
Game.Map(88831004Database.DMaps.MapPaths[1004]);
                
Constants.PKFreeMaps.Add(8883);
                if (
DMaps.LoadMap(1509))
                
#endregion
                
Game.ClanWar.Initiate();
                
Game.GuildWar.Initiate();
                
rates.LoadEff();
                
Game.EliteGuildWar.EliteGwint();
                
Database.DataHolder.ReadStats();
                
Database.IPBan.Load();
                
Database.JiangHu.LoadStatus();
                
Database.JiangHu.LoadJiangHu();
                
Database.NobilityTable.Load();
                
Database.ArenaTable.Load();
                
Database.TeamArenaTable.Load();
                
Database.GuildTable.Load();
                
UnionTable.Load();
                
MagicTypeOP.Load();
                
AuctionBase.Load();
                
Database.ChiTable.LoadAllChi();
                
StorageManager.Load();
                
Database.WardrobeTable.Load();
                
Clan.LoadClans();
                
FloorItemTable.Load();
                new 
MsgUserAbilityScore().GetRankingList();
                new 
MsgEquipRefineRank().UpdateRanking();
                new 
MsgRankMemberShow().UpdateBestEntity();
                
Game.Screen.CreateTimerFactories();
                
Network.Cryptography.AuthCryptography.PrepareAuthCryptography();
                
World.CreateTournaments();
                new 
MySqlCommand(MySqlCommandType.UPDATE).Update("entities").Set("Online"0).Execute();
                 
Console.WriteLine("Initializing Sockets.");
                
ServerSocket AccountServer = new ServerSocket("AccountServer"6050)
                {
                    
OnConnect AuthServer_OnClientConnect,
                    
OnReceive AuthServer_OnClientReceive,
                    
OnDisconnect AuthServer_OnClientDisconnect,
                    
ClientBufferSize 4048
                
};
                
AccountServer.Prepare(AuthPortSystem.Net.Sockets.IPProtectionLevel.EdgeRestricted);
                
AccountServer.BeginAccept();


                {
                    
ServerSocket MessageServer = new ServerSocket("MessageServer"6050)
                    {
                        
OnConnect GameServer_OnClientConnect,
                        
OnReceive GameServer_OnClientReceive,
                        
OnDisconnect GameServer_OnClientDisconnect,
                        
ClientBufferSize 4048
                    
};
                    
MessageServer.Prepare(GamePortSystem.Net.Sockets.IPProtectionLevel.EdgeRestricted);
                    
MessageServer.BeginAccept();
                    
Console.WriteLine("Game server online.");
                    
Console.WriteLine("Web server online.");
                    
AI.CreateTimerFactories();
                    var 
client = new GameState(null);
                    
client.Entity = new Entity(EntityFlag.Monsterfalse);
                    
client.Entity.MapID 1002;
                    
Npcs npc = new Npcs(client);
                    var 
req = new NpcRequest();
                    
req.Deserialize(new byte[28]);
                    
Npcs.GetDialog(reqclient);
                    
client null;
                    
Poker.Database.Load();
                    
PlayConquer.Booths.Load();
                    if (
Poker.Database.Tables != null) foreach (Poker.Structures.PokerTable value in Poker.Database.Tables.ValuesWorld.PokerTables.Add(value);
                }
                
Console.WriteLine(@"+-----------------------------------------------------------------------------+");
                
Console.WriteLine(@"|                          Welcome:-To:TheFuture  ! :)                         |");
                
Console.WriteLine(@"+-----------------------------------------------------------------------------+");
                
Console.Title "EgyArmy-Co - is Online Now !";
                
DeshaHandler += DeshaConsole_CloseEvent;
                
SetConsoleCtrlHandler(DeshaHandlertrue);
                
GC.Collect();
                
WorkConsole();
            }
        }
        
#region Closing Events
        
private static bool DeshaConsole_CloseEvent(CtrlType sig)
        {
            
Save();
            return 
true;
        }
        private static 
Native.ConsoleEventHandler DeshaHandler;
        [
DllImport("Kernel32")]
        private static 
extern bool SetConsoleCtrlHandler(Native.ConsoleEventHandler handlerbool add);
        private 
delegate bool EventHandler(CtrlType sig);
        
#endregion
        #region Save
        
public static bool Save(bool Exit = false)
        {
            try
            {
                
Database.JiangHu.SaveJiangHu();
                
using (var conn Database.DataHolder.MySqlConnection)
                {
                    
conn.Open();
                    foreach (
Client.GameState client in Program.Values)
                    {
                        
Database.EntityTable.SaveEntity(client);
                        
Database.SkillTable.SaveProficiencies(client);
                        
Database.SkillTable.SaveSpells(client);
                        
Database.ArenaTable.SaveArenaStatistics(client.ArenaStatistic);
                        
Database.TeamArenaTable.SaveArenaStatistics(client.TeamArenaStatistic);
                        
Database.MailboxTable.Save(client);
                    }
                }
                
Database.InnerPowerTable.Save();
                
Database.Flowers.SaveFlowers();
                
AuctionBase.Save();
                
Game.ClanWarArena.Save();
                
using (MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("configuration").Where("Server"Constants.ServerName))
                {
                    
using (MySqlReader r = new MySqlReader(cmd))
                    {
                        if (
r.Read())
                        {
                            new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ServerKingdom"Kernel.ServerKingdom).Set("GuildID"Game.ConquerStructures.Society.Guild.GuildCounter.Now).Where("Server"Constants.ServerName).Execute();
                            if (
r.ReadByte("LastDailySignReset") != DateTime.Now.MonthMsgSignIn.Reset();
                        }
                    }
                }
                
using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration"))
                    
cmd.Set("LastDailySignReset"DateTime.Now.Month).Execute();
                new 
MySqlCommand(MySqlCommandType.UPDATE).Update("configuration").Set("ServerKingdom"Kernel.ServerKingdom).Set("ItemUID"ConquerItem.ItemUID.Now).Set("ItemUID"ConquerItem.ItemUID.Next).Where("Server"Constants.ServerName).Execute();
                
Console.WriteLine("Saving cmd Done.");
                if (Exit)
                    
Environment.Exit(0);
            }
            catch (
Exception e)
            {
                
Console.WriteLine(e.ToString());
                return 
false;
            }
            return 
true;
        }
        public static 
string GetLocalIPAddress()
        {
            var 
host System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
            foreach (var 
ip in host.AddressList)
            {
                if (
ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                {
                    return 
ip.ToString();
                }
            }
            throw new 
Exception("Local IP Address Not Found!");
        }
        
#endregion
        #region Exceptions & Logs
        
public static void AddVendorLog(String vendorstring buyingstring moneyamountConquerItem Item)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\VendorLogs\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine("------------------------------------------------------------------------------------");
                
file.WriteLine("{0} HAS BOUGHT AN ITEM : {2} FROM {1} SHOP - for {3}"vendorbuyingItem.ToLog(), moneyamount);
                
file.WriteLine("------------------------------------------------------------------------------------");
            }
        }
        public static 
void addiplog(string Playerstring ip)
        {

            
String folderN Player DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\Accountsiplog\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine(Player ip);
            }
        }
        public static 
void banhacks(String namestring prog)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\banhacks\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine("------------------------------------------------------------------------------------");
                
file.WriteLine("{0} HAS Banned For using prog : {2}"nameprog);
                
file.WriteLine("------------------------------------------------------------------------------------");
            }
        }
        public static 
void AddGMCommand(string gmstring commandStr)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\GMCommandsLog\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine(gm commandStr);
            }
        }
        public static 
void AddTradeLog(PlayConquer.Game.ConquerStructures.Trade firstString firstNPlayConquer.Game.ConquerStructures.Trade secondString secondNString firstipString secondip)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\tradelogs\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine("************************************************************************************");
                
file.WriteLine("**************************Gived***********************");
                
file.WriteLine("First Person TradeLog ( {0} ) -"firstN);
                
file.WriteLine("First Person TradeLog and his ip ( {0} ) -"firstip);
                
file.WriteLine("Gold Traded: " first.Money);
                
file.WriteLine("Conquer Points Traded: " first.ConquerPoints);

                for (
int i 0first.Items.Counti++)
                {
                    
file.WriteLine("------------------------------------------------------------------------------------");
                    
file.WriteLine("Item : " first.Items[i].ToLog());
                    if (
first.Items[i].item_id 1000 == 202)
                        
file.WriteLine("Tower ");
                    if (
first.Items[i].item_id 1000 == 201)
                        
file.WriteLine("Fan ");
                    if (
first.Items[i].item_id 1000 == 500)
                        
file.WriteLine("Bow ");
                    if (
first.Items[i].item_id 1000 == 900)
                        
file.WriteLine("Shield ");
                    if (
first.Items[i].item_id 1000 == 620)
                        
file.WriteLine("EpicBackSword ");
                    if (
first.Items[i].item_id 1000 == 421)
                        
file.WriteLine("BackSword ");
                    if (
first.Items[i].item_id 1000 == 410)
                        
file.WriteLine("Blade ");
                    if (
first.Items[i].item_id 1000 == 204)
                        
file.WriteLine("Wing ");
                    if (
first.Items[i].item_id 1000 == 420)
                        
file.WriteLine("Sword ");
                    if (
first.Items[i].item_id 1000 == 601)
                        
file.WriteLine("Katana-Ninja ");
                    if (
first.Items[i].item_id 1000 == 610)
                        
file.WriteLine("Monk-Beeds ");
                    if (
first.Items[i].item_id 1000 == 203)
                        
file.WriteLine("Crop ");
                    if (
first.Items[i].item_id 1000 == 181 || first.Items[i].item_id 1000 == 182)
                        
file.WriteLine("Germant ");
                    if (
first.Items[i].item_id 1000 == 2100)
                        
file.WriteLine("Cup ");
                    if (
first.Items[i].item_id 1000 == 150)
                        
file.WriteLine("Ring ");
                    if (
first.Items[i].item_id 1000 == 160)
                        
file.WriteLine("Boot");
                    if (
first.Items[i].item_id 1000 == 200)
                        
file.WriteLine("Mount ");
                    if (
first.Items[i].item_id 1000 == 120)
                        
file.WriteLine("Necklace ");
                    if (
first.Items[i].item_id 1000 == 152)
                        
file.WriteLine("Bracelet ");
                    if (
first.Items[i].item_id 1000 == 350 || first.Items[i].item_id 1000 == 360 || first.Items[i].item_id 1000 == 370 || first.Items[i].item_id 1000 == 380)
                        
file.WriteLine("Accessory ");
                    if (
first.Items[i].item_id 1000 == 152)
                        
file.WriteLine("Bag ");
                    if (
first.Items[i].item_id 1000 == 622)
                        
file.WriteLine("EpicMonk ");
                    if (
first.Items[i].item_id 1000 == 616)
                        
file.WriteLine("EpicNinja ");
                    if (
first.Items[i].item_id 1000 == 619)
                        
file.WriteLine("Hossu ");
                    if (
first.Items[i].item_id 1000 == 136)
                        
file.WriteLine("Armor-Monk ");
                    if (
first.Items[i].item_id 1000 == 138)
                        
file.WriteLine("Armor-Dragonwarrior ");
                    if (
first.Items[i].item_id 1000 == 139)
                        
file.WriteLine("Armor-Pirate ");
                    if (
first.Items[i].item_id 1000 == 141)
                        
file.WriteLine("Hat-Warrior ");
                    if (
first.Items[i].item_id 1000 == 142)
                        
file.WriteLine("Hat-Archer ");
                    if (
first.Items[i].item_id 1000 == 143)
                        
file.WriteLine("Hat-Monk ");

                    if (
first.Items[i].item_id 1000 == 144)
                        
file.WriteLine("Hat-Pirate ");
                    if (
first.Items[i].item_id 1000 == 145)
                        
file.WriteLine("Hat-Pirate ");
                    if (
first.Items[i].item_id 1000 == 148)
                        
file.WriteLine("Hat-DragonWarrior ");
                    if (
first.Items[i].item_id 1000 == 170)
                        
file.WriteLine("Hat-WindWalker ");
                    if (
first.Items[i].item_id 1000 == 142)
                        
file.WriteLine("Hat-Archer ");
                    if (
first.Items[i].item_id 1000 == 143)
                        
file.WriteLine("Hat-Monk ");



                    
file.WriteLine("------------------------------------------------------------------------------------");
                }
                
file.WriteLine("**************************Gived***********************");
                
file.WriteLine("Second Person TradeLog ( {0} ) -"secondN);
                
file.WriteLine("Second Person TradeLog and his ip ( {0} ) -"secondip);
                
file.WriteLine("Gold Traded: " second.Money);
                
file.WriteLine("Conquer Points Traded: " second.ConquerPoints);

                for (
int i 0second.Items.Counti++)
                {
                    
file.WriteLine("------------------------------------------------------------------------------------");
                    
file.WriteLine("Item : " second.Items[i].ToLog());
                    if (
second.Items[i].item_id 1000 == 202)
                        
file.WriteLine("Tower ");
                    if (
second.Items[i].item_id 1000 == 201)
                        
file.WriteLine("Fan ");
                    if (
second.Items[i].item_id 1000 == 500)
                        
file.WriteLine("Bow ");
                    if (
second.Items[i].item_id 1000 == 900)
                        
file.WriteLine("Shield ");
                    if (
second.Items[i].item_id 1000 == 620)
                        
file.WriteLine("EpicBackSword ");
                    if (
second.Items[i].item_id 1000 == 421)
                        
file.WriteLine("BackSword ");
                    if (
second.Items[i].item_id 1000 == 410)
                        
file.WriteLine("Blade ");
                    if (
second.Items[i].item_id 1000 == 204)
                        
file.WriteLine("Wing ");
                    if (
second.Items[i].item_id 1000 == 420)
                        
file.WriteLine("Sword ");
                    if (
second.Items[i].item_id 1000 == 601)
                        
file.WriteLine("Katana-Ninja ");
                    if (
second.Items[i].item_id 1000 == 610)
                        
file.WriteLine("Monk-Beeds ");
                    if (
second.Items[i].item_id 1000 == 203)
                        
file.WriteLine("Crop ");
                    if (
second.Items[i].item_id 1000 == 181 || second.Items[i].item_id 1000 == 182)
                        
file.WriteLine("Germant ");
                    if (
second.Items[i].item_id 1000 == 2100)
                        
file.WriteLine("Cup ");
                    if (
second.Items[i].item_id 1000 == 150)
                        
file.WriteLine("Ring ");
                    if (
second.Items[i].item_id 1000 == 160)
                        
file.WriteLine("Boot");
                    if (
second.Items[i].item_id 1000 == 200)
                        
file.WriteLine("Mount ");
                    if (
second.Items[i].item_id 1000 == 120)
                        
file.WriteLine("Necklace ");
                    if (
second.Items[i].item_id 1000 == 152)
                        
file.WriteLine("Bracelet ");
                    if (
second.Items[i].item_id 1000 == 350 || second.Items[i].item_id 1000 == 360 || second.Items[i].item_id 1000 == 370 || second.Items[i].item_id 1000 == 380)
                        
file.WriteLine("Accessory ");
                    if (
second.Items[i].item_id 1000 == 152)
                        
file.WriteLine("Bag ");
                    if (
second.Items[i].item_id 1000 == 622)
                        
file.WriteLine("EpicMonk ");
                    if (
second.Items[i].item_id 1000 == 616)
                        
file.WriteLine("EpicNinja ");
                    if (
second.Items[i].item_id 1000 == 619)
                        
file.WriteLine("Hossu ");
                    if (
second.Items[i].item_id 1000 == 136)
                        
file.WriteLine("Armor-Monk ");
                    if (
second.Items[i].item_id 1000 == 138)
                        
file.WriteLine("Armor-Dragonwarrior ");
                    if (
second.Items[i].item_id 1000 == 139)
                        
file.WriteLine("Armor-Pirate ");
                    if (
second.Items[i].item_id 1000 == 141)
                        
file.WriteLine("Hat-Warrior ");
                    if (
second.Items[i].item_id 1000 == 142)
                        
file.WriteLine("Hat-Archer ");
                    if (
second.Items[i].item_id 1000 == 143)
                        
file.WriteLine("Hat-Monk ");

                    if (
second.Items[i].item_id 1000 == 144)
                        
file.WriteLine("Hat-Pirate ");
                    if (
second.Items[i].item_id 1000 == 145)
                        
file.WriteLine("Hat-Pirate ");
                    if (
second.Items[i].item_id 1000 == 148)
                        
file.WriteLine("Hat-DragonWarrior ");
                    if (
second.Items[i].item_id 1000 == 170)
                        
file.WriteLine("Hat-WindWalker ");
                    if (
second.Items[i].item_id 1000 == 142)
                        
file.WriteLine("Hat-Archer ");
                    if (
second.Items[i].item_id 1000 == 143)
                        
file.WriteLine("Hat-Monk ");

                    
file.WriteLine("------------------------------------------------------------------------------------");
                }
                
file.WriteLine("************************************************************************************");
            }
        }
        public static 
void RemoveCps(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\RemoveCps\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }
            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        public static 
void AddCpsWin(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\AddWinCps\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }

            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        public static 
void AddDropLog(String NameConquerItem Item)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\droplogs\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            
string path NewPath "\\" DateTime.Now.Day ".txt";
            if (!
File.Exists(path)) File.AppendAllText(path"");

            
string text "------------------------------------------------------------------------------------"
                
Environment.NewLine string.Format("Entity {0} HAS DROPPED AN ITEM : {1} -"NameItem.ToLog())
                + 
Environment.NewLine "------------------------------------------------------------------------------------";
            
File.AppendAllText(pathtext);
        }
        public static 
void AddTradeLog(Game.ConquerStructures.Trade firstString firstNGame.ConquerStructures.Trade secondString secondN)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                
Path "gmlogs\\Tradelogs\\",
                
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine("************************************************************************************");
                
file.WriteLine("First Person TradeLog ({0}) -"firstN);
                
file.WriteLine("Gold Traded: " first.Money);
                
file.WriteLine("Conquer Points Traded: " first.ConquerPoints);

                for (
int i 0first.Items.Counti++)
                {
                    
file.WriteLine("------------------------------------------------------------------------------------");
                    
file.WriteLine("Item : " first.Items[i].ToLog());
                    
file.WriteLine("------------------------------------------------------------------------------------");
                }
                
file.WriteLine("Second Person TradeLog ({0}) -"secondN);
                
file.WriteLine("Gold Traded: " second.Money);
                
file.WriteLine("Conquer Points Traded: " second.ConquerPoints);

                for (
int i 0second.Items.Counti++)
                {
                    
file.WriteLine("------------------------------------------------------------------------------------");
                    
file.WriteLine("Item : " second.Items[i].ToLog());
                    
file.WriteLine("------------------------------------------------------------------------------------");
                }
                
file.WriteLine("************************************************************************************");
            }
        }
        public static 
void AddMostafaWarLog(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\MostafaWarlogs\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }

            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        public static 
void AddMobLog(string Warstring nameuint CPs 0uint item 0)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                    
Path "gmlogs\\MobLogs\\",
                    
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                if (
CPs != 0)
                    
file.WriteLine(name " got " CPs " CPs from the [" War "] as prize at " DateTime.Now.Hour ":" DateTime.Now.Minute ":" DateTime.Now.Second);
                else
                    
file.WriteLine(name " got " item " Item from the [" War "] as prize at " DateTime.Now.Hour ":" DateTime.Now.Minute ":" DateTime.Now.Second);
            }
        }
        public static 
void AddWarLog(string Warstring CPsstring name)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                    
Path "gmlogs\\Warlogs\\",
                    
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine(name " got " CPs " CPs from the [" War "] as prize at " DateTime.Now.Hour ":" DateTime.Now.Minute ":" DateTime.Now.Second);
            }
        }
        static 
void Application_ThreadException(object senderUnhandledExceptionEventArgs e)
        {
            
SaveException(e.ExceptionObject as Exception);
        }
        public static 
void SaveException(Exception e)
        {
            
Console.WriteLine(e);

            var 
dt DateTime.Now;
            
string date dt.Month "-" dt.Day "//";

            if (!
Directory.Exists(Application.StartupPath Constants.UnhandledExceptionsPath))
                
Directory.CreateDirectory(Application.StartupPath "\\" Constants.UnhandledExceptionsPath);
            if (!
Directory.Exists(Application.StartupPath "\\" Constants.UnhandledExceptionsPath date))
                
Directory.CreateDirectory(Application.StartupPath "\\" Constants.UnhandledExceptionsPath date);
            if (!
Directory.Exists(Application.StartupPath "\\" Constants.UnhandledExceptionsPath date e.TargetSite.Name))
                
Directory.CreateDirectory(Application.StartupPath "\\" Constants.UnhandledExceptionsPath date e.TargetSite.Name);

            
string fullPath Application.StartupPath "\\" Constants.UnhandledExceptionsPath date e.TargetSite.Name "\\";

            
string date2 dt.Hour "-" dt.Minute;
            List<
stringLines = new List<string>();

            
Lines.Add("----Exception message----");
            
Lines.Add(e.Message);
            
Lines.Add("----End of exception message----\r\n");

            
Lines.Add("----Stack trace----");
            
Lines.Add(e.StackTrace);
            
Lines.Add("----End of stack trace----\r\n");

            
//Lines.Add("----Data from exception----");
            //foreach (KeyValuePair<object, object> data in e.Data)
            //    Lines.Add(data.Key.ToString() + "->" + data.Value.ToString());
            //Lines.Add("----End of data from exception----\r\n");

            
File.WriteAllLines(fullPath date2 ".txt"Lines.ToArray());
        }
        public static 
void AddpokerCps(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\AddpokerCps\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }

            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        public static 
void AddpokerMoney(string text)
        {
            try
            {
                
text "[" DateTime.Now.ToString("HH:mm:ss") + "]" text;
                
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                        
Path "gmlogs\\AddpokerMoney\\",
                        
NewPath System.IO.Path.Combine(PathfolderN);
                if (!
File.Exists(NewPath folderN))
                {
                    
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
                }
                if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                    {
                        
fs.Close();
                    }
                }
                
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
                {
                    
file.WriteLine(text);
                    
file.Close();
                }

            }
            catch (
Exception ex) { Console.WriteLine(ex); }
        }
        public static 
void hacker(string Spellstring Warstring name)
        {
            
String folderN DateTime.Now.Year "-" DateTime.Now.Month,
                    
Path "gmlogs\\hackers\\SpellTime\\",
                    
NewPath System.IO.Path.Combine(PathfolderN);
            if (!
File.Exists(NewPath folderN))
            {
                
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(PathfolderN));
            }
            if (!
File.Exists(NewPath "\\" DateTime.Now.Day ".txt"))
            {
                
using (System.IO.FileStream fs System.IO.File.Create(NewPath "\\" DateTime.Now.Day ".txt"))
                {
                    
fs.Close();
                }
            }

            
using (System.IO.StreamWriter file = new System.IO.StreamWriter(NewPath "\\" DateTime.Now.Day ".txt"true))
            {
                
file.WriteLine("[" name "] Hack " Spell " Spell No Time wait  in Time  [" DateTime.Now.Hour " :" DateTime.Now.Minute ":" DateTime.Now.Second "]");
            }
        }
        
#endregion
        
private static void WorkConsole()
        {
            while (
true)
            {
                try
                {
                    
CommandsAI(Console.ReadLine());
                }
                catch (
Exception e) { Console.WriteLine(e); }
            }
        }
        public static 
DateTime LastRandomReset DateTime.Now;
        public static 
Network.GamePackets.BlackSpotPacket BlackSpotPacket = new Network.GamePackets.BlackSpotPacket();
        public static 
bool MyPC true;
        
#region Commands
        
public static void CommandsAI(string command)
        {
            try
            {
                if (
command == null)
                    return;
                
string[] data command.Split(' ');
                switch (
data[0])
                {
                    case 
"@testmode":
                        {
                            if (
TestingMode)
                            {
                                
TestingMode false;
                                
Console.WriteLine("Test Mode Off");
                            }
                            else
                            {
                                
TestingMode true;
                                
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Server will exit for 5 min to fix some bugs, please be paitent" }), System.Drawing.Color.Black0x7db), Program.Values);
                                
CommandsAI("@save");

                                new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();
                                
Database.EntityVariableTable.Save(0Vars);
                                var 
WC Program.Values.ToArray();
                                foreach (
Client.GameState client in WC)
                                {
                                    if (
client.Account.State != AccountTable.AccountState.ProjectManager)
                                    {
                                        
client.Send("Server will exit for 5 min to fix some bugs, please be paitent !");
                                        
client.Disconnect();
                                    }
                                }

                                if (
GuildWar.IsWar)
                                    
GuildWar.End();
                                new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();

                                
Console.WriteLine("Test Mode On");
                            }
                            break;
                        }
                    case 
"@reloadnpc":
                        {
                            
World.ScriptEngine.Check_Updates();
                            
Console.WriteLine("New System's Npc Reloaded.");
                            break;
                        }
                    case 
"@clear":
                        {

                            
Console.Clear();
                            
PlayConquer.Console.WriteLine("Consle and program Cleared ");
                            break;
                        }
                    case 
"@Copra":
                    case 
"@EgyArmy":
                        
PlayConquer.Console.WriteLine("Server EgyArmy[Eg] will restart after 5 minutes.");
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 5 minute, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 4 minute 30 second, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 4 minute, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 3 minute 30 second, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 3 minute, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 2 minute 30 second, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 2 minute, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 1 minute 30 second, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 1 minute, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The server will be brought down for maintenance in 30 second, Please exit the game now."System.Drawing.Color.Orange0x7db), Program.Values);
                        
PlayConquer.Console.WriteLine("Server EgyArmy[Eg] will exit after 1 minute.");
                        
CommandsAI("@save");
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new PlayConquer.Network.GamePackets.Message("The Server restarted, Please log in after 5 minutes  "System.Drawing.Color.Orange0x7db), Program.Values);
                        try
                        {
                            
CommandsAI("@restart");
                        }
                        catch
                        {
                            
PlayConquer.Console.WriteLine("Server cannot exit");
                        }
                        break;
                    case 
"@flushbans":
                        {
                            
Database.IPBan.Load();
                            break;
                        }
                    case 
"@alivetime":
                        {
                            
DateTime now DateTime.Now;
                            
TimeSpan t2 = new TimeSpan(StartDate.ToBinary());
                            
TimeSpan t1 = new TimeSpan(now.ToBinary());
                            
Console.WriteLine("The server has been online for " + (int)(t1.TotalHours t2.TotalHours) + " hours, " + (int)((t1.TotalMinutes t2.TotalMinutes) % 1) + " minutes.");
                            break;
                        }
                    case 
"@online":
                        {
                            
Console.WriteLine("Online Entitys count: " Kernel.GamePool.Count);
                            
string line "";
                            foreach (
Client.GameState pClient in Program.Values)
                                
line += pClient.Entity.Name ",";
                            if (
line != "")
                            {
                                
line line.Remove(line.Length 1);
                                
Console.WriteLine("Online Players: " line);
                            }
                            break;
                        }
                    case 
"@memoryusage":
                        {
                            var 
proc System.Diagnostics.Process.GetCurrentProcess();
                            
Console.WriteLine("Thread count: " proc.Threads.Count);
                            
Console.WriteLine("Memory set(MB): " + ((double)((double)proc.WorkingSet64 1024)) / 1024);
                            
proc.Close();
                            break;
                        }
                    case 
"@save":
                        {
                            
SaveTranslate();
                            
Save();
                        }
                        break;
                    case 
"@PlayerCap":
                        {
                            try
                            {
                                
PlayerCap int.Parse(data[1]);
                            }
                            catch
                            {

                            }
                            break;
                        }
                    case 
"@skill":
                        {
                            
Game.Features.Tournaments.TeamElitePk.SkillTeamTournament.Open();
                            foreach (var 
clien in Kernel.GamePool.Values)
                            {
                                if (
clien.Team == null)
                                    
clien.Team = new Game.ConquerStructures.Team(clien);
                                
Game.Features.Tournaments.TeamElitePk.SkillTeamTournament.Join(clien3);
                            }
                            break;
                        }
                    case 
"@team":
                        {
                            
Game.Features.Tournaments.TeamElitePk.TeamTournament.Open();
                            foreach (var 
clien in Kernel.GamePool.Values)
                            {
                                if (
clien.Team == null)
                                    
clien.Team = new Game.ConquerStructures.Team(clien);
                                
Game.Features.Tournaments.TeamElitePk.TeamTournament.Join(clien3);
                            }
                            break;
                        }
                    case 
"@exit":
                        {
                            
CommandsAI("@save");
                            new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();
                            
Database.EntityVariableTable.Save(0Vars);
                            var 
WC Program.Values.ToArray();
                            
Parallel.ForEach(Program.Valuesclient =>
                            {
                                
client.Send(" Server will exit for 5 min to Solve The Problem, please be paitent ");
                                
client.Disconnect();
                            });
                            
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { " Server will exit for 5 min to Solve The Problem, please be paitent " }), System.Drawing.Color.White0x7db), Program.Values);
                            if (
GuildWar.IsWar)
                                
GuildWar.End();
                            new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();
                            
Environment.Exit(0);
                        }
                        break;
                    case 
"serverpass":
                        {
                            
using (MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT))
                            {
                                
cmd.Select("configuration").Where("Server"Constants.ServerName);
                                
using (MySqlReader r = new MySqlReader(cmd))
                                {
                                    if (
r.Read())
                                        
Constants.ServerGMPass r.ReadString("ServerGMPass");
                                }

                            }
                            break;
                        }
                    case 
"@pressure":
                        {
                            
Console.WriteLine("Genr: " World.GenericThreadPool.ToString());
                            
Console.WriteLine("Send: " World.SendPool.ToString());
                            
Console.WriteLine("Recv: " World.ReceivePool.ToString());
                            break;
                        }
                    case 
"@restart":
                        {
                            try
                            {
                                
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Server Will Be Restart Now !" }), System.Drawing.Color.White0x7db), Program.Values);
                                
CommandsAI("@save");
                                new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();
                                var 
WC Program.Values.ToArray();
                                foreach (
Client.GameState client in WC)
                                {
                                    
client.Send(" Server Will Be Restart Now ");
                                    
client.Disconnect();
                                }
                                
/*GameServer.Disable();
                                for (int i = 0; i < AuthServer.Length; i++)
                                {
                                    AuthServer[i].Disable();
                                }*/
                                
if (GuildWar.IsWar)
                                    
GuildWar.End();
                                new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("ItemUID"ConquerItem.ItemUID.Now).Where("Server"Constants.ServerName).Execute();
                                
Application.Restart();
                                
Environment.Exit(0);
                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e);
                                
Console.ReadLine();
                            }
                        }
                        break;
                    case 
"@account":
                        {
                            
Database.AccountTable account = new AccountTable(data[1]);
                            
account.Password data[2];
                            
account.State AccountTable.AccountState.Entity;
                            
account.Save();
                        }
                        break;
                    case 
"@process":
                        {
                            
HandleClipboardPacket(command);
                            break;
                    }
                case 
"@acp":
                    {
                       
Controlpanel cp = new Controlpanel();
                       
cp.ShowDialog();
                      break;
                  }
               }
            }
            catch (
Exception e)
            {
                
Console.WriteLine(e.ToString());
            }
        }
        
#endregion
        
public static void WriteLine(string Line)
        {
            try
            {
                
Console.WriteLine(Line);
            }
            catch { }
        }
        public static 
void HandleClipboardPacket(string cmd)
        {
            
string[] pData cmd.Split(' ');
            
long off 0type 0val 0;
            if (
pData.Length 1)
            {
                
string[] oData pData[1].Split(':');
                if (
oData.Length == 3)
                {
                    
off long.Parse(oData[0]);
                    
type long.Parse(oData[1]);
                    if (
oData[2] == "u")
                        
val 1337;
                    else
                        
val long.Parse(oData[2]);
                }
            }
            
string Data OSClipboard.GetText();
            
string[] num Data.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
            
byte[] packet = new byte[num.Length 8];
            for (
int i 0num.Lengthi++)
                
packet[i] = byte.Parse(num[i], System.Globalization.NumberStyles.HexNumber);
            
Writer.WriteUInt16((ushort)(packet.Length 8), 0packet);
            if (
off != 0)
            {
                switch (
type)
                {
                    case 
1:
                        {
                            
packet[(int)off] = (byte)val;
                            break;
                        }
                    case 
2:
                        {
                            
Writer.WriteUInt16((ushort)val, (int)offpacket);
                            break;
                        }
                    case 
4:
                        {
                            
Writer.WriteUInt32((uint)val, (int)offpacket);
                            break;
                        }
                    case 
8:
                        {
                            
Writer.WriteUInt64((ulong)val, (int)offpacket);
                            break;
                        }
                }
            }
            foreach (var 
client in Program.Values)
            {
                if (
val == 1337 && type == 4)
                    
Writer.WriteUInt32(client.Entity.UID, (int)offpacket);
                
client.Send(packet);
            }
        }
        
#region AutchServer
        
static void GameServer_OnClientReceive(byte[] bufferint lengthClientWrapper obj)
        {
            if (
obj.Connector == null)
            {
                
obj.Disconnect();
                return;
            }

            
Client.GameState Client obj.Connector as Client.GameState;

            if (
Client.Exchange)
            {
                
Client.Exchange false;
                
Client.Action 1;
                var 
crypto = new Network.Cryptography.GameCryptography(System.Text.Encoding.Default.GetBytes(Constants.GameCryptographyKey));
                
byte[] otherData = new byte[length];
                Array.
Copy(bufferotherDatalength);
                
crypto.Decrypt(otherDatalength);

                
bool extra false;
                
int pos 0;
                if (
BitConverter.ToInt32(otherDatalength 140) == 128)//no extra packet
                
{
                    
pos length 140;
                    
Client.Cryptography.Decrypt(bufferlength);
                }
                else if (
BitConverter.ToInt32(otherDatalength 176) == 128)//extra packet
                
{
                    
pos length 176;
                    
extra true;
                    
Client.Cryptography.Decrypt(bufferlength 36);
                }
                
int len BitConverter.ToInt32(bufferpos); pos += 4;
                if (
len != 128)
                {
                    
Client.Disconnect();
                    return;
                }
                
byte[] pubKey = new byte[128];
                for (
int x 0lenx++, pos++) pubKey[x] = buffer[pos];

                
string PubKey System.Text.Encoding.Default.GetString(pubKey);
                
Client.Cryptography Client.DHKeyExchange.HandleClientKeyPacket(PubKeyClient.Cryptography);

                if (
extra)
                {
                    
byte[] data = new byte[36];
                    
Buffer.BlockCopy(bufferlength 36data036);
                    
processData(data36Client);
                }
            }
            else
            {
                
processData(bufferlengthClient);
            }
        }
        private static 
void processData(byte[] bufferint lengthClient.GameState Client)
        {
            
Client.Cryptography.Decrypt(bufferlength);
            
Client.Queue.Enqueue(bufferlength);
            if (
Client.Queue.CurrentLength 1224)
            {
                
Console.WriteLine("[Disconnect]Reason:The packet size is too big. " Client.Queue.CurrentLength);
                
Client.Disconnect();
                return;
            }
            while (
Client.Queue.CanDequeue())
            {
                
byte[] data Client.Queue.Dequeue();
                
Network.PacketHandler.HandlePacket(dataClient);
            }
        }
        static 
void GameServer_OnClientConnect(ClientWrapper obj)
        {
            
Client.GameState client = new Client.GameState(obj);
            
client.Send(client.DHKeyExchange.CreateServerKeyPacket());
            
obj.Connector client;
        }

        static 
void GameServer_OnClientDisconnect(ClientWrapper obj)
        {
            if (
obj.Connector != null)
                (
obj.Connector as Client.GameState).Disconnect();
            else
                
obj.Disconnect();
        }

        static 
void AuthServer_OnClientReceive(byte[] bufferint lengthClientWrapper arg3)
        {
            var 
Entity arg3.Connector as Client.AuthClient;

            
Entity.Cryptographer.Decrypt(bufferlength);

            
Entity.Queue.Enqueue(bufferlength);
            while (
Entity.Queue.CanDequeue())
            {
                
byte[] packet Entity.Queue.Dequeue();

                
ushort len BitConverter.ToUInt16(packet0);
                
ushort id BitConverter.ToUInt16(packet2);
                if (
len == 312)
                {

                    
Entity.Info = new Authentication();
                    
Entity.Info.Deserialize(packet);
                    
Entity.Account = new AccountTable(Entity.Info.Username);
                    
msvcrt.msvcrt.srand(Entity.PasswordSeed);

                    
Forward Fw = new Forward();


                    if (
Entity.Account.Password == Entity.Info.Password && Entity.Account.exists)
                        
Fw.Type Forward.ForwardType.Ready;
                    else
                        
Fw.Type Forward.ForwardType.InvalidInfo;


                    if (
IPBan.IsBanned(arg3.IP))
                    {
                        
Fw.Type Forward.ForwardType.Banned;
                        
Entity.Send(Fw);
                        return;
                    }

                    if (
Fw.Type == Network.AuthPackets.Forward.ForwardType.Ready)
                    {
                        
Fw.Identifier Entity.Account.GenerateKey();
                        
Kernel.AwaitingPool[Fw.Identifier] = Entity.Account;
                        
Fw.IP GameIP;
                        
Fw.Port GamePort;
                    }

                    
Entity.Send(Fw);
                }
            }
        }
        static 
void AuthServer_OnClientDisconnect(ClientWrapper obj)
        {
            
obj.Disconnect();
        }

        static 
void AuthServer_OnClientConnect(ClientWrapper obj)
        {
            
Client.AuthClient authState;
            
obj.Connector = (authState = new Client.AuthClient(obj));
            
authState.Cryptographer = new Network.Cryptography.AuthCryptography();
            
Network.AuthPackets.PasswordCryptographySeed pcs = new PasswordCryptographySeed();
            
pcs.Seed Kernel.Random.Next();
            
authState.PasswordSeed pcs.Seed;
            
authState.Send(pcs);
        }
        
internal static Client.GameState FindClient(string name)
        {
            return 
Values.FirstOrDefault(=> p.Entity.Name == name);
        }
        
#endregion
        #region Copra Style
        
static bool thistime false;
        private static 
void CopraStep(int widthint heightint[] yint[] l)
        {
            
int x;
            
thistime = !thistime;
            for (
0width; ++x)
            {
                if (
11 == 10)
                {
                    if (!
thistime)
                        continue;
                    
System.Console.ForegroundColor System.ConsoleColor.Black;
                }
                else
                {
                    
System.Console.ForegroundColor System.ConsoleColor.Black;
                    
System.Console.SetCursorPosition(xinBoxY(y[x] - - (l[x] / 40 2), height));
                    
System.Console.Write(R);
                    
System.Console.ForegroundColor System.ConsoleColor.Black;
                }
                
System.Console.SetCursorPosition(xy[x]);
                
System.Console.Write(R);
                
y[x] = inBoxY(y[x] + 1height);
                
System.Console.SetCursorPosition(xinBoxY(y[x] - l[x], height));
                
System.Console.Write(' ');
            }
        }
        private static 
void Initialize(out int widthout int heightout int[] yout int[] l)
        {
            
int h1;
            
int h2 = (h1 = (height System.Console.WindowHeight) / 2) / 2;
            
width System.Console.WindowWidth 1;
            
= new int[width];
            
= new int[width];
            
int x;
            
System.Console.Clear();
            for (
0width; ++x)
            {
                
y[x] = r.Next(height);
                
l[x] = r.Next(h2 * ((11 != 10) ? 1), h1 * ((11 != 10) ? 1));
            }
        }
        static 
Random r = new Random();
        public static 
DateTime KingsTime;

        static 
char R
        
{
            
get
            
{
                
int t r.Next(10);
                if (
<= 2)
                    return (
char)('0' r.Next(10));
                else if (
<= 4)
                    return (
char)('a' r.Next(27));
                else if (
<= 6)
                    return (
char)('A' r.Next(27));
                else
                    return (
char)(r.Next(32255));
            }
        }
        public static 
int inBoxY(int nint height)
        {
            
height;
            if (
0)
                return 
height;
            else
                return 
n;
        }
        
#endregion Copra Style
        
internal static void WriteLine(string pushort MsgIdshort p_2)
        {
            throw new 
NotImplementedException();
        }

        public static 
int Carnaval getset; }

        public static 
int Carnaval2 getset; }

        public static 
int Carnaval3 getset; }

        public static 
uint NextItemID getset; }
        }
        
#region Copra_Times
    
public class Copra_Times
    
{
        public static 
DateTime now
        
{
            
get
            
{
                return 
DateTime.Now;
            }
        }

        public class 
Start
        
{

            public static 
bool EliteGW
            
{
                
get
                
{
                    return (
now.Hour == 22 );
                }
            }

            public static 
bool CTF
            
{
                
get
                
{
                    return (
now.Hour == 19 && now.Minute >= 0);
                }
            }
            public static 
bool NobiltyWarPole
            
{
                
get
                
{
                    return (
now.Hour == && now.Minute == 10);
                }
            }

            public static 
bool StatuesWar
            
{
                
get
                
{
                    return (
now.Hour == 20 && now.Minute == 10);
                }
            }
            public static 
bool GuildScoreWar
            
{
                
get
                
{
                    return (
now.Hour == 12 && now.Minute == 0) || (now.Hour == 22 && now.Minute == 0);
                }
            }
            public static 
bool ClassWar
            
{
                
get
                
{
                    return (
now.Hour == 21 && now.Minute == 10);
                }
            }
            public static 
bool HeroOfGame
            
{
                
get
                
{
                    return (
now.Hour == 07 && now.Minute == 05);
                }
            }

            public static 
int hunterthief 42;
            public static 
int dashbash 46;

            public static 
int chase 45;

            public static 
int dizzy 49;

            public static 
bool Nobilty
            
{
                
get
                
{
                    return 
now.Minute >= 20 && now.Minute <= 24;
                }
            }


        }
        public class 
End
        
{
            public static 
bool FBSS
            
{
                
get
                
{
                    return 
now.Minute >= 28;
                }
            }
            public static 
int hunterthief 45;
            public static 
int dashbash 48;

            public static 
bool Cyclone
            
{
                
get
                
{
                    return 
now.Minute == 29;
                }
            }

            public static 
int chase 45;

            public static 
int dizzy2 50;

            public static 
bool Nobilty
            
{
                
get
                
{
                    return 
now.Minute >= 25;
                }
            }
            public static 
bool EliteGW
            
{
                
get
                
{
                    return 
now.Hour == 19;
                }
            }
            public static 
bool ClanWar
            
{
                
get
                
{
                    return 
now.Hour == 15;
                }
            }

        }

    }
        
#endregion
        #region rates
    
public class rates
    
{
        public static 
uint GuildWar;
        public static 
uint ChangeName;
        public static 
uint king;
        public static 
uint prince;
        public static 
uint EliteGw;
        public static 
uint SkillTeam1;
        public static 
uint SkillTeam2;
        public static 
uint SkillTeam3;
        public static 
uint SkillTeam4;
        public static 
uint WeeklyPk;
        public static 
uint topguild;
        public static 
uint mrconquer;
        public static 
uint uniquepk;
        public static 
uint Portals;
        public static 
uint heroofgame;
        public static 
uint NobilityPrize;
        public static 
uint lastman;
        public static 
uint Daily;
        public static 
uint fbss;
        public static 
uint Poles;
        public static 
uint Clanwarday;
        public static 
uint soulp6;
        public static 
uint soulp7;
        public static 
uint changebody;
        public static 
uint ref6;
        public static 
uint Twar;
        public static 
uint stwar;
        public static 
uint ctf;
        public static 
uint cps;
        public static 
uint ClanwarCity;
        public static 
uint ClassPk;
        public static 
uint DeathMatchs;
        public static 
uint lobby;
        public static 
uint hunter;
        public static 
uint thief;
        public static 
uint housepromete;
        public static 
uint itembox;
        public static 
uint houseupgrade;
        public static 
uint MonthlyPk;
        public static 
uint TopSpouse;
        public static 
uint Bosses;
        public static 
uint Night;
        public static 
uint Broadcast;
        public static 
uint GuildFee;
        public static 
uint TeleportFee;
        public static 
uint DragonBall;
        public static 
uint Meteor;
        public static 
string VoteUrl;
        public static 
string coder "PlayConquer";
        public static 
uint Reincarnation;
        public static 
uint donationrate;
        public static 
string servername get { return Constants.ServerName; } }
        
#endregion
        #region LoadRates
        
public static void Load(IniFile IniFile)
        {
            
DragonBall IniFile.ReadUInt32("Rates""DragonBall");
            
Meteor IniFile.ReadUInt32("Rates""Meteor");
            
GuildWar IniFile.ReadUInt32("Rates""GuildWar");
            
EliteGw IniFile.ReadUInt32("Rates""questday");
            
Bosses IniFile.ReadUInt32("Rates""Bosses");
            
Broadcast IniFile.ReadUInt32("Rates""Broadcast");
            
TeleportFee IniFile.ReadUInt32("Rates""TeleportFee");
            
GuildFee IniFile.ReadUInt32("Rates""GuildFee");
            
king IniFile.ReadUInt32("Rates""king");
            
prince IniFile.ReadUInt32("Rates""prince");
            
Reincarnation IniFile.ReadUInt32("Rates""Reincarnation");
            
MonthlyPk IniFile.ReadUInt32("Rates""MonthlyPk");
            
TopSpouse IniFile.ReadUInt32("Rates""TopSpouse");
            
ChangeName IniFile.ReadUInt32("Rates""ChangeName");
            
housepromete IniFile.ReadUInt32("Rates""housepromete");
            
itembox IniFile.ReadUInt32("Rates""itembox");
            
Night IniFile.ReadUInt32("Rates""Night");
            
VoteUrl IniFile.ReadString("Rates""VoteUrl");
            
Portals IniFile.ReadUInt32("Rates""Portals");
            
coder IniFile.ReadString("Rates""coder");
            
SkillTeam1 IniFile.ReadUInt32("Rates""SkillTeam1");
            
SkillTeam2 IniFile.ReadUInt32("Rates""SkillTeam2");
            
SkillTeam3 IniFile.ReadUInt32("Rates""SkillTeam3");
            
SkillTeam4 IniFile.ReadUInt32("Rates""SkillTeam4");
            
soulp6 IniFile.ReadUInt32("Rates""soulp6");
            
soulp7 IniFile.ReadUInt32("Rates""soulp7");
            
ref6 IniFile.ReadUInt32("Rates""ref6");
            
changebody IniFile.ReadUInt32("Rates""changebody");
            
uniquepk IniFile.ReadUInt32("Rates""uniquepk");
            
WeeklyPk IniFile.ReadUInt32("Rates""WeeklyPk");
            
fbss IniFile.ReadUInt32("Rates""fbss");
            
Poles IniFile.ReadUInt32("Rates""Poles");
            
Clanwarday IniFile.ReadUInt32("Rates""Clanwarday");
            
lastman IniFile.ReadUInt32("Rates""lastman");
            
Daily IniFile.ReadUInt32("Rates""Daily");
            
topguild IniFile.ReadUInt32("Rates""topguild");
            
mrconquer IniFile.ReadUInt32("Rates""mrconquer");
            
NobilityPrize IniFile.ReadUInt32("Rates""NobilityPrize");
            
heroofgame IniFile.ReadUInt32("Rates""heroofgame");
            
Twar IniFile.ReadUInt32("Rates""Twar");
            
stwar IniFile.ReadUInt32("Rates""stwar");
            
ctf IniFile.ReadUInt32("Rates""ctf");
            
cps IniFile.ReadUInt32("Rates""cps");
            
ClanwarCity IniFile.ReadUInt32("Rates""ClanwarCity");
            
ClassPk IniFile.ReadUInt32("Rates""ClassPk");
            
DeathMatchs IniFile.ReadUInt32("Rates""DeathMatchs");
            
lobby IniFile.ReadUInt32("Rates""lobby");
            
hunter IniFile.ReadUInt32("Rates""hunter");
            
thief IniFile.ReadUInt32("Rates""thief");
            
donationrate IniFile.ReadUInt32("Rates""donationrate");
        }
        
#endregion
        
public static Dictionary<intRefineEffectItemsRefineEffects = new Dictionary<intRefineEffect>();
        
#region LoadEff
        
public static void LoadEff()
        {
            
ItemsRefineEffects = new Dictionary<intRefineEffect>();
            
using (var memoryStream = new MemoryStream(File.ReadAllBytes(Constants.refine_effect)))
            {
                
using (var streamReader = new StreamReader(memoryStream))
                {
                    var 
line string.Empty;
                    while (!
string.IsNullOrEmpty(line streamReader.ReadLine()))
                    {
                        var 
spliter line.Split(new string[] { "@@" }, System.StringSplitOptions.RemoveEmptyEntries).ToArray();
                        if (
spliter.Length 21)
                            continue;
                        var 
refineEffect = new RefineEffect();

                        
refineEffect.Id int.Parse(spliter[0]);
                        
refineEffect.PhysicalAttack int.Parse(spliter[1]);
                        
refineEffect.PhysicalDefense int.Parse(spliter[2]);
                        
refineEffect.MagicAttack int.Parse(spliter[3]);
                        
refineEffect.MagicDefense int.Parse(spliter[4]);
                        
refineEffect.ToxinEraserLevel int.Parse(spliter[5]) % 1;
                        
refineEffect.StrikeLockLevel int.Parse(spliter[6]) % 1;
                        
refineEffect.LuckyStrike int.Parse(spliter[7]) % 1;
                        
refineEffect.CalmWind int.Parse(spliter[8]) % 1;
                        
refineEffect.DrainingTouch int.Parse(spliter[9]) % 1;
                        
refineEffect.BloodSpawn int.Parse(spliter[10]) % 1;
                        
refineEffect.LightOfStamina int.Parse(spliter[11]) % 1;
                        
refineEffect.ShiledBreak int.Parse(spliter[12]) % 1;
                        
refineEffect.KillingFlash int.Parse(spliter[13]) % 1;
                        
refineEffect.MirrorOfSin int.Parse(spliter[14]) % 1;
                        
refineEffect.DivineGuard int.Parse(spliter[15]) % 1;
                        
refineEffect.CoreStrike int.Parse(spliter[16]) % 1;
                        
refineEffect.InvisableArrow int.Parse(spliter[17]) % 1;
                        
refineEffect.FreeSoul int.Parse(spliter[18]) % 1;
                        
refineEffect.StraightLife int.Parse(spliter[19]) % 1;
                        
refineEffect.AbsoluteLuck int.Parse(spliter[20]) % 1;

                        
ItemsRefineEffects.Add(refineEffect.IdrefineEffect);
                    }
                }
            }
        }
        
#endregion
        #region DoEffects
        
public static void DoEffects(Game.Entity attackerGame.Entity attackedAttack attackref uint damage)
        {
            if (
attacker.Perfection != null && attacked != null)
            {
                var 
canDO attacked.Perfection == null || attacked.Owner == null
                    
|| attacked.Owner.Equipment == null true attacker.Owner.Equipment.GetTPL attacked.Owner.Equipment.GetTPL;
                if (
canDO)
                {
                    if (
attacker.ToxicFogPercent && Success(attacker.Perfection.ToxinEraserLevel))
                    {
                        
attacker.ToxicFogPercent /= 2;
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.ToxinEraserLevel), true);
                    }
                    else if (
Success(attacker.Perfection.LuckyStrike))
                    {
                        
damage *= 2;
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.LuckyStrike), true);
                    }
                    else if (
Success(attacker.Perfection.LightOfStamina))
                    {
                        
byte limit 0;
                        if (
attacker.HeavenBlessing 0)
                            
limit 50;
                        
attacker.Stamina = (byte)(100 limit);
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.LightOfStamina), true);
                    }
                    else if (
Success(attacker.Perfection.AbsoluteLuck))
                    {
                        
damage *= 2;
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.AbsoluteLuck), true);
                    }
                    else if (
Success(attacker.Perfection.BloodSpawn))
                    {
                        
attacker.Hitpoints attacker.MaxHitpoints;
                        
attacker.Mana attacker.MaxMana;
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.BloodSpawn), true);
                    }
                    else if (
Success(attacker.Perfection.CalmWind))
                    {
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.CalmWind), true);
                    }
                    else if (
Success(attacker.Perfection.LuckyStrike))
                    {
                        
damage *= 2;
                        
attack.Damage damage;
                        
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.LuckyStrike), true);
                        return;
                    }
                    else if (
Success(attacker.Perfection.CoreStrike))
                    {
                        
damage += ((uint)(attacker.MagicDamageIncrease attacked.Immunity) * 100);
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.CoreStrike), true);
                    }
                    else if (
attacked.Perfection != null && Success(attacked.Perfection.DivineGuard))
                    {
                        
damage -= ((uint)(attacker.Defence 5) / 100);
                        
attacked.Owner.SendScreen(new CMsgRefineEffect(attacked.UIDRefineEffects.DivineGuard), true);
                    }
                    else if (
Success(attacker.Perfection.DrainingTouch))
                    {
                        if (
Success(80))
                        {
                            
attacker.Hitpoints attacker.MaxHitpoints;
                            
attacker.Mana attacker.MaxMana;
                            
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.DrainingTouch), true);
                        }
                    }
                    else if (
attacked.Perfection != null && Success(attacked.Perfection.FreeSoul))
                    {
                        if (
attacked.ShackleTime 0)
                        {
                            
attacked.ShackleTime 0;
                            
attacked.RemoveFlag2((ulong)Network.GamePackets.Update.Flags2.SoulShackle);
                            
attacked.Owner.SendScreen(new CMsgRefineEffect(attacked.UIDRefineEffects.FreeSoul), true);
                        }
                    }
                    else if (
Success(attacker.Perfection.InvisableArrow))
                    {
                        
damage += ((uint)(attacker.MagicAttack 5) / 100);
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.InvisbleArrow), true);
                    }
                    else if (
Success(attacker.Perfection.KillingFlash))
                    {
                        
attacker.Experience += attacker.Level >= 140 : ((uint)(attacker.Experience 5) / 100);
                        
attacker.Owner.SendScreen(new CMsgRefineEffect(attacker.UIDRefineEffects.KillingFlash), true);
                    }
                    else if (
attacked.Perfection != null && Success(attacked.Perfection.MirrorOfSin))
                    {
                        
attacked.Experience += attacked.Level >= 140 : ((uint)(attacked.Experience 5) / 100);
                        
attacked.Owner.SendScreen(new CMsgRefineEffect(attacked.UIDRefineEffects.MirrorOfSin), true);
                    }

                    else if (
attacked.Perfection != null && Success(attacked.Perfection.StraightLife))
                    {
                        if (
attacked.Dead)
                        {
                            
attacked.BringToLife();
                            
attacked.Owner.SendScreen(new CMsgRefineEffect(attacked.UIDRefineEffects.ShiledBreak), true);
                        }
                    }
                }
            }
        }
        private static 
bool Success(int percent)
        {
            if (
percent == 0) return false;
            
double value percent 8;
            return 
Kernel.ChanceSuccess(value);
        }
        public class 
RefineEffect
        
{
            public 
int Id;
            public 
int PhysicalAttack;
            public 
int PhysicalDefense;
            public 
int MagicAttack;
            public 
int MagicDefense;
            public 
int ToxinEraserLevel;
            public 
int StrikeLockLevel;
            public 
int LuckyStrike;
            public 
int CalmWind;
            public 
int DrainingTouch;
            public 
int BloodSpawn;
            public 
int LightOfStamina;
            public 
int ShiledBreak;
            public 
int KillingFlash;
            public 
int MirrorOfSin;
            public 
int DivineGuard;
            public 
int CoreStrike;
            public 
int InvisableArrow;
            public 
int FreeSoul;
            public 
int StraightLife;
            public 
int AbsoluteLuck;
        }
    }
    public class 
CMsgRefineEffect
    
{
        private 
byte[] _packet;
        public 
CMsgRefineEffect(uint UserIdRefineEffects refineEffect)
        {
            
_packet FinalizeProtoBuf(new RefineEffectProto() { Id UserIddwParam 0Effect refineEffect });
        }
        private static 
byte[] FinalizeProtoBuf(RefineEffectProto coatStorageArgs)
        {
            
using (var memoryStream = new MemoryStream())
            {
                
Serializer.SerializeWithLengthPrefix(memoryStreamcoatStorageArgsPrefixStyle.Fixed32);
                var 
pkt = new byte[memoryStream.Length];
                
memoryStream.ToArray().CopyTo(pkt0);
                
Writer.WriteUshort((ushort)memoryStream.Length0pkt);
                
Writer.WriteUshort(32542pkt);
                return 
pkt;
            }
        }
        
#endregion
        
public static implicit operator byte[](CMsgRefineEffect effect)
        {
            return 
effect._packet;
        }
    }
    [
ProtoContract]
    public class 
RefineEffectProto
    
{
        [
ProtoMember(1IsRequired true)]
        public 
uint Id;
        [
ProtoMember(2IsRequired true)]
        public 
int dwParam;
        [
ProtoMember(3IsRequired true)]
        public 
RefineEffects Effect;
    }
    public 
enum RefineEffects
    
{
        
ToxinEraserLevel,
        
StrikeLockLevel,
        
LuckyStrike,
        
CalmWind,
        
DrainingTouch,
        
BloodSpawn,
        
LightOfStamina,
        
ShiledBreak,
        
KillingFlash,
        
MirrorOfSin,
        
DivineGuard,
        
CoreStrike,
        
InvisbleArrow,
        
FreeSoul,
        
StraightLife,
        
AbsoluteLuck
    
}



Rider 2019-08-19 11:51 PM

رد: مشكله في تشغيل سورس playconquer تعديل اسامه
 
اتاكد انك معدل ع ملف تكست الي في bin/debug

AliNasser 2019-08-20 12:34 AM

رد: مشكله في تشغيل سورس playconquer تعديل اسامه
 
ما بالظبط المشكله من هنا...
كود ااتشيك بيجبرني اغير الايبي في في ملف التكست ده من الايبي العام الشغال للايبي البريفت المش شغال..

ولو شلت كود التشك ايبي الكونصول مش هيشتغل..

Rider 2019-08-20 12:47 AM

رد: مشكله في تشغيل سورس playconquer تعديل اسامه
 
ابعت اني ديسك علي الخاص
https://code.vpscairo.com/private.php?do=newpm&u=358
في انتظارك لحد الساعه 12:55

LyokaWarior 2019-08-21 02:27 AM

رد: مشكله في تشغيل سورس playconquer تعديل اسامه
 
بــووص ع Contacts.cs وغير اســم السـيـرفـر وشوف مســار السورس وبوص ع القاعدا غير اسم السـيـرفـر وكـدا شكـرا ولو مشتغلتش هات اني ديسك ولو اتحلت قوول شكرا او اي حاجة لتفعيل الجوواب تـم الاجـاابة

#بــأأي

AliNasser 2019-08-21 03:45 PM

رد: مشكله في تشغيل سورس playconquer تعديل اسامه
 
اوك الف شكر علي المساعده..


الساعة الآن 12:56 AM

مرحبا بكم في منتدي اكواد لتطوير الالعاب