[solved] Offline play impossible?

Technical support for all issues relating to Defcon Linux

Moderator: Defcon moderators

Havner
level0
Posts: 5
Joined: Wed Nov 05, 2008 1:31 am

[solved] Offline play impossible?

Postby Havner » Wed Nov 05, 2008 11:39 am

I've checked Unnoficial FAQ, Defcon main page FAQ and both claim that you can play LAN/offline games without any internet access, that your key can be algorithmically checked offline for that. Well, for Linux it doesn't work. I click "new game" and only get chat window. I just checked windows version (never used it before) and there it works. Any ideas? Cause this is unnaceptable for me. I got a machine without net access and wanted to play against AI. And I can't.
Last edited by Havner on Wed Nov 05, 2008 2:40 pm, edited 1 time in total.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Wed Nov 05, 2008 12:29 pm

Something is wrong with your setup. Play without network is possible, but play with broken network is not possible. If you have, for example, a lingering fixed-IP configuration for an unplugged ethernet card, Defcon will try to use that for its internal communication and will fail. Simply remove all network devices except loopback, and things should be fine.
Havner
level0
Posts: 5
Joined: Wed Nov 05, 2008 1:31 am

Postby Havner » Wed Nov 05, 2008 1:39 pm

All addresses from all interfaces removed, all interface to down state (ip l s down eth0):

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:16:e6:5f:b0:05 brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:16:e6:5f:b0:07 brd ff:ff:ff:ff:ff:ff


NOT working, "new game", only chat window at the bottom.

Removed network card module:

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
    link/sit 0.0.0.0 brd 0.0.0.0


NOT working, "new game", only chat window at the bottom.

Can't put it down more then that (net cards are builtin).

So something is wrong with Linux defcon.

EDIT: I just removed all the settings and authkey (~/.defcon) and run it in demo mode with network down. I can't start a new game there as well.
With network connection up everything works as it should, key get authorized and "New Game" start to work. With key in "Uknown" (offline) state it doesn't.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Wed Nov 05, 2008 2:01 pm

I don't know how things currently work in the Linux version (there have been changes at least on the Windows side), but can you do

Code: Select all

ping $(hostname)

? At least in earlier versions, if that worked, Defcon worked for local games.
Havner
level0
Posts: 5
Joined: Wed Nov 05, 2008 1:31 am

Postby Havner » Wed Nov 05, 2008 2:12 pm

Thank you!
That was it. I had `hostname` set in /etc/hosts to non loopback value.

But still game should fallback to 127.0.0.1 if net is down, not use `hostname` value.
Anyway, it works. Thanks.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Wed Nov 05, 2008 2:25 pm

You're welcome.

Havner wrote:But still game should fallback to 127.0.0.1 if net is down, not use `hostname` value.
Yes. And in fact, it shouldn't use the network at all :)
Havner
level0
Posts: 5
Joined: Wed Nov 05, 2008 1:31 am

Postby Havner » Wed Nov 05, 2008 2:40 pm

bert_the_turtle wrote: And in fact, it shouldn't use the network at all :)


Well, that's not neccesarily. It's not that uncommon for a network game to use TCP code even for single player games. That's exactly what's loopback is for. It's easier for a developer to reuse network code for single player game (that has server-client architecture) then to write single machine specific code.

Return to “Linux Troubleshooting”

Who is online

Users browsing this forum: No registered users and 2 guests