View Full Version : Linux game problem
Pallav Nawani
12-22-2004, 11:01 AM
Hi,
I am porting my game RiotBall to linux. But there is a problem, How am I supposed to launch the browser for buying?
I could try something like spawning /usr/bin/mozilla but this would fail on one or the other system where galeon is being used instead of mozilla or mozilla has been put in some other directory.
So, for the people who have done this already, any solutions for this?
Best regards,
Pallav
20thCenturyBoy
12-22-2004, 07:06 PM
Just tell 'em to open their broswer manually. Linux users don't need the handholding that Windows users need... :p
Oh and what makes you think Linux users want to pay for anything :confused:
Sillysoft
12-23-2004, 01:09 AM
Check out the source code of BrowserLauncher (http://browserlauncher.sourceforge.net/). It's a java class that can be used to open a browser window on any platform. I recall there being a bunch of different commands being tried one after another when it's running under Linux.
Pallav Nawani
12-23-2004, 09:51 AM
Just tell 'em to open their broswer manually. Linux users don't need the handholding that Windows users need... :p
Oh and what makes you think Linux users want to pay for anything :confused:
While this is true, the reason is not hand holding but making it easy to buy. Linux users are indeed very reluctant to pay for software, but then since I am using SDL already, this is just a day or two's job for me. Even if I sell one copy per month (linux version), that would be ok.
GBGames
12-23-2004, 10:20 AM
Uh, I'm a Linux user, and I'm prepared to buy some shareware games that work on it, and definitely more willing to shell out money for a game that let's me stay on my Linux box rather than boot up my Games OS box (read: Windows). I'm sure there are plenty of others. Maybe not enough of us exist to justify a huge porting project, but if it is only a day's work or two because your code is already fairly portable, then the reward can be justified.
I know that I had to configure Gaim to KNOW which browser I wanted to open when clicking on a link. I wouldn't suggest you do the same since users will get suspicious about the need to have a browser preference configured in a game that shouldn't use it.
And Linux users might generally prefer that you not try to open a program "randomly". This is something to do some research on, but I think a large number of Linux users use it because it is more stable than Windows. Don't frighten them away by doing something unexpected like opening a browser window. Linux users might not understand why your program would do anything like that when all of their other programs are modular and do only what they're supposed to do.
I think this can apply to most people, not just Linux users though. If you're gonna open a browser window when I click on "Buy Now!", make sure I know it! When you let the user know what is happening, you're probably more likely to keep their trust and their interest.
All that said, perhaps it would be easier for you to check /usr/bin for firefox, mozilla, konqueror, galleon, etc. Basically, have a list of browsers that you know people use and that can be used to buy with. An obscure browser that doesn't have SSL support isn't going to help you get sales, so there isn't a point to try to appeal to all browsers.
In fact, the command which firefox should tell you exactly where it is installed, so if the user has a non-standard spot for his/her installed programs, you can still find them. Using that information, you can probably open the web browser without a hitch.
And if you still can't find the browser, say so. "RiotBall is not able to find a web browser on your system. If you're interested in purchasing RiotBall, please point your web browser to URL_HERE". Spruce it up all you want, or maybe ask the user if he/she can type in the browser path.
Just some ideas.
Sillysoft
12-23-2004, 04:59 PM
I've never received a complaint or bug report from a Linux user about the way I open my browser windows using the above mentioned BrowserLauncher techniques. Gotten a bunch of other Linux related tech support questions on different topics though... :rolleyes:
Mike D Smith
12-31-2004, 03:28 PM
Sorry, this is windows related but I'm just kind of curious on this one.
Is there a win32 command do launch the default browser under windows, or do you need to use the system command and do it?
I usually just get away with
system("webpage.html");
but this is bad practice and I'm looking for a better way to do it.
Thanks,
ggambett
12-31-2004, 03:55 PM
There's ShellExecute(), which is equivalent to double-clicking a file in Explorer, that is, it launches it the file with the program associated with the extension. For html files, that's usually a browser, so I think this is a relatively good method.
shiftless
01-01-2005, 07:05 AM
I'm a Linux user and I would be greatly annoyed if a program opened a browser window without my request. It used to piss me off on Windows when programs would do that. That's five seconds I've got to spend closing the new window rather than doing something else I want to do.
Just make the URL plainly visible and easy to select. On X11, copying and pasting is easy because any text you select is automatically copied and the middle mouse button pastes it.
EpicBoy
01-01-2005, 07:27 AM
5 seconds!? Oh, the humanity!
Ricardo C
01-01-2005, 08:08 AM
The intrusion is annoying enough, regardless of the time involved. Unrequested windows opening is the key thing that can make me decide against purchasing a game. I don't mind the browser opening if I click "buy now", but anything else is unacceptable to me.
Hamumu
01-01-2005, 08:16 AM
Absolutely. And it will get you minus points in the GT monthly roundup, at least from a certain reviewer!
(MUCH more minus points for connecting to the internet without asking or an obvious reason like "this is an internet game")
Mike D Smith
01-01-2005, 10:41 AM
There's ShellExecute(), which is equivalent to double-clicking a file in Explorer, that is, it launches it the file with the program associated with the extension. For html files, that's usually a browser, so I think this is a relatively good method.
Looks good, I'll give it a try. Thanks.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.