Nexuiz status

Discuss anything to do with Nexuiz here.

Moderators: Nexuiz Moderators, Moderators

Thu Aug 09, 2007 12:08 pm

  • Is it possible to see what server I am connected to with the nexuiz client from another program
    What I wanna do is to add something like

    Playing nexuiz at 192.168.0.1

    To the status line of my IM client
    Anir
    Newbie
     
    Posts: 3
    Joined: Thu Aug 09, 2007 12:05 pm
    Location: Sweden

Thu Aug 09, 2007 12:28 pm

  • No, but it's easy to add that using tcpdump. tcpdump shows data packets being transmitted over the network, and you can use it to filter for packets to Nexuiz servers (UDP, port 26000). If such a packet exists, it tells you who you are connected to. If none comes for about 0.2 seconds, you are not playing (Nexuiz sends such packets very frequently for input).

    Example:

    tcpdump -pni eth0 udp dst port 26000

    shows:

    14:28:21.547912 IP 62.104.112.xxx.32793 > 141.2.16.3.quake: UDP, length 79

    which means "62.104.112.xxx is playing on 141.2.16.3"
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Aug 09, 2007 12:57 pm

  • Ah, yes that kinda works. Thanks

    Going go looking for some place to request different method of doing this tho :)
    Anir
    Newbie
     
    Posts: 3
    Joined: Thu Aug 09, 2007 12:05 pm
    Location: Sweden

Thu Aug 09, 2007 1:32 pm

  • Well... such a feature is not planned at the moment. I just don't consider it important enough. However, there already ARE some places where it could get easily added.

    Possibility 1: you just set log_file to some file name. The external app then can look in that file to see which server you last connected to.

    Possibility 2: add a feature to the engine that sends an extra packet or writes some file when you connect,

    Possibility 3: let menu QC do that by regularily checking connection status.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Thu Aug 09, 2007 5:38 pm

  • Ok made a script that uses tcpdump if anyone is interested
    http://nedo.se/python-scripts/nexuiz_status-0.1.0.py.gz
    works with:
    wokjab ( mine )
    gajim
    gaim

    run it with
    Code: Select all
    sudo tcpdump -pni eth1 udp dst port 26000 | python nexuiz_status-0.1.0.py



    and replace eth1 with whatever interface your using


    it uses code from the im status plugin in exaile
    Anir
    Newbie
     
    Posts: 3
    Joined: Thu Aug 09, 2007 12:05 pm
    Location: Sweden

Thu Aug 09, 2007 6:03 pm

  • I just noticed: for less CPU load and better reliability (so it won't show server browser packets), add "and greater 121" to the expression. This is the length of standard input packets of Nexuiz, which are sent frequently enough. But it's much more than the getinfo packets take, which the server browser sends to remote servers.

    Another idea would be excluding packets that start with \xFF\xFF\xFF\xFF. But no idea how to do that in tcpdump directly. I think "udp[8:4] != 0xFFFFFFFF" should exclude server browser packets, but not totally sure.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Aug 10, 2007 8:59 am

  • I think it would be better to have a look at the log first, because otherwise the script will only work if you connect to servers that run on port 26000, right ? And, well, many servers don't use that port.
    IRC quote:
    [kojn] I've been coming a bit more recently
    [kojn] she took it the dirty way
    GreEn`mArine
    Forum addon
     
    Posts: 1509
    Joined: Tue Feb 28, 2006 9:33 pm
    Location: Germany

Fri Aug 10, 2007 5:53 pm

  • GreEn`mArine wrote:I think it would be better to have a look at the log first, because otherwise the script will only work if you connect to servers that run on port 26000, right ? And, well, many servers don't use that port.

    That problem could also be solved by forcing a local port with cl_port and filter for that source port with tcpdump.
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm



Return to Nexuiz - General Discussion




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest