Guide: Defcon working on gfire (Gaim Xfire)

Technical support for all issues relating to Defcon Linux

Moderator: Defcon moderators

Cappy
level2
level2
Posts: 75
Joined: Sat Aug 04, 2007 8:21 pm

Guide: Defcon working on gfire (Gaim Xfire)

Postby Cappy » Tue Aug 07, 2007 11:20 pm

In ~/.gaim/gfire_games.xml
you have something like

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<games>
     Long list of games
</games>

add

Code: Select all

   <game id="4920" name="Defcon" />

into the list of games, but before </games>

Create (or edit) a file called ~/.gaim/gfire_launch.xml
and put this in it:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<launchinfo>
   <game id="4920" name="Defcon">
      <xqf name="Defcon"  />
      <command>
         <bin>/home/cappy/defcon-v1.42/defcon</bin>
         <dir>/home/cappy/defcon-v1.42</dir>
         <connect>+connect @ip@:@port@</connect>
         <launch>@options@ @gamemod@ @connect@</launch>
      </command>
   </game>
</launchinfo>

and edit the <bin> and <dir> for your path to the game.

If you have a pre-existing gfire_launch.xml take off the line that has

Code: Select all

<!-- <options>-w -x --use-window</options> -->

or else none of this will work.

Goto (Accounts)--> (Xfire) --> And reload both your Launch Config and Game ID List

(I'm not sure if you can join games through xfire using this. I don't know the syntax for the defcon launch.)


I added this to my launcher that starts Defcon in another X session:

Code: Select all

#!/bin/sh
#uncomment if launching from console session
#sudo /etc/init.d/gdm stop
#KDE use this instead
#sudo /etc/init.d/kdm stop

# Launches a new X session on display 3. If you don't have an Nvidia card
# take out the "& nvidia-settings --load-config-only" part
sudo X :3 -ac & nvidia-settings --load-config-only

# Goto game dir (modify as needed)
cd "/home/cappy/defcon-v1.42" #Modify

# Forces the system to have a break for 2 seconds, X doesn't launch instantly
sleep 2

#Set Xfire ingame
cp ~/.gaim/defcon.ingame.tmp ~/.gaim/ingame.tmp

# Launches game (modify as needed)
DISPLAY=:3 "/home/cappy/defcon-v1.42/defcon" #Modify


while true
do
   if [ -z "`ps aux | grep "defcon.bin.x86" | grep -v grep`" ] ; then
      rm ~/.gaim/ingame.tmp
      exit
   fi
   sleep 5
done


And the same script without the X launcher:

Code: Select all

cp ~/.gaim/defcon.ingame.tmp ~/.gaim/ingame.tmp

# Launches game (modify as needed)
"/home/cappy/defcon-v1.42/defcon"

while true
do
   if [ -z "`ps aux | grep "defcon.bin.x86" | grep -v grep`" ] ; then
      rm ~/.gaim/ingame.tmp
      exit
   fi
   sleep 5
done

The script will set you in-game until you end defcon.

I would recommend running the script as a regular user and not use "sudo sh scriptname.sh" (so you don't lose your user settings mainly). Also, defcon.ingame.tmp will need to be created with

Code: Select all

GameType Defcon
in it.

If you DO run the script as root replace any line with "~/" with "/home/username/" instead.
Mapleblack
level0
Posts: 1
Joined: Wed Feb 25, 2009 9:28 pm

Postby Mapleblack » Wed Feb 25, 2009 9:31 pm

Awsome, this works perfect!

But I don't know how to switch x servers (It means u can get back to your desktop while playing the game right?).

I tried ctrl-alt-f7 f8 and f9 but I always get to some black screen with output.
Can you please tell me what the correct shortcuts are?

Thanks!

Return to “Linux Troubleshooting”

Who is online

Users browsing this forum: No registered users and 7 guests