projects/dswpbar.txt · Last modified: 2014/01/27 03:32 by JRandomNoob

DSWP bar

DSWP bar

DSWP bar and its backend have not been updated to work with our 4.2 serwer, still reporting the state of the dead 4.1 serwer.

0.0.3 in its current state can only be installed on Firefox 13 or older, although it works flawlessly with versions up to 24 (possibly further). If you know what you’re doing you can edit the install.rdf to update the maxVersion, or disable the compatibility check entirely.



Download it here

Features


DSWP bar is a Firefox addon for addicted players who want to know what’s going on at any given moment on the TDM server, displaying current and next map, team scores, and the people online. You log in using your forum username and password; if you tick the “Remember profile” box, these will be saved using the Firefox password manager (this works whether you’ve enabled saving your passwords or not). It’s coupled to the DSWP account infrastructure, showing forum usernames for those players who are registered there, and knowing about who you have marked as friends/foes on the forum (shown in bold in the player list; the bar can optionally display a popup whenever any of them joins or leaves the game — the STFU checkbox suppresses the popup).

The “Home” button opens the forum main page; the “Game monitor” button opens a Javascript-based page displaying the TDM server players and scores in real time. Each of the names in the player list opens the player’s XLRStats page.

:!: If you change your forum password, changing your profile for the bar can be a bit convoluted. See the TODO section below for explanation and steps.

Structure

The bar uses the Firefox built-in features for password managing and cookies. The cookie is identical to the one you recieve when logging in via the web page, but for technical reasons there’s no auto-login based on existing cookie — the bar writes a new one each time you log in.

Data is fetched from http://www.dswp.de/old/perso_friends.php which is only usable if you’re logged in, displaying personalized info for each user. (For generic bot use, there’s http://www.dswp.de/old/perso_friends_bot.php.)

The code is available on our git.

TODO

  • Update the code to work with Firefox 14 — simply changing the maxVersion won’t do the trick this time. Turns out FF 14 didn’t recognize 16.* as valid maxVersion (the bar works just fine with 14.*).
  • Password management is unfinished — when you first type your username and password and tick “Remember the profile”, everything works fine, but when you change your forum password and try to repeat the “first time” steps, nothing happens. You’ll have to delete the old profile first via the Firefox password manager (Tools > Options > Security tab > Saved passwords button), and then you can save a new profile via the bar. (Presumably this is a non-existent problem if you are allowing the FF password management to save everything, since the username, password and cookies are identical to the web ones.)
  • Make the STFU state persistent.

Known bugs

  • Names that contain commas break the player list a bit: comma is used as a delimiter between different people in perso_friends.php. As a result, the player’s name won’t open a valid XLRStats page, and there’s an additional “acunted player” undefined with the “forum account” undefined in the list.
  • After logging out and in again, no data is displayed — instead you see “Array unknown --> unknown unknown unknown minutes remaining”. Refresh (whether manual or scheduled) gets rid of that. Also, despite the STFU box staying ticked, the friends popup is displayed (once). (Both of these bugs also appear if you have two or more windows open and close the one you’re using for the bar.)

Changelog

The bar was originally written by SvaRoX, updated by Samtron (code) and JRandomNoob (UI). There’s the original development thread on the forum (currently locked to keep the curiously single-minded spambots away).

0.0.3

August 1, 2012

  • Added an asynchronous function for main data retrieval that should keep the bar from freezing the whole browser window if your net connection goes down, if dswp.de goes down, or if the incredibly stylish guys in black suits decide you’re trying to post something that Must Not Be. Ybat yvir Fnzgeba!
  • Fixed a small regex bug that kept the bar from properly displaying 0 players.
  • Rearranged and prettified the UI and added icons in front of acunted players’ names in the list.
  • Updated maxVersion to 13.* so that people other than FF 3.x users could install it without resorting to manually editing files and whatnot.

0.0.2b

November 27, 2010

  • Removed the “Cannot retrieve data” alert, deemed annoying by both users and the author.
  • Updated maxVersion from 3.5 to 3.*.

0.0.2

September 23, 2009

  • Added the amount of players online, red/blue scores and time remaining to the next map.
  • Fixed problems with the friends popup stealing focus despite Stfu being checked.
  • Middle-click on Home and Game monitor buttons works now.
  • Added auto-update feature.

0.0.1

September 21, 2009

  • The “pre-alpha” version as first posted on the forum.