قديم 2019-10-25, 01:43 PM
المشاركة #2  
Tefa
  • غير متواجد
افتراضي رد: يارجاله دلؤتي restart مش شغال في السيرفر عندي ولما بقفل القنصل الانر بور بيتمسح
ريستارت ادخل ع بكتب هندلر و حط شفره دي

كود:
case "restart":
                                {
                                    
Program.CommandsAI("@restart");
                                    break;
                                } 

ف Program.cs سيرش CommandsAI
لو لقتها حط جواها

كود:
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; 

لو ملقتهاش ارمي دي فوق private static void Clear()

كود:
 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.White0x7db), 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 
"@clear1":  //شفرة 
                        
{
                            
Program.Clear();
                            
Console.WriteLine("Consle Clear + Memory Optimizeed!!");
                            break;
                        }  
                    case 
"@reloadnpc":
                        {
                            
World.ScriptEngine.Check_Updates();
                            
Console.WriteLine("New System's Npc Reloaded.");
                            break;
                        }
                    case 
"@char":
                    case 
"@cp":
                        {
                            
Controlpanel cp = new Controlpanel();
                            
cp.ShowDialog();
                            break;
                        }
                    case 
"@clear":
                        {

                            
Console.Clear();
                            
Mr_Panda.Console.WriteLine("Consle and program Cleared ");
                            break;
                        }
                    case 
"@rankload":
                        {

                            
Database.NobilityTable.Load();
                            break;
                        }
                    case 
"@Copra":
                    case 
"@bigbos":
                        
Mr_Panda.Console.WriteLine("Server will restart after 10 minutes.");
                        
Kernel.SendWorldMessage(new Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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 Mr_Panda.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);
                        
Mr_Panda.Console.WriteLine("Server will exit after 1 minute.");
                        
CommandsAI("@save");
                        
System.Threading.Thread.Sleep(0x7530);
                        
Kernel.SendWorldMessage(new Mr_Panda.Network.GamePackets.Message("The Server restarted, Please log in after 5 minutes  "System.Drawing.Color.Orange0x7db), Program.Values);
                        try
                        {
                            
CommandsAI("@restart");
                        }
                        catch
                        {
                            
Mr_Panda.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 " + (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.Player.Name ",";
                            if (
line != "")
                            {
                                
line line.Remove(line.Length 1);
                                
Console.WriteLine("Entitys: " 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 
"@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");
                            
/*GameServer.Disable();
                            for (int i = 0; i < AuthServer.Length; i++)
                            {
                                AuthServer[i].Disable();
                            }*/
                            
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;
                        }
                }
            }
            catch (
Exception e)
            {
                
Console.WriteLine(e.ToString());
            }
        } 

بالنسبه للانر بور جرب اكتب @save و رستر و شوف هيظبط ولا لا


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع

الانتقال السريع

المواضيع المتشابهه للموضوع: يارجاله دلؤتي restart مش شغال في السيرفر عندي ولما بقفل القنصل الانر بور بيتمسح
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
خلى لعبة تقفل من غير دسكونكت تفتح صفحة الاكونتات او تقفل صفحة خالص محمد ياسر تطوير سيرفرات كونكر 1 2024-08-06 06:41 PM
نفسى اعمل النظام ده عندى ف السيرفر abdocoder مشكلات السيرفيرات كونكر الشخصيه 5 2020-05-09 05:19 AM
حل مشكلة الانر بور برستر السيرفر بيترستر Tefa تطوير سيرفرات كونكر 3 2019-10-26 01:13 AM
حل مشكلة الانر بور برستر السيرفر بيترستر من الاول ahmedfathy مشكلات السيرفيرات كونكر الشخصيه 3 2019-10-23 04:13 PM
مشكلة عندي في السيرفر الصطف بتتحول لي صول محمودمحمدسالم مشكلات السيرفيرات كونكر الشخصيه 1 2019-07-12 10:01 PM


الساعة الآن 11:55 AM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.