Start BZFS (new tool)

Place all meeting requests / announcements here...
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Start BZFS (new tool)

Post by JeffM »

Ok, so for 3.0 we removed the "start server" option from in game. It was not maintained very well and didn't work on a lot of systems, and well honestly it sucked a lot.

So to replace it we have a new tool that will work external from BZFlag. This tool is called StartBZFS and it is based on Blast's "BZFSTestLauncher", but is more tailored to just starting servers.

Image

This is the initial prototype for that tool. It has a lot of fun options, and should make it very easy to start a server. We plan on having this tool as an installable package when 3.0 releases, for all OSs.

http://my.bzflag.org/staff/jeffm/StartBZFS_0.0.5.zip

Now, this is also our first foray into building a tool with C# and mono, so some of the rules about how this thing will be used are a little different then normal.

1) There is only ONE build of the tool. It works on Windows, OSX, and Linux. It will always have the .exe extension ( and no it will not use wine).
2) On windows you must have the .net 3.5 runtimes from Microsoft installed. On linux and OSX, you MUST have the mono framework installed (version 2.0 or later).
3) On linux and OSX, you must have the exe be run with mono. This can be done from the command line using mono StartBZFS.exe or by associating the .exe extension with mono if your desktop system allows it. I have not seen a linux or OSX system that will simply let you double click it with out some kind of configuration or script first.

If you don't believe me, here is the exact same program running on my Ubuntu system.
Image
This is running the exact same file as windows is(I just moved my flash drive over). It's really cool when you think about it.

If you follow these rules all should be OK. I'm sure there will be some things we'll find out about how the process works on all the various OSs and I'll update things here as we know more. Before release we hope to have a complete set of instructions on what to do for each OS.

Please note that I don't have a mac, and haven't tested this on a mac, so if there are problems, report em here and we'll figure it out. But it "should' work on a mac.


Enough of how to start it, now how to use it.

On launch it will try to find out where your BZFS server is. On windows, it'll first search for installed copies of bzflag, and look there. On linux and OSX it won't do anything because that code isn't done yet.

If it can't find your server, the little message in the lower left will say "No server path defined" and the start button will be grayed out. This means you need to go to the options menu and set your paths.

Once you do that you can set your options and start a server. Please note that if you are using 2.0.x (yes it works for that version too), don't' check OpenFFA, it wont' work.

So give it a shot and let me know how it goes :)

You can find the sources in our SVN repository under trunk/bzflag/tools/StartBZFS
ImageJeffM
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Start BZFS (new tool)

Post by Spazzy McGee »

Upon trying to run it on my iMac, I get a busload of errors. Have you had people get it running under OS X yet?

Here's the stuff it tells me: It's beyond me to interpret what it means. If you need more testing on a mac, I'm happy to help out.

This is on my intel iMac, most up to date version of Leopard, and most up to date OSX version of Mono.

Code: Select all

iMac:~ george$ mono /Users/george/StartBZFS.exe 

Unhandled Exception: System.ArgumentException: An empty file name is not valid.
  at System.IO.FileSystemInfo.CheckPath (System.String path) [0x00000] 
  at System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPath) [0x00000] 
  at System.IO.DirectoryInfo..ctor (System.String path) [0x00000] 
  at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:.ctor (string)
  at StartBZFS.Form1.scanMaps () [0x00000] 
  at StartBZFS.Form1..ctor () [0x00000] 
  at (wrapper remoting-invoke-with-check) StartBZFS.Form1:.ctor ()
  at StartBZFS.Program.Main () [0x00000] 
iMac:~ george$ mono /Users/george/StartBZFS.exe 

Unhandled Exception: System.ArgumentException: An empty file name is not valid.
  at System.IO.FileSystemInfo.CheckPath (System.String path) [0x00000] 
  at System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPath) [0x00000] 
  at System.IO.DirectoryInfo..ctor (System.String path) [0x00000] 
  at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:.ctor (string)
  at StartBZFS.Form1.scanMaps () [0x00000] 
  at StartBZFS.Form1..ctor () [0x00000] 
  at (wrapper remoting-invoke-with-check) StartBZFS.Form1:.ctor ()
  at StartBZFS.Program.Main () [0x00000] 
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

ImageJeffM
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Start BZFS (new tool)

Post by clarahobbs »

Why don't you just use Python and the wxPython GUI toolkit? That would look native on Linux, Mac, and Windoze. Or if you insist on not using Python for fastness reasons, you could use C++ and wxWidgets for the same effect.
FKA Ratfink
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

because we didn't.

