@ Kloot
Nothing wrong with the code except it assumes server is already configured...
And doesnt catch when server is not configured i.e
Ideally need some sort of GUI wizard to guide user through configuring server. i.e gtk.Assistant.
Which was another reason i upped requirement to newer gtk
quick example i found via google
Code: Select all
#!/bin/env python
import gtk
class FunkyAssistant(gtk.Assistant):
def __init__(self):
gtk.Assistant.__init__(self)
self.connect('delete_event', self.cb_on_delete)
self.connect('close', self.cb_close)
# Construct page 0
vbox = gtk.VBox(False, 5)
vbox.set_border_width(5)
vbox.show()
self.append_page(vbox)
self.set_page_title(vbox, 'Page 0: Howto do absolutely nothing useful')
self.set_page_type(vbox, gtk.ASSISTANT_PAGE_CONTENT)
label = gtk.Label("Press the Execute button below to simulate some work. This enables the Forward button when done...")
label.set_line_wrap(True)
label.show()
vbox.pack_start(label, True, True, 0)
button = gtk.Button(stock=gtk.STOCK_EXECUTE)
button.connect('clicked', self.cb_do_something)
button.show()
vbox.pack_end(button)
# Construct page 1
# As this is the last page needs to be of page_type
# gtk.ASSISTANT_PAGE_CONFIRM or gtk.ASSISTANT_PAGE_SUMMARY
label = gtk.Label('Thanks for using FunkyAssistant!')
label.set_line_wrap(True)
label.show()
self.append_page(label)
self.set_page_title(label, 'Page 1: byebye')
self.set_page_type(label, gtk.ASSISTANT_PAGE_SUMMARY)
self.show()
def cb_on_delete(self, widget, event):
gtk.main_quit()
def cb_do_something(self, button):
self.set_page_complete(button.get_parent(), True)
def cb_close(self, assistant):
self.emit('delete_event', gtk.gdk.Event(gtk.gdk.NOTHING))
if __name__ == '__main__':
win = FunkyAssistant()
win.show()
gtk.main()
Feel free to finish off GUI code for missing parts. As gtk & getting GUI to behave like u imagine is a pain in the ****.
What i am working on since yesterday
Done -> , added cellrenderercombo for Battle gtk.TreeView for side selection.
Wanted to get done before i worked on rest of battlecode
Nearly done -> atm add XX.png flag & also support for loading XX.png if map is missing.
Basicly if u want to bug me on public forums about coding dont, or take it in private. From my point of view am getting hounded over code that i havent got around to finishing, and there is alot.
Or offer a code solution that doesnt involve sys module & exiting program with a console warning.
**********************
Also difference between our coding is i dont initialize every variable if there is no need to. Just wastes processing time imo. I do know coders off course who initialise every variable. But dont see us giving grief to each other over minor coding differences.
Also if it bails then it exposes a bug deeper in code or in coder's understanding of the logic in the code.
And i dont care about bonafide syntactic show-stoppers if i aware of problem & will get around to adding code to it when i get the free time.
Lastly if u dont like how its coded & keep pointing out code mistakes in your point of view feel free to start your own or fork the current code its gpl 2 after all.
But for arguement sack lets see what needs coding / polishing. Before u bug me on public forums again about something u found.
Add GUI wizards
Catching lack of mods / maps via unitsync <since there can be multiple datadirs>. Also future proofs code to changes in future if changes to unitsync handling of datadirs
Catching multiple maps in archive & tell user nolonger supported. And option to remove the offending maps if possible.
Finish off code for automatic UnityLobby Configure i.e so package maintainers can add system file that will run by default on first run of app. So user doesnt need to know where spring is installed etc.
Add Code for autoupdating via Lobby, or hopefully i get some cash for sourceforge so dont need to bug Betalord for lobby server version update to get clients to check for updates.
Update popup dialog for hosting as its ulgy imo
Update OPENBATTLE for new server
Rest of Lobby Protocol
Finish Lobby Options
Add support for remembering window sizes again
Add support for unit limitations, hosting / playing replays
Add threaded code to monitor if user is ingame playing i.e for rankings & battlecode
Add file / directory checking for Setup Profile for UnityLobby to help warn user if types an incorrect path etc..
Now for rest of today after this lengthly post to defend myself on public forum is add ram / dvd burner to friends machine. Go out.
Replace 2x100gb hd on my machine with 350gb. Install win + linux.
Move 100gb to server & 100gb to another machine. Put off resizing partations till tomorrow.