コード例 #1
0
ファイル: Heartbeat.cs プロジェクト: TheDireMaster/fCraft
 static Heartbeat()
 {
     Delay   = TimeSpan.FromSeconds(20);
     Timeout = TimeSpan.FromSeconds(10);
     Salt    = Server.GetRandomString(32);
     Server.ShutdownBegan += OnServerShutdown;
 }
コード例 #2
0
 static Heartbeat()
 {
     Delay   = DelayDefault;
     Timeout = TimeoutDefault;
     Salt    = Server.GetRandomString(32);
     Server.ShutdownBegan += OnServerShutdown;
 }
コード例 #3
0
 static Heartbeat()
 {
     MinecraftNetUri = new Uri( "http://www.minecraft.net/heartbeat.jsp" );
     WoMDirectUri = new Uri( "http://direct.worldofminecraft.com/hb.php" );
     Delay = TimeSpan.FromSeconds( 25 );
     Timeout = TimeSpan.FromSeconds( 10 );
     Salt = Server.GetRandomString( 32 );
 }
コード例 #4
0
 static Heartbeat()
 {
     MinecraftNetUri       = new Uri("https://minecraft.net/heartbeat.jsp");
     Delay                 = TimeSpan.FromSeconds(25);
     Timeout               = TimeSpan.FromSeconds(10);
     Salt                  = Server.GetRandomString(32);
     Server.ShutdownBegan += OnServerShutdown;
 }
コード例 #5
0
 static Heartbeat()
 {
     ClassiCubeNetUri      = new Uri("http://www.classicube.net/heartbeat.jsp");
     Delay                 = TimeSpan.FromSeconds(25);
     Timeout               = TimeSpan.FromSeconds(10);
     Salt                  = Server.GetRandomString(32);
     Server.ShutdownBegan += OnServerShutdown;
 }
コード例 #6
0
        static void ReloadHandler(Player player, CommandReader cmd)
        {
            string whatToReload = cmd.Next();

            if (whatToReload == null)
            {
                CdReload.PrintUsage(player);
                return;
            }

            whatToReload = whatToReload.ToLower();

            using (LogRecorder rec = new LogRecorder()) {
                bool success;

                switch (whatToReload)
                {
                case "config":
                    try {
                        Config.Reload(false);
                        success = true;
                    } catch (Exception ex) {
                        Logger.Log(LogType.Error, "Error reloading config: {0}", ex);
                        player.Message("An error occurred while trying to reload config: {0}: {1}", ex.GetType().Name, ex.Message);
                        success = false;
                    }
                    break;

                case "salt":
                    Heartbeat.Salt = Server.GetRandomString(32);
                    player.Message("&WNote: Until server synchronizes with Minecraft.net, " +
                                   "connecting players may have trouble verifying names.");
                    success = true;
                    break;

                default:
                    CdReload.PrintUsage(player);
                    return;
                }

                if (rec.HasMessages)
                {
                    foreach (string msg in rec.MessageList)
                    {
                        player.Message(msg);
                    }
                }

                if (success)
                {
                    player.Message("Reload: reloaded {0}.", whatToReload);
                }
                else
                {
                    player.Message("&WReload: Error(s) occurred while reloading {0}.", whatToReload);
                }
            }
        }
コード例 #7
0
 /// <summary> Creates a 16 character unique rank ID, via Server.GetRandomString(). </summary>
 /// <returns> 16 character unique rank ID. </returns>
 public static string GenerateID()
 {
     return(Server.GetRandomString(16));
 }