1) This is an experiment to see how C# will work. I have seen how python + (insert UI toolkit here) has worked out in distribution, and it isn't pretty. I mean on some OSs you are going to have to install python, just like on some OSs you will have to install mono. It works out to the a similar process just for different people, and the process for mono is cleaner(one install vs, many python sublibs). From what I've seen the current ubuntu distributions include mono as a default package, windows has .net as part of windows update. That means that ,hey, the only people who have to install mono are probably the OSX people. That is a lot less of our playerbase then all the windows and mac and linux users who would have to install python and wxWidgets (linux and OSX would only need wxWidgets probably). The mono framework has it's on UI toolkit built in, so that one install takes care of both the language AND the UI, instead of your system that requires both. I don't know about you but that linux screenshot I posted looks as good as any wx app I've seen. Mono uses the native systems to do all it's UI (GTK IIRC).

2) Going with C++ means that we need to maintain builds for each OS, and keep them updated each time we make changes. This is not trivial.

I know you really like python and wxWidgets because that's what you are doing your tool in. But really it has the same core as C#, just spread out over more libraries that are harder to setup on more OSs. Just because you have one way of doing something doesn't mean that there isn't another way as well;)

Mono is 100% open source, and can be used on all OSs (even windows). You can use monodevelop or monobuild to work on the code and compile it. You do not have to ever touch a Microsoft product at all (my gut tells me that this is your core problem with it).If you don't care about using a Microsoft product, they have free versions that will work just fine. You can even build your executable on linux and GIVE them to a windows user to run, the first exe I posted was built on ubuntu.
ImageJeffM
User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Start BZFS (new tool)

Post by Wreckage »

I run kubuntu (Intrepid Ibex), and after a little trouble installing mono it worked fine, servers ran and everything. Is there a way to stop a server once it is running from the program? It seemed I would have to restart the whole program or else "ERROR: Unable to start the server, perhaps one is already running?" would appear in the terminal. Also it would be nice if you could set a password so one can change server variables while playing vs having to do the whole group thing (and for running private servers as I do). Otherwise looks good.

Thanks for working on this!
Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

yes, stopping them is a feature that is being worked on. There is just some problems getting the threads to read the output of bzfs. Currently the only way to start them is in 'background' mode. There is code to bring up a log window with a nice little "stop" button.

The password is a good idea.
ImageJeffM
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

ok, so I've got those 2 things fixed, and a bounus feature.

http://my.bzflag.org/staff/jeffm/StartBZFS_0.0.3.zip

Background mode is now off by default, and it'll warn you if you are on an OS where you have to kill the thing manually.

Not background mode will bring up a little server window that shows you the output and lets you stop it.

There is also now a "test" button under the public section. This will test your router/port setup and make sure that you can connect to the list server and it can connect back to you. If this fails it is highly likely that players will NOT be able to connect to you ether.
ImageJeffM
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Start BZFS (new tool)

Post by clarahobbs »

The latest version doesn't work for me. I'm using Fedora 8 on an i686. The error message is:

Code: Select all

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: gdiplus.dll
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner exception stack trace ---

  at <0x00000> <unknown method>
  at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000]
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000]
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000]
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000]
  at System.Windows.Forms.XplatUI..cctor () [0x00000] --- End of inner exception stack trace ---

  at <0x00000> <unknown method>
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00000]
  at StartBZFS.Program.Main () [0x00000]
I didn't know ANY .net languages worked on Linux, and from this error message, maybe they don't. :D
FKA Ratfink
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

It actualy is working there,You are just missing a component. If it didn't work at all, you would not have even gotten those errors ;) Think of it as a similar error to python if you didn't have the openGL bindings or some other component installed.

What version of mono do you have? Fedora 8 is pretty old (10 is current IIRC) and it it probably has an old version of mono. I am guessing that you need at least mono 2.0, or maybe 2.2 (2.4 is current). Older versions of mono did not support all features.
ImageJeffM
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Start BZFS (new tool)

Post by clarahobbs »

Yeah, Fedora 10 is newest (until the end of may, then 11 will be). I think Fedora 8 has 0.13.x . I'll try it on Fedora 10 now.
FKA Ratfink
User avatar
clarahobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Start BZFS (new tool)

Post by clarahobbs »

Yeah, it works. It doesn't look native (or good for that matter), but at least it runs.
FKA Ratfink
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Start BZFS (new tool)

Post by blast »

I was bored, so I got it to run on my N800. I installed mono (which included several of the mono libs), and then also had to install the libmono-corlib2.0-cil and libmono-winforms2.0-cil packages. A 'mono --version' shows "Mono JIT compiler version 2.0.1". I didn't try running bzfs as I don't have a cross compiled bzfs on it right now, but I imagine it would work just fine.

EDIT: Forgot to include the screenshot.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
Jefenry
Private First Class
Private First Class
Posts: 154
Joined: Thu Sep 14, 2006 3:56 pm
Location: TextEdit
Contact:

Re: Start BZFS (new tool)

Post by Jefenry »

Is it just me or is the Ricochet option not working? I tried with the box checked and unchecked and shots wouldn't rico.

Other than that it works pretty well.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

I did have not verified all the settings with bzfs, I may have messed something up.

The tool creates a config file in the same dir as the client would (my bzflag files on windows, .bzf on linux, etc..) in folder called "temp". you can open those and see what it put in the config. It will make one for each port you have used.
ImageJeffM
User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Start BZFS (new tool)

Post by Wreckage »

Wow I come back the next day and there's a password and stop button. :D

Yeah rico depended on the map I was running, the check box had no effect. I looked at the .cfg file and there was no difference or +r (IIRC that is rico) whether I had the rico box checked or not.
Image
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Start BZFS (new tool)

Post by Spazzy McGee »

Okay, it's running on my mac now.

There seems to be some sort of bug with the 'paths' menu. The 'browse' feature for the server path works, although it will not allow you to browse anything except your home folder - which is probably a problem, seeing as most people's BZFS will be located in their Applications folder, at the top of the HD. You can still type the path in by hand.

The browse feature for the World path allows you to select a file, but that file path does not get inserted into the path box correctly when you click 'open'.

When you click 'Start' nothing actually happens, and the terminal tells me this:

Code: Select all

dyld: Library not loaded: @executable_path/../Frameworks/SDL.framework/Versions/A/SDL
  Referenced from: /Users/george/bzfs
  Reason: image not found
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

Please try this version
http://my.bzflag.org/staff/jeffm/StartBZFS_0.0.4.zip

It has the rico item fixed, as well as a change to the working path for OSX that may help.

as for the browse item not letting you out of your home dir, I don't know what could be causing that. There isn't anything in there about locking you to it.
ImageJeffM
User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Start BZFS (new tool)

Post by Wreckage »

Looking good!

I'm a little confused about what takes dominance over the other, the .cfg or the .bzw? It seems to me that if the map file says "-ms 6" and I set in the program for it to be below 6, it will still be 6. But if I set it in the program to be anything about 6 then the higher number takes dominance.
But the -j in the map file seems to always take dominance (i guess because there is no option for no jumping, just to allow it or else it is disabled).

Sorry if that is confusing...
Could anyone clear that up for me?
Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Start BZFS (new tool)

Post by JeffM »

It has to do with where the -world line is in the config.
http://my.bzflag.org/staff/jeffm/StartBZFS_0.0.5.zip has the world as the very last thing so it should override anything
ImageJeffM
tobylane
Private First Class
Private First Class
Posts: 130
Joined: Thu Jan 29, 2009 4:21 pm

Re: Start BZFS (new tool)

Post by tobylane »

Latest version of mac mono and download (2.4, 0.5 ^), $ /Library/Frameworks/Mono.framework/Versions/2.4/bin/mono Documents/BZFlag/StartBZFS.exe. Crashed when I did the list server test, repeatable.

Code: Select all

Unhandled Exception: System.Net.Sockets.SocketException: interrupted
  at System.Net.Sockets.Socket.Accept () [0x00000] 
  at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x00000] 
  at StartBZFS.SocketListener.run () [0x00000] 
http://img293.imageshack.us/img293/17/bzfs.tif

When I chose a few options and clicked start (which still looked inactive), I got this,

Code: Select all

System.ArgumentException: Invalid path
  at System.IO.Path.GetDirectoryName (System.String path) [0x00000] 
  at StartBZFS.ServerLoger.run (System.String command, System.String args, System.String tempLogiFile) [0x00000] 
  at StartBZFS.ServerConfig.run (Boolean background, System.String exePath) [0x00000] 
  at StartBZFS.Form1.Start_Click (System.Object sender, System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] 
  at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] 
The choose map thing is odd, I don't know if it's generic or not (it's not native), but works fine.
User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Start BZFS (new tool)

Post by Wreckage »

JeffM wrote:It has to do with where the -world line is in the config.
http://my.bzflag.org/staff/jeffm/StartBZFS_0.0.5.zip has the world as the very last thing so it should override anything
Ahh, so it reads the .cfg top to bottom, whatever is listed last stands. So the map settings will take dominance in this version, which is what I wanted so you wouldn't have to read and check off the settings from the options in the map file. (Correct me if I misunderstand). Good to know.

Thanks!
Image
User avatar
Gamma
Private First Class
Private First Class
Posts: 97
Joined: Fri Nov 28, 2008 6:47 pm
Location: USA

Re: Start BZFS (new tool)

Post by Gamma »

Wow Devs! keep up the good work!
I can't wait to see the complete release!
Image

...BZFlag Forever.
rhapsody
Private First Class
Private First Class
Posts: 41
Joined: Thu Apr 30, 2009 11:31 am

Re: Start BZFS (new tool)

Post by rhapsody »

I am on Windows XP and I installed everything needed including the link you gave and eveything worked fine and i was able to start the server using one of my created maps. My question is where do you go from there, once you have started the server? Do you open bzflag, cmd? I'm new at this sry...
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Start BZFS (new tool)

Post by blast »

Start bzflag and connect to the server localhost on port 5154. (Assuming you didn't change the port)
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply