Test Ping sur Batch

Amnexia -  
 Amnexia -
Bonjour, je n'arrive pas à tester la connexion du serveur de jeu, il prend directement le choix numéro 1 sans chercher à comprendre... donc si vous trouvez, aidez moi, merci à vous.
.
.
lien utile pour faire des test de serveur ON & OFF :
http://reign-of-kings.net/country/france/
Les points montres les lignes sauté. car le site ne détecte pas les lignes sauté
.
.
@echo off
Title Test Connexion Server : Reign Of Kings

ping localhost -n 3 > nul
echo Test de connexion Server Rok
ping localhost -n 3 > nul
echo Test la connexion...
ping localhost -n 2 > nul
cls
.
:Test.Connexion
.
Rem -----------------------------------
:: Ont Ping " " pendant 5secondes
:: C'est ici qu'on choisit l'ip du serveur : aucun serveur inscrit c'est fais exprès.
PING """"" -n 6 > NUL
ping localhost -n 3 > nul
.
Rem -----------------------------------
:: Si errorlevel vaut 0 alors tout et OK
IF %ERRORLEVEL% == 0 goto Server.Actif
IF %ERRORLEVEL% == 1 goto Server.Inactif
ping localhost -n 3 > nul
echo Erreur...
ping localhost -n 3 > nul
goto Lancement.Server
.
:Server.Actif
.
(
CLS
ECHO Informations :
ping localhost -n 3 > nul
ECHO Server - [ Le Domaine De Valsher ]
ping localhost -n 3 > nul
ECHO Etats - [ OK ]
ping localhost -n 3 > nul
ECHO Internet - [ OUI ]
ping localhost -n 3 > nul
)
.
cls
ping localhost -n 5 > nul
echo Test Terminé, Server Actif
ping localhost -n 5 > nul
cls
echo Fermeture...
ping localhost -n 3 > nul
cls
goto Close
.
.
:Server.Inactif
Rem -----------------------------------
:: Si errorlevel vaut 1 alors tout et NUL
(
CLS
ECHO Informations :
ping localhost -n 3 > nul
ECHO Server - Le Domaine De Valsher
ping localhost -n 3 > nul
ECHO Etats - [NUL]
ping localhost -n 3 > nul
ECHO Internet - [NON]
ping localhost -n 3 > nul
)
.
.
cls
ping localhost -n 5 > nul
echo Test Terminé, Server Inactif
ping localhost -n 5 > nul
cls
echo Fermeture...
ping localhost -n 3 > nul
cls
goto Lancement.Server
.
:Close
exit
.
:Lancement.Server
pause
:: Non terminé

2 réponses

  1. Amnexia
     
    désolé pour avoir posté au mauvaise endroit ^^
    0
  2. Amnexia
     
    Nouveau Problème : ne va pas la ou es demandé quand le ping est reçut ou pas.

    lien utile pour faire des test de serveur ON & OFF :
    http://reign-of-kings.net/country/france/
    Les points montres les lignes sauté. car le site ne détecte pas les lignes sauté

    @echo off
    Title Test Connexion Server : Reign Of Kings
    .
    ping localhost -n 3 > nul
    echo Test de connexion Server Rok
    ping localhost -n 3 > nul
    echo Test la connexion...
    ping localhost -n 2 > nul
    cls
    goto Test.Connexion
    cls
    pause > Nul ERREUR...
    :Test.Connexion
    .
    Rem -----------------------------------
    :: Ont Ping 176.31.239.22:7350 pendant 5secondes
    :: C'est ici qu'on choisit l'ip du serveur : aucun serveur inscrit c'est fais exprès.
    PING """" -n 6 > NUL
    .
    Rem -----------------------------------
    :: Si errorlevel vaut 0 alors tout et OK
    IF %ERRORLEVEL% == 0 goto Server.Actif
    IF %ERRORLEVEL% == 1 goto Server.Inactif
    cls
    pause > Nul ERREUR...
    .
    :Server.Actif
    .
    IF %ERRORLEVEL% == 0 (
    CLS
    ECHO Informations :
    ping localhost -n 3 > nul
    ECHO Server - [ Le Domaine De Valsher ]
    ping localhost -n 3 > nul
    ECHO Etats - [ OK ]
    ping localhost -n 3 > nul
    ECHO Internet - [ OUI ]
    ping localhost -n 3 > nul
    )
    .
    cls
    ping localhost -n 5 > nul
    echo Test Terminé, Server Actif
    ping localhost -n 5 > nul
    cls
    echo Fermeture...
    ping localhost -n 3 > nul
    cls
    goto Close
    cls
    pause > Nul ERREUR...
    .
    :Server.Inactif
    Rem -----------------------------------
    :: Si errorlevel vaut 1 alors tout et NUL
    IF %ERRORLEVEL% == 1 (
    CLS
    ECHO Informations :
    ping localhost -n 3 > nul
    ECHO Server - [ Le Domaine De Valsher ]
    ping localhost -n 3 > nul
    ECHO Etats - [NUL]
    ping localhost -n 3 > nul
    ECHO Internet - [NON]
    ping localhost -n 3 > nul
    )
    .
    .
    cls
    ping localhost -n 5 > nul
    echo Test Terminé, Server Inactif
    ping localhost -n 5 > nul
    cls
    echo Fermeture...
    ping localhost -n 3 > nul
    cls
    goto Lancement.Server
    cls
    pause > Nul ERREUR...
    .
    :Close
    exit
    .
    :Lancement.Server
    pause
    exit
    .
    0