*Unlock All Weapons* in server patch 1.02

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PvtNoob
    Member
    • Dec 2005
    • 24

    #196
    Re: *Unlock All Weapons* in server patch 1.02

    Hama,

    The problem was not the asp folder at all. Everything works. But the issue was the displaying of the information.

    In the web browser the information returned should look like this:

    O
    H pid nick asof
    D 12345678 UNLOCKED 1122957313
    H enlisted officer
    D 0 0
    H id state
    D 11 s
    D 22 s
    D 33 s
    D 44 s
    D 55 s
    D 66 s
    D 77 s
    $ 103 $

    But, the return is like this in the web page:

    O H pid nick asof D 12345678 UNLOCKED 1122957313 H enlisted officer
    D 0 0 H id state D 11 s D 22 s D 33 s D 44 s D 55 s D 66 s D 77 s $ 103 $

    The information should go up and down the web page ... not across it. Also, remember that I stated that the file was written in php with the aspx extension. The information that we can copy and past on this topic is written in perl with an aspx extension. I think it is the way the file was written. Here's the coding of the file written in php...I got this from BF2statistics....Look at what is highlighted...I am wondering if those needed to be changed:


    <?php
    /*
    Copyright (C) 2006 BF2Statistics
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */
    /********************************************
    * 11/14/05 v0.0.1 - ALPHA build *
    * 11/14/05 v0.0.2 - Removed name parameter *
    * 11/15/05 v0.0.3 - Added redundancy check *
    * 11/26/05 v0.0.4 - Updated for SF *
    * 01/03/06 v0.1 - BETA release *
    * 01/25/06 v0.1.1 - Added allunlocks *
    * 02/14/06 v0.1.2 - Updated for EF *
    * - Fixed unlocks *
    ********************************************/
    $pid = $_GET['pid'] ? $_GET['pid'] : false;
    if ((!$pid) || (!is_numeric($pid))) {print 'Invalid syntax!';}
    else
    {
    require('config.php');
    $connection = @mysql_connect($dbhost, $dbuser, $dbpass);
    @mysql_select_db($dbname);
    if ($allunlocks) {$query = "SELECT name FROM player WHERE id = {$pid}";}
    else {$query = "SELECT name, score, usedunlocks FROM player WHERE id = {$pid}";}
    $result = mysql_query($query) or die(mysql_error());
    if (!mysql_num_rows($result)) {print 'Player not found!';}
    else
    {
    $row = mysql_fetch_array($result);
    $nick = $row['name'];
    $earned = 0;
    if (!$allunlocks)
    {
    $score = $row['score'];
    $used = $row['usedunlocks'];
    $query = "SELECT COUNT(id) AS count FROM unlocks WHERE (id = {$pid}) AND (state = 's')";
    $result = mysql_query($query) or die(mysql_error());
    if (mysql_num_rows($result))
    {
    $row = mysql_fetch_array($result);
    $unlocks = $row['count'];
    if ($unlocks < 7)
    {
    if ($score >= 50000) {$earned = 7;}
    elseif ($score >= 20000) {$earned = 6;}
    elseif ($score >= 8000) {$earned = 5;}
    elseif ($score >= 5000) {$earned = 4;}
    elseif ($score >= 2500) {$earned = 3;}
    elseif ($score >= 800) {$earned = 2;}
    elseif ($score >= 500) {$earned = 1;}
    $earned -= $used;
    }
    $query = "UPDATE player SET availunlocks = {$earned} WHERE id = {$pid}";
    mysql_query($query) or die (mysql_error());
    }
    }
    print "O\n" .
    "H\tpid\tnick\tasof\n" .
    "D\t$pid\t$nick\t" . time() . "\n" .
    "H\tenlisted\tofficer\n" .
    "D\t$earned\t0\n" .
    "H\tid\tstate\n";
    $num = strlen($pid) + strlen($nick) + 51;
    if (!$allunlocks)
    {
    $query = "SELECT kit, state FROM unlocks WHERE (id = {$pid}) AND (kit < 78)";
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_array($result))
    {
    print "D\t$row[kit]\t$row[state]\n";
    }
    checkUnlock(88, 22);
    checkUnlock(99, 33);
    checkUnlock(111, 44);
    checkUnlock(222, 55);
    checkUnlock(333, 66);
    checkUnlock(444, 11);
    checkUnlock(555, 77);
    $num += 0;
    }
    else
    {
    for ($i = 11; $i < 100; $i += 11) {print "D\t$i\ts\n";}
    for ($i = 111; $i < 556; $i += 111) {print "D\t$i\ts\n";}
    $num += 61;
    }
    print "$\t$num\t$";
    }
    @mysql_close($connection);
    }
    function checkUnlock($want, $need)
    {
    global $pid;
    $query = "SELECT state FROM unlocks WHERE (id = {$pid}) AND (state = 's') AND (kit = {$need})";
    $result = mysql_query($query) or die(mysql_error());
    if (mysql_num_rows($result))
    {
    $query = "SELECT state, kit FROM unlocks WHERE (id = {$pid}) AND (kit = {$want})";
    $result = mysql_query($query) or die(mysql_error());
    $row = mysql_fetch_array($result);
    print "D\t$row[kit]\t$row[state]\n";
    }
    else {print "D\t$want\tn\n";}
    }
    ?>


    Thanks,

    Pvtnoob

    Comment

    • Milky

      #197
      Re: *Unlock All Weapons* in server patch 1.02

      Managed to get the aspx file to display correctly (always asks for the file to be downloaded - not too sure if this is supposed to happen (i'm an apache n00b)).

      However the unlocks are not working.

      This is with 1.21.

      W2K3 Standard, with Apache 2.0 aspmod, and Perl installed.

      Comment

      • hama

        #198
        Re: *Unlock All Weapons* in server patch 1.02

        hmm, i have a other script, and this working fine with all weapons.
        U missed weapons or u have no weopans available?

        My Server Running with Rank Picture InGame and bf2statistic outside
        I have tested 4 or 5 scripts, before i found bf2statistics.
        All scripts from web, not running on my server

        which script do u use?

        @ milky

        First change ur Hostfile from server
        insert under 127.0.0.1
        ur IP from Webserver bf2web.gamespy.com

        0.0.0.0 bf2web.gamespy.com

        ur webserver send the information to ur bf2 server and give unlocks
        create a ASP folder and insert the getunlocksinfo.aspx


        For all Gamers with Problems, ABR
        DewaPoker! Akses lewat link resmi ceme online terlengkap dengan koneksi aman, server stabil, dan pilihan room yang lengkap untuk semua level pemain di dewapoker.

        Unlocks per klick from web :)

        Comment

        • Milky

          #199
          Re: *Unlock All Weapons* in server patch 1.02

          Hama,

          Thanks for the info.. The BF2 Server and the Web Server are the same box.

          Heres what I have..

          HOSTS file:

          127.0.0.1 localhost
          127.0.0.1 bf2web.gamespy.com
          192.168.160.128 bf2web.gamespy.com

          Originally posted by Code
          #!C:/Perl/bin/perl.exe

          my @ids=qw/11 22 33 44 55 66 77/;

          sub main();
          sub main() {
          my $time=time;

          print "Content-type: text/plain\n\n";
          print "O\n";
          print "H\tpid\tnick\tasof\n";
          print "D\t12345678\tUNLOCKED\t$time\n";
          print "H\tenlisted\tofficer\n";
          print "D\t0\t0\n";
          print "H\tid\tstate\n";
          for (@ids) {
          print "D\t$_\ts\n";
          }
          print "\$\t103\t\$\n";
          }

          main();
          When visiting the webpage, it asks if I want to download it (as if you are actually downloading a file.. i get no output from IE, except the prompt above).
          When running the BF2 Server, as before.. unlocks dont work

          And the serversettings.con:

          sv.internet 1
          sv.useGlobalRank 1
          sv.useGlobalUnlocks 1

          Oh, Addition..

          It's because of Windows 2003 Servers IE Settings that it asks me to download the file.

          If i view it in XP, it outputs through IE fine. Just need to get it working on the box now!

          May have a slight fix for those who cant get it working..

          I HAVENT TESTED THIS YET, so it might not work..

          I just did an nslookup on my machine, the bf2 box, and the webserver to bf2web.gamespy.com

          Even though the hosts file has been edited correctly, the DNS still responds with the CORRECT dns for bf2web.gamespy.com. This may be causing the issues.

          I'm going to install DNS tomorrow on my BF2 Box, and Web Server, to see if I can get it to think that the web server is bf2web.gamespy.com.

          Its 4am.. i aint doing it now! Nite :)

          Comment

          • Beelooo

            #200
            Re: *Unlock All Weapons* in server patch 1.02

            I had the same problem with mozilla a fiex weeks ago. The browser is not in cause. It's your Apache httpd.conf that is wrong. Have you add the line AdddHandler cgi-script .aspx ? You can also create a htaccese file with this code

            AddType application/x-httpd-php .aspx
            IndexIgnore *

            The script will normally works fine !

            Comment

            • hama

              #201
              Re: *Unlock All Weapons* in server patch 1.02

              ur bf2 server and webserver running local?

              Hmmm, i think that´s ur unlock problem.

              Unlocks and Ranks, come from the internet access to your Database, not by LAN.

              Read this topic :)

              Comment

              • Milky

                #202
                Re: *Unlock All Weapons* in server patch 1.02

                Ah, I never had a database setup.. that might be the issue.

                Comment

                • N2K

                  #203
                  Re: *Unlock All Weapons* in server patch 1.02

                  We have an unranked running linux, how does do i access those files?

                  Comment

                  • alphasylvain

                    #204
                    Re: *Unlock All Weapons* in server patch 1.02

                    HOW Unlock All Weapons in server patch 1.3 ?? windows server

                    Comment

                    • perry

                      #205
                      Re: *Unlock All Weapons* in server patch 1.02

                      Originally posted by alphasylvain
                      HOW Unlock All Weapons in server patch 1.3 ?? windows server
                      I think unlocks on unranked servers have been completely disabled for 1.3... gotta find a new workaround.

                      Comment

                      • schaf

                        #206
                        Re: *Unlock All Weapons* in server patch 1.02

                        Originally posted by perry
                        I think unlocks on unranked servers have been completely disabled for 1.3... gotta find a new workaround.
                        take a look at our site www.cyndic8.com/unlockanleitung.php and follow the simple workaround to get unlocks on your own unranked server :)

                        if you didn't understand german, let me know it and i'll try to translate it in english

                        greets
                        schaf

                        Comment

                        • wtf.Root

                          #207
                          Re: *Unlock All Weapons* in server patch 1.02

                          Have read the entire thread here and can't find anyone else with the same problem as mine.
                          If I change the hosts file on my PC I get Crash To Desktop everytime I run BF2, anyone else ?

                          Comment

                          • perry

                            #208
                            Re: *Unlock All Weapons* in server patch 1.02

                            Originally posted by wtf.Root
                            Have read the entire thread here and can't find anyone else with the same problem as mine.
                            If I change the hosts file on my PC I get Crash To Desktop everytime I run BF2, anyone else ?
                            That's a "feature" of 1.3.

                            Originally posted by schaf
                            if you didn't understand german, let me know it and i'll try to translate it in english

                            greets
                            schaf
                            I don't understand German and can't figure out how to post there, so I'll ask here for a translation I can see that you're having us comment out a couple lines and change the indents, but I don't understand the warnings at the bottom and Google's translation doesn't make much sense. Thanks :)

                            Comment

                            • BigDaddyTX

                              #209
                              Re: *Unlock All Weapons* in server patch 1.02

                              I'd like a translation of this as well.

                              Comment

                              • bNasty

                                #210
                                Re: *Unlock All Weapons* in server patch 1.02

                                A translation would be nice.
                                But I used Google to translate it for me and then was able to decipher the rest on my own. However, after following the instructions I could still not get it to work in 1.3.

                                I also followed another thread which indicated I needed to setup my host file to redirect the gamespy query to another server. After doing this, as soon as someone joins the server it crashes. There is an Invalid Gamespy query.

                                Comment

                                Working...