i post this in 4botters months ago so i decided to here too.
to let your players know that you have a server maintenance or something to to fix your server.
put in your program.cs
Code:
if (Cmd[0] == "/sm")
{
Game.World.SendMsgToAll("SYSTEM", "Server Maintanience in 5 minutes! Please log off to avoid data lost!", 2011, 0);
new Thread(new ThreadStart(
delegate()
{
Console.WriteLine("Server Maintenance Command Activated (via Console).");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 4 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("4 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 4 minutes! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("4 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 3 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("3 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 3 minutes! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("3 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 2 minutes and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("2 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 2 minutes! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("2 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 1 minute and 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("1 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 1 minute! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("1 Minute Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("SYSTEM", "Server Maintenance in 30 Seconds! Please Log off to prevent data loss!", 2011, 0);
Console.WriteLine("30 Seconds Left");
Thread.Sleep(30000);
Console.WriteLine("Server is now shutting down...");
Game.Character[] BaseCharacters = new Character[World.H_Chars.Count];
World.H_Chars.Values.CopyTo(BaseCharacters, 0);
NewestCOServer.Main.AuthWorker.Listener.Close();
NewestCOServer.Main.GameWorker.Listener.Close();
EndSession = true;
try
{
foreach (Game.Character C in BaseCharacters)
{
Character Char = (Character)C.Value;
C.MyClient.Disconnect();
Console.WriteLine(C.Name + " is hard headed has force to logged off by the system.");
}
}
catch { }
Database.SaveKOs();
Console.WriteLine("KOs saved.");
Database.SaveEmpire();
Console.WriteLine("Empire saved.");
Features.Guilds.SaveGuilds();
Console.WriteLine("Guilds saved.");
DMaps.Save();
Features.SkillsClass.Save();
Console.WriteLine("Skills saved.");
DMaps.Save();
HouseItem.Save();
Console.WriteLine("Dynamic Maps Saved.");
MobThread.Close();
ServerStuff.Close();
CompanionThread.Close();
Database.Dispose();
Console.WriteLine("Database disposed.");
Console.WriteLine("Click X to close the window.");
Console.WriteLine("GOODBYE :D");
}
)).Start();
}
[COLOR="Magenta"]
NewestCOServer.Main.AuthWorker.Listener.Close();
NewestCOServer.Main.GameWorker.Listener.Close();[/COLOR]
try
{
foreach (Game.Character C in BaseCharacters)
{
Character Char = (Character)C.Value;
C.MyClient.Disconnect();
Console.WriteLine(C.Name + " is hard headed has force to logged off by the system.");
}
}
catch { }
The code in purple disconnects everyone anyway? Why re-disconnect nobody? oo I might be wrong but by the looks...
[Release]5165 Source 01/20/2012 - CO2 PServer Guides & Releases - 25 Replies Stuff in the source
Fixed Fb/Ss System
QuizShow
Fixed Some Bugs
GM, PMS Can Pk
Most NPC
Fixed Rates(Can Be Changed)
FrozenGrotto(works but the mobs do to high dmg)
lab npc and spawns
guildwar
Server Maintenance... (HELP!) 5165 05/15/2010 - CO2 Private Server - 2 Replies Hi there, i have set up my own server, i have checked all my ip address and everything is in the right place, i have run the server, done the /newacc test 1234 thing and then loaded a 5165 client i KNOW works, then went to log in, i entered my details EXACTLY as i had put them in the server console and the screen goes black with the 2 dragon things at the side but no loading bar in the middle. EVENTUALLY it looks like it is going to load for a second, then comes up with server maintenance or...
[PROBLEM] 5165 Server Maintenance Error 04/17/2010 - CO2 Private Server - 8 Replies I have my 5165 Source set up correctly. I have the Config File edited 100% correctly and the OldCODb folder in my C: where its supposed to be. I can login to the server, but no one else can.
Btw, they have the correct ip in Server.dat as well. :/
[Release]5165 Source 11/23/2009 - CO2 PServer Guides & Releases - 31 Replies #Edit There removed it now leave me alone
But its not gonna matter that i removed it cause its alll on 4BOTTERS and stickied lmao
#requesclose Pleas and Thank You