Author Topic: Command Line Arguments  (Read 1937 times)

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Command Line Arguments
« on: 23 January 2008, 05:53:26 »
I have command line arguments working on Linux (it should be simple to add Windows support). When joining or hosting it should skip to the proper menu. They can be in any order but the details of the option needs to be directly after it separated by a space.

Current options:
-h flag for hosting a game
-j flag for joining
-ip x.x.x.x for ip

Example:  ./glest -j -ip 192.168.1.1

Download here for diff and source

NOTE: I put command_line.cpp/h in shared_lib/util
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

daniel.santos

  • Guest
(No subject)
« Reply #1 on: 23 January 2008, 06:02:44 »
w00t! Nice work. :roll:

Daniel
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #2 on: 23 January 2008, 11:39:30 »
You could talk to RainCT to host it on http://glest.eurion.net/ but there isn't any set place. I use http://www.divshare.com/ because they don't delete data after it becomes inactive and seems like they won't disappear anytime soon. They are free with paid upgrade i think. http://www.mediafire.com/ and http://www.mydatabus.com/ also look good but I haven't tried them before. Maybe a blog would be good.

Perhaps I could help with the crashes.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

daniel.santos

  • Guest
(No subject)
« Reply #3 on: 24 January 2008, 02:28:50 »
Thanks for the offer, I have the feeling I'll be taking you up on this some time, but I got my problem resolved.  You can't derive from stl classes, that's what happens when you spend too many years doing Java. :)

Anyway, it has two other unintended side effects atm, unit continues to attack a target after they die if they die from a dot and I forgot the other one.  Hopefully, I'll get that fixed soon and find some place to post it (I hate all of these "look at my ads and share a file" sites).
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #4 on: 27 January 2008, 11:50:33 »
I found this page on how to parse the command line of WinMain into the format that the main function supplies.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/