Evie Addon Details

Watch - Add Favorite

redirectlib - Version 1.3

posted on 2008-06-21 12:54:55
by EmbouT
5
w00ts
w00t!
Requires: Tags: css dods français french hl2dm player-management redirect server management

Description

Redirect provides a command for ESShell and a module for ESPython of proposition of automatic redirection.
It's essentially intended for developers to their ease the realization of their script of redirection.

Redirect fourni une commande pour ESShell et un module pour ESPython de proposition de redirection automatique.
Il est essentiellement destiné aux développeurs afin de leur facilité la réalisation de leur script de redirection.

ESShell
Syntax :
    redirect (userid/"playername"/"playersteamid") ("ip:port") ["password" [kick [delay]]]

    This command don't expand variables server_var() / event_var()
    Prefix the command with es to expand variables.

    If kick is specified, password owes the being also.
    If delay is specified, password and kick owe the being also.

    userid/"playername"/"playersteamid" :
      can be userid, name or steamid of player

    "ip:port" :
      "ip:port" of the server between quotation marks (Quotation marks are imperative ! )

    "password" : (optionnal)
      The password of server

    kick : (optionnal) default = 1
      1 = The player is kicked if he doesn't accept the proposition of redirection beyond delay.
      0 = The player is not kicked
      If this argument is specified but that the server has no password, set 0 for password

    delay : (optionnal) default 15
      Time of display of the proposition of redirection.
      If this argument is specified but that the server has no password, set 0 for password and 0 or 1 for kick



Syntaxe :
    redirect (userid/"nom"/"SteamID") ("ip:port") ["mot de passe" [kick [delai]]]

    Ne traduit pas les variables server_var() et event_var().
    Précédez la commande par es pour ce faire.

    Si kick est spécifié, mot de passe doit l'être aussi.
    Si delai est spécifié, mot de passe et kick doivent l'être aussi

    userid/"nom"/"SteamID" :
      peut être l'userid, le nom ou le steamid d'un joueur

    "ip:port" :
      l'ip et le port du serveur entre guillemets (les guillemets sont impératif ! )

    "mot de passe" : (optionnel)
      Le mot de passe du serveur

    kick : (optionnel) par défaut = 1
      1 = le joueur est kické s'il n'accepte pas la proposition de redirection au delà du délai.
      0 = le joueur n'est pas kické
      Si cet argument est spécifié mais que le serveur n'a pas de mot de passe, indiquez 0 pour le mot de passe

    delai : (optionnel) par défaut 15
      Temps d'affichage de la proposition de redirection.
      Si cet argument est spécifié mais que le serveur n'a pas de mot de passe, indiquez 0 pour le mot de passe et 0 ou 1 pour kick



Example :
event player_connect
{
// server without password
// The proposition will be shown during 15s and the player will be kicked if he doesn't accept it
// serveur sans mot de passe
// La proposition sera affichée pendant 15s et le joueur sera kické s'il ne l'accepte pas
es redirect event_var(userid) "90.90.90.90:27015"
 
// server without password
// The proposition will be shown during 20s and the player will be kicked if he doesn't accept it
// Serveur sans mot de passe
// La proposition sera affichée pendant 20s et le joueur sera kické s'il ne l'accepte pas
es redirect event_var(userid) "90.90.90.90:27015" 0 1 20

// server without password
// The proposition will be shown during 20s and the player will NOT be kicked if he doesn't accept it
// Serveur sans mot de passe
// La proposition sera affichée pendant 20s et le joueur NE sera PAS kické s'il ne l'accepte pas
es redirect event_var(userid) "90.90.90.90:27015" 0 0 20

// server with password
// The proposition will be shown during 15s and the player will be kicked if he doesn't accept it
// quotation marks not necessities if the password have no space
// required quotation marks if the password contains a space
// Serveur avec mot de passe
// La proposition sera affiché pendant 15s et le joueur sera kické s'il ne l'accepte pas
// guillemets non nécessaire si le mot de passe n'as pas d'espace
// guillemets requis si le mot de passe comporte un espace
es redirect event_var(userid) "90.90.90.90:27015" lepass
es redirect event_var(userid) "90.90.90.90:27015" "le pass"

// server with password
// The proposition will be shown during 15s and the player will NOT be kicked if he doesn't accept it
// Serveur avec mot de passe
// La proposition sera affiché pendant 15s et le joueur NE sera PAS kické s'il ne l'accepte pas
es redirect event_var(userid) "90.90.90.90:27015" lepass 0
}


ESPython
    Example :
    # -*- coding:Utf-8 -*-
     
    import es
    import redirectlib
     
    # server without password
    # The proposition will be shown during 15s and the player will be kicked if he doesn't accept it
    # serveur sans mot de passe
    # La proposition sera affiché pendant 15s et le joueur sera kické s'il ne l'accepte pas
    redirection=redirectlib.Redirect("90.90.90.90:27015")
     
    # server without password
    # The proposition will be shown during 20s and the player will be kicked if he doesn't accept it
    # Serveur sans mot de passe
    # La proposition sera affiché pendant 20s et le joueur sera kické s'il ne l'accepte pas
    redirection=redirectlib.Redirect(ip="90.90.90.90:27015",delai=20)
     
    # server without password
    # The proposition will be shown during 15s and the player will NOT be kicked if he doesn't accept it
    # Serveur sans mot de passe
    # La proposition sera affiché pendant 15s et le joueur NE sera PAS kické s'il ne l'accepte pas
    redirection=redirectlib.Redirect(ip="90.90.90.90:27015",kick=0)
     
    # server with password
    # The proposition will be shown during 15s and the player will be kicked if he doesn't accept it
    # Serveur avec mot de passe
    # La proposition sera affiché pendant 15s et le joueur sera kické s'il ne l'accepte pas
    redirection=redirectlib.Redirect("90.90.90.90:27015","lepass")
     
    # server with password
    # The proposition will be shown during 15s and the player will NOT be kicked if he doesn't accept it
    # Serveur avec mot de passe
    # La proposition sera affiché pendant 15s et le joueur NE sera PAS kické s'il ne l'accepte pas
    redirection=redirectlib.Redirect("90.90.90.90:27015","lepass",0)
     
    def player_connect(event_var):
    redirection.send(event_var['userid'])

     
    # You can also proceed as it
    # Vous pouvez aussi faire comme cela
    redirectlib.Redirect("90.90.90.90:27015").send(event_var['userid'])
     
    # Or import the class directly
    # Ou importer la class directement
    from redireclib import Redirect
     
    redirection = Redirect(ip="90.90.90.90:27015",delai=20)
    redirection.send(userid)
     
    # or
    # ou
    Redirect(ip="90.90.90.90:27015",kick=0,delai=20).send(userid)

Installation

Unzip the file in the directory root of your game (cstrike, dod, hl2mp)

For a use in ESShell, add to your autoexec.cfg file:
es_xload redirect
    Or load since your script.


For a use in ESPython, import the module or the class.
import redireclib
# or
from redireclib import Redirect



Dézippez le fichier zip dans le répertoire racine de votre jeu (cstrike/dod,hl2mp).

Pour une utilisation en ESShell, ajouter à votre fichier autoexec.cfg :
es_xload redirect
    Ou charger le depuis votre script.


Pour une utilisation en ESPython, importez le module ou la class.
import redireclib
# or
from redireclib import Redirect

Version Notes For 1.3 (Announce this update)

Updated on: 2009-06-25 22:49:10 EST by EmbouT
Fixed :
The players were kicked even if the parameter 'kick' was defined to 0

Correction :
Les joueurs étaient kickés même si le paramètre 'kick' était défini à 0
( Previous Versions )