Announcement

Collapse
No announcement yet.

Server Status En Firefox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Server Status En Firefox

    Este es el codigo que posteo the0ne sobre como está hecho el status.php

    PHP Code:
    //Web Server Status v 1.4, Copyright 2002 By Ryan Schwiebert, visit [url=http://www.schwebdesigns.com/]Homepage of SchWeb Designs.com providing webpage design, custom websites, and computer training[/url]
    //This script may be freely distributed providing all copyright headers are kept intact.

    //Concept from:
    //Abax Server Status v1.04, Copyright 2002 By Nathan Dickman, visit [url=http://www.NathanDickman.com/]Nathan Dickman - free php and perl scripts and fractal art[/url]
    //Location of the live or dead server images

    //Please change to your server specifications
    $live "img_home/status_on.jpg";
    $dead "img_home/status_off.jpg";
    //The status checking script
    $s_link '200.51.255.50:7777';
    list(
    $addr,$port)= explode (':',"$s_link");
    //Test the server connection
    $churl = @fsockopen(server($addr), $port$errno$errstr20);
                 if (!
    $churl){
        
    //echo $errstr;
                    
    header("Location: $dead");
                    }
                 else {
                       
    header("Location: $live");             
              }
    function 
    server($addr){
             if(
    strstr($addr,"/")){$addr substr($addr0strpos($addr"/"));}
             return 
    $addr;

    Habria que ver si se puede adaptar eso a alguna extension de firefox. Si es que alguien sabe como se hacen.

    PD: puede que este obsoleta la ip, creo que es la que se usaba en 3dg.

    Comment


    • #17
      Re: Server Status En Firefox

      GZ - ComunidadZero Lineage 2 ahi dice si esta on u off.. y si la pag no anda el server tm, q pos t al pedo.

      Comment


      • #18
        Re: Server Status En Firefox

        Yo he desempaquetado la extensión con el winrar y me he encontrado con esto...

        \lineage2_server_status-0.1.3-fx
        <DIR> CHROME
        chrome.manifest
        Originally posted by chrome.manifest
        overlay chrome://browser/content/browser.xul chrome://statusbar/content/statusbar.xul
        overlay chrome://navigator/content/navigator.xul chrome://statusbar/content/statusbar.xul
        content statusbar chrome/content/

        skin statusbar classic/1.0 chrome/skin/classic/
        install.rdf
        Originally posted by install.rdf
        <?xml version="1.0"?>

        <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:em="http://www.mozilla.org/2004/em-rdf#">

        <Description about="urn:mozilla:install-manifest">
        <em:id>[email protected]</em:id>
        <em:version>0.1.3</em:version>
        <em:name>LA2 Friends Statusbar</em:name>

        <em:description>Lineage II Oficial Status and Friends</em:description>
        <em:creator>Carlos André Ferrari</em:creator>
        <em:homepageURL>http://www.la2friends.com</em:homepageURL>

        <!-- Describe the Firefox versions we support -->
        <em:targetApplication>
        <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>1.5</em:minVersion>
        <em:maxVersion>3.0b5pre</em:maxVersion>
        </Description>
        </em:targetApplication>
        </Description>
        </RDF>

        \lineage2_server_status-0.1.3-fx\chrome
        <DIR> content
        <DIR> defaults
        <DIR> skin



        \lineage2_server_status-0.1.3-fx\chrome\content
        contents.rdf
        Originally posted by contents.rdf
        <?xml version="1.0"?>

        <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:chrome="http://www.mozilla.org/rdf/chrome#">

        <RDF:Seq RDF:about="urn:mozillaackage:root">
        <RDF:li RDF:resource="urn:mozillaackage:statusbar"/>
        </RDF:Seq>

        <RDFescription about="urn:mozillaackage:statusbar"
        chrome:displayName="LA2 Friends Statusbar"
        chrome:author="Carlos André Ferrari"
        chrome:name="statusbar"
        chrome:extension="true"/>

        <RDF:Seq RDF:about="urn:mozillaverlays">
        <RDF:li RDF:resource="chrome://browser/content/browser.xul"/>
        <RDF:li RDF:resource="chrome://navigator/content/navigator.xul"/>
        </RDF:Seq>

        <RDF:Seq RDF:about="chrome://browser/content/browser.xul">
        <RDF:li>chrome://statusbar/content/statusbar.xul</RDF:li>
        </RDF:Seq>

        <RDF:Seq about="chrome://navigator/content/navigator.xul">
        <RDF:li>chrome://statusbar/content/statusbar.xul</RDF:li>
        </RDF:Seq>

        </RDF:RDF>
        statusbar.js
        Originally posted by statusbar.js
        var la2_id_server = 1;
        var la2_key = "";

        var la2Prefs = null;

        var http_request = new XMLHttpRequest();

        var fila= [];
        var fcount = 0;

        var versao = 3;

        function $(obj){
        return document.getElementById(obj);
        }

        function addFila (url, parametros, readfunction){
        fila[fila.length]=[url,parametros,readfunction];
        if((fcount+1)==fila.length) makeRequest();
        }

        function makeRequest() {
        url = fila[fcount][0];
        parameters = fila[fcount][1];
        readfunction = fila[fcount][2];

        http_request = new XMLHttpRequest();

        //if (http_request.overrideMimeType) http_request.overrideMimeType('text/xml');
        if (!http_request) return false;

        http_request.onreadystatechange = readfunction;
        if (parameters.length > 2){
        http_request.open('POST', url, true);
        http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
        http_request.send(parameters);
        }else{
        http_request.open('GET', url, true);
        http_request.send(null);
        }
        }

        function alertContents() {

        if (http_request.readyState == 4) {
        status = "0";
        try {
        if (http_request.status == 200) {

        var pagesource = http_request.responseText;
        var lastcheck = new Date();

        if (pagesource.indexOf("bartz") < 0) return;

        vetor = pagesource.split("\n");

        nSrv = ((la2_id_server-1) * 2) + 2;
        nSrvPing = nSrv + 1;

        status = vetor[nSrvPing];

        if (status.indexOf('down') >= 0){
        updateServerIcon('offline', vetor[nSrv] + ": Offline");
        }else{
        updateServerIcon('online', vetor[nSrv] + ": Online");
        }
        } else { // http_request.status != 200
        updateServerIcon('fatal', "Problem with HTTP request");
        }
        }catch (e) {
        updateServerIcon('fatal', "Problem with HTTP request");
        }
        fcount++
        if(fcount<fila.length)setTimeout("makeRequest()",5 0);
        } else { // http_request.readyState != 4
        updateServerIcon('update', 'Updating Information');
        } //if-else
        }

        function updateServerIcon(icon, msg){
        $('la2serverstatus').setAttribute('state', icon);
        $('tSrvStatus2').value = msg;
        $('tSrvStatus').value = msg;
        }

        function getServerStatus() {
        updateServerIcon('update', 'Updating Information');
        addFila ('http://www.glop.org/lineage2/backend.txt', '', alertContents);
        self.setTimeout('getServerStatus()', 40000);
        }

        function loadPrefs(){
        la2Prefs = Components.classes["@mozilla.org/preferences-service;1"]
        .getService(Components.interfaces.nsIPrefService)
        .getBranch("la2Friends.");
        la2Prefs.QueryInterface(Components.interfaces.nsIP refBranch2);

        try {
        la2_id_server = la2Prefs.getIntPref("server");
        la2_key = la2Prefs.getCharPref("userkey");
        } catch (e) {
        la2_id_server = 1;
        la2_key = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
        la2Prefs.setCharPref("userkey", la2_key);
        la2Prefs.setIntPref("server", la2_id_server);
        }

        $("l2srv" + la2_id_server).setAttribute('checked', true);
        }

        function startLa2(){
        loadPrefs();
        getServerStatus();
        }

        function setKey(){
        var key = prompt("Enter Your la2 Friends Key");

        if (key == null || key.length != 32){
        alert ("Invalid key!, get one registering on www.la2friends.com!\n\nEnjoy!");
        return false;
        }
        writeKey(key);
        }

        function about(){
        alert ("Lineage 2 FriendList Firefox Extension\nhttp://www.la2friends.com\nVersion 0.1.3\n\nBy. Carlos Andre Ferrari\nServer: Bartz / Char: Safado");
        }

        function mudaServer(srv){
        la2_id_server = srv.value;

        la2Prefs.setIntPref("server", la2_id_server);

        updateServerIcon('update', 'Updating Information');
        getServerStatus();
        }

        window.addEventListener("load", startLa2, false);
        statusbar.xul
        Originally posted by statusbar.xul
        <?xml version="1.0"?>
        <?xml-stylesheet href="chrome://statusbar/skin/statusbar.css" type="text/css"?>

        <overlay id="la2Friends" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
        <script type="application/x-javascript" src="chrome://statusbar/content/statusbar.js"/>
        <statusbar id="status-bar">
        <statusbarpanel class="statusbarpanel-iconic" hidden="true" context="la2Menu" tooltip="tip_completo" id="la2clanflag" state="flag" />
        <statusbarpanel label="" hidden="true" context="la2Menu" id="la2char" tooltip="tip_completo" />
        <statusbarpanel class="statusbarpanel-iconic" context="la2Menu" id="la2serverstatus" tooltip="tip_completo" state="update" />

        <tooltip id="tip_completo" orient="vertical" style="background-color: #33DD00;">

        <vbox id="toolTipComp" hidden="true">
        <label value="Lineage2 Friends" style="font-weight: bold; text-align: center; font-size: 15px; margin-bottom: 5px; padding-bottom: 3px; border-bottom: 1px solid #000;" />
        <description id="tClanName" style="text-align: center;"></description>
        <label id="tCharName" value="Safado" style="font-size: 14px; font-weight: bold; text-align: center; width: 100%" />

        <label id="tSrvStatus" value="" style="margin-bottom: 2px;" />
        <label id="tFOnline" value="" style="margin-bottom: 2px;" />
        <label id="tCOnline" value="" style="margin-bottom: 2px;" />
        <label id="tUOnline" value="" style="margin-bottom: 2px;" />
        </vbox>

        <vbox id="toolTipSimp">
        <label value="Lineage2 Status" style="font-weight: bold; text-align: center; font-size: 15px; margin-bottom: 5px; padding-bottom: 3px; border-bottom: 1px solid #000;" />

        <label id="tSrvStatus2" value="Checking" style="margin-bottom: 5px;" />

        </vbox>

        <label id="lNewVersion" value="New Version Avaliable, Update!" style="text-align: center; color: red; font-weight: bold; margin-top: 5px;" hidden="true" />
        </tooltip>

        <popup id="la2Menu">
        <menu label="Servers" id="servermenu">
        <menupopup>
        <menuitem id="l2srv1" name="l2server" type="radio" value="1" label="Bartz" oncommand="mudaServer(this)" />
        <menuitem id="l2srv2" name="l2server" type="radio" value="2" label="Sieghardt" oncommand="mudaServer(this)" />
        <menuitem id="l2srv3" name="l2server" type="radio" value="3" label="Kain" oncommand="mudaServer(this)" />
        <menuitem id="l2srv4" name="l2server" type="radio" value="4" label="Lionna" oncommand="mudaServer(this)" />
        <menuitem id="l2srv5" name="l2server" type="radio" value="5" label="Erica" oncommand="mudaServer(this)" />
        <menuitem id="l2srv6" name="l2server" type="radio" value="6" label="Gustin" oncommand="mudaServer(this)" />
        <menuitem id="l2srv7" name="l2server" type="radio" value="7" label="Devianne" oncommand="mudaServer(this)" />
        <menuitem id="l2srv8" name="l2server" type="radio" value="8" label="Hindemith" oncommand="mudaServer(this)" />
        <menuitem id="l2srv9" name="l2server" type="radio" value="9" label="Teon" oncommand="mudaServer(this)" />
        <menuitem id="l2srv10" name="l2server" type="radio" value="10" label="Franz" oncommand="mudaServer(this)" />
        </menupopup>
        </menu>
        <menuseparator id="sep1" />
        <menuitem label="About" oncommand="about()" />
        </popup>
        </statusbar>
        </overlay>


        \lineage2_server_status-0.1.3-fx\chrome\defaults\preferences
        defaults.js
        Originally posted by defaults.js
        pref("extensions.l2Friends.server", 1);
        pref("extensions.l2Friends.userkey", "");


        \lineage2_server_status-0.1.3-fx\chrome\skin\classic
        contents.rdf
        Originally posted by contents.rdf
        <?xml version="1.0"?>

        <RDF:RDF xmlns:chrome="http://www.mozilla.org/rdf/chrome#"
        xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

        <RDF:Seq about="urn:mozilla:skin:root">
        <RDF:li resource="urn:mozilla:skin:classic/1.0" />
        </RDF:Seq>

        <RDFescription about="urn:mozilla:skin:classic/1.0">
        <chromeackages>
        <RDF:Seq about="urn:mozilla:skin:classic/1.0ackages">
        <RDF:li resource="urn:mozilla:skin:classic/1.0:statusbar"/>
        </RDF:Seq>
        </chromeackages>
        </RDFescription>
        </RDF:RDF>
        statusbar.css
        Originally posted by statusbar.css
        .statusbarpanel-iconic[state="online"] {
        list-style-image: url("chrome://statusbar/skin/star_green.png");
        }

        .statusbarpanel-iconic[state="offline"] {
        list-style-image: url("chrome://statusbar/skin/star_red.png");
        }

        .statusbarpanel-iconic[state="update"] {
        list-style-image: url("chrome://statusbar/skin/star_grey.png");
        }

        .statusbarpanel-iconic[state="fatal"] {
        list-style-image: url("chrome://statusbar/skin/stop.png");
        }

        .statusbarpanel-iconic[state="flag"] { }
        star_blue.png
        star_green.png
        star_grey.png
        star_red.png
        star_yellow.png
        star_yellow_new.png
        star_yellow_preferences.png
        stop.png

        Comment


        • #19
          Re: Server Status En Firefox

          Por lo visto la magia esta en statusbar.js
          Pero no ando muy practico en JavaScript. Despues voy a ver si entiendo qué hace.

          Saludos.

          Comment


          • #20
            Re: Server Status En Firefox

            uu buenicimo, esta bueno que alguien sepa como hacerlo
            yo la verdad que no tengo ni idea, XD pero siempre hay alguien que tiene el bochin limado y lo puede hacer. saluT
            JuanBike gladia 53+

            Comment


            • #21
              Re: Server Status En Firefox

              Originally posted by Ginji View Post
              Por lo visto la magia esta en statusbar.js
              Pero no ando muy practico en JavaScript. Despues voy a ver si entiendo qué hace.

              Saludos.
              con el tema de server off. por ahi te copas y lo podes hacer.
              siempre dan ganas de hacer cosas cuando el server esta off digo cosas diferentes. saludos.
              JuanBike gladia 53+

              Comment

              Working...
              X