Mercurial > traipse_dev
comparison orpg/networking/mplay_server_gui.py @ 195:b633f4c64aae alpha
Traipse Alpha 'OpenRPG' {100219-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for
developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to
the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user.
Update Summary (Patch-2)
New Features:
New Namespace method with two new syntaxes
Fixes:
Fix to Server GUI startup errors
Fix to Server GUI Rooms tab updating
Fix to Chat and Settings if non existant die roller is picked
Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated
Fix to Alias Lib's Export to Tree, Open, Save features
Fix to alias node, now works properly
Fix to Splitter node, minor GUI cleanup
author | sirebral |
---|---|
date | Sat, 24 Apr 2010 08:37:20 -0500 |
parents | 06f10429eedc |
children | b8091ede042a |
comparison
equal
deleted
inserted
replaced
182:4b2884f29a72 | 195:b633f4c64aae |
---|---|
4 # GNU General Public License | 4 # GNU General Public License |
5 # | 5 # |
6 | 6 |
7 __appname__=' OpenRPG GUI Server v0.7 ' | 7 __appname__=' OpenRPG GUI Server v0.7 ' |
8 __version__='$Revision: 1.26 $'[11:-2] | 8 __version__='$Revision: 1.26 $'[11:-2] |
9 __cvsinfo__='$Id: mplay_server_gui.py,v 1.26 2007/11/06 00:32:39 digitalxero Exp $'[5:-2] | 9 __cvsinfo__="$Id: mplay_server_gui.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"[5:-2] |
10 __doc__="""OpenRPG Server Graphical Interface""" | 10 __doc__="""OpenRPG Server Graphical Interface""" |
11 | 11 |
12 import os, sys, time, types | 12 import os, sys, time, types, webbrowser |
13 | 13 |
14 from orpg.dirpath import dir_struct | 14 from orpg.dirpath import dir_struct |
15 from orpg.tools.validate import validate | 15 from orpg.tools.validate import validate |
16 from orpg.orpg_wx import * | 16 from orpg.orpg_wx import * |
17 from threading import Thread | 17 from threading import Thread |
18 | 18 |
19 import webbrowser | |
20 | |
21 from meta_server_lib import post_server_data, remove_server | 19 from meta_server_lib import post_server_data, remove_server |
22 from mplay_server import mplay_server, server | 20 from mplay_server import mplay_server, server |
23 | 21 |
24 from xml.dom import minidom | 22 from xml.dom import minidom |
25 from orpg.orpgCore import component | 23 from orpg.orpgCore import component |
30 from xml.etree.ElementTree import fromstring, tostring, parse | 28 from xml.etree.ElementTree import fromstring, tostring, parse |
31 | 29 |
32 # Constants ###################################### | 30 # Constants ###################################### |
33 SERVER_RUNNING = 1 | 31 SERVER_RUNNING = 1 |
34 SERVER_STOPPED = 0 | 32 SERVER_STOPPED = 0 |
35 | |
36 ### Alpha ### | |
37 MENU_MODIFY_BANLIST = wx.NewId() | 33 MENU_MODIFY_BANLIST = wx.NewId() |
38 ############# | |
39 | |
40 MENU_PLAYER_CREATE_ROOM = wx.NewId() | 34 MENU_PLAYER_CREATE_ROOM = wx.NewId() |
41 | 35 |
42 # Our new event type that gets posted from one | 36 # Our new event type that gets posted from one |
43 # thread to another | 37 # thread to another |
44 wxEVT_LOG_MESSAGE = wx.NewEventType() | 38 wxEVT_LOG_MESSAGE = wx.NewEventType() |
155 | 149 |
156 def AddGroup(self, data): | 150 def AddGroup(self, data): |
157 (room, room_id, players, passworded) = data | 151 (room, room_id, players, passworded) = data |
158 i = self.InsertStringItem(0, str(room_id)) | 152 i = self.InsertStringItem(0, str(room_id)) |
159 self.SetStringItem(i, 1, room) | 153 self.SetStringItem(i, 1, room) |
160 self.SetStringItem(i, 2, players) | 154 self.SetStringItem(i, 2, str(players)) |
161 self.SetStringItem(i, 3, str(passworded)) | 155 self.SetStringItem(i, 3, passworded) |
162 | 156 |
163 def DeleteGroup(self, data): | 157 def DeleteGroup(self, data): |
164 i = self.FindItem(-1, str(data)) | 158 i = self.FindItem(-1, str(data)) |
165 self.DeleteItem(i) | 159 self.DeleteItem(i) |
166 | 160 |
167 def UpdateGroup(self, data): | 161 def UpdateGroup(self, data): |
168 (room, room_id, players) = data | 162 (room, room_id, players) = data |
169 i = self.FindItem( -1, str(room_id)) | 163 i = self.FindItem( -1, str(room_id)) |
170 self.SetStringItem( i, 1, room ) | 164 self.SetStringItem( i, 1, room ) |
171 if players: self.SetStringItem(i, 2, str(players)) | 165 self.SetStringItem(i, 2, str(players)) |
172 ### Need to add room for Password Updates ### | 166 ### Need to add room for Password Updates ### |
173 | 167 |
174 class Connections(wx.ListCtrl): | 168 class Connections(wx.ListCtrl): |
175 def __init__( self, parent, main ): | 169 def __init__( self, parent, main ): |
176 wx.ListCtrl.__init__( self, parent, -1, wx.DefaultPosition, | 170 wx.ListCtrl.__init__( self, parent, -1, wx.DefaultPosition, |
266 if player['group'] != "0": item.SetTextColour(settings.get_setting(role + "RoleColor")) | 260 if player['group'] != "0": item.SetTextColour(settings.get_setting(role + "RoleColor")) |
267 except: item.SetTextColour('BLUE') | 261 except: item.SetTextColour('BLUE') |
268 self.SetItem(item) | 262 self.SetItem(item) |
269 | 263 |
270 def update(self, player): | 264 def update(self, player): |
271 #try: int(player); i = self.FindItemData( -1, int(player) ) | |
272 i = self.FindItemData( -1, int(player["id"]) ) | 265 i = self.FindItemData( -1, int(player["id"]) ) |
273 if i > -1: | 266 if i > -1: |
274 self.SetStringItem(i, 1, self.stripHtml(player["name"])) | 267 self.SetStringItem(i, 1, self.stripHtml(player["name"])) |
275 self.SetStringItem(i, 2, self.stripHtml(player["status"])) | 268 self.SetStringItem(i, 2, self.stripHtml(player["status"])) |
276 self.SetStringItem(i, 5, 'Lurker' if player["role"] == None else self.stripHtml(player["role"])) | 269 self.SetStringItem(i, 5, 'Lurker' if player["role"] == None else self.stripHtml(player["role"])) |
359 | 352 |
360 class ServerGUI(wx.Frame): | 353 class ServerGUI(wx.Frame): |
361 STATUS = SERVER_STOPPED | 354 STATUS = SERVER_STOPPED |
362 def __init__(self, parent, id, title): | 355 def __init__(self, parent, id, title): |
363 wx.Frame.__init__(self, parent, id, title, size = (760, 560) ) | 356 wx.Frame.__init__(self, parent, id, title, size = (760, 560) ) |
364 if wx.Platform == '__WXMSW__': icon = wx.Icon( dir_struct["icon"]+'WAmisc9.ico', wx.BITMAP_TYPE_ICO ) | 357 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'WAmisc9.ico', wx.BITMAP_TYPE_ICO) |
365 else: icon = wx.Icon( dir_struct["icon"]+'connect.gif', wx.BITMAP_TYPE_GIF ) | 358 else: icon = wx.Icon(dir_struct["icon"]+'connect.gif', wx.BITMAP_TYPE_GIF) |
366 self.SetIcon(icon) | 359 self.SetIcon(icon) |
367 self.serverName = "Server Name" | 360 self.serverName = "Server Name" |
368 self.bootPwd = "" | 361 self.bootPwd = "" |
369 self.do_log = True | 362 self.do_log = True |
370 | 363 |
406 """ Build the GUI menu. """ | 399 """ Build the GUI menu. """ |
407 self.mainMenu = wx.MenuBar() | 400 self.mainMenu = wx.MenuBar() |
408 | 401 |
409 # File Menu | 402 # File Menu |
410 menu = wx.Menu() | 403 menu = wx.Menu() |
411 menu.Append( 1, 'Start', 'Start server.') | 404 menu.Append(1, 'Start', 'Start server.') |
412 menu.Append( 2, 'Stop', 'Shutdown server.') | 405 menu.Append(2, 'Stop', 'Shutdown server.') |
413 menu.AppendSeparator() | 406 menu.AppendSeparator() |
414 menu.Append( 3, 'E&xit', 'Exit application.') | 407 menu.Append(3, 'E&xit', 'Exit application.') |
415 self.Bind(wx.EVT_MENU, self.OnStart, id=1) | 408 self.Bind(wx.EVT_MENU, self.OnStart, id=1) |
416 self.Bind(wx.EVT_MENU, self.OnStop, id=2) | 409 self.Bind(wx.EVT_MENU, self.OnStop, id=2) |
417 self.Bind(wx.EVT_MENU, self.OnExit, id=3) | 410 self.Bind(wx.EVT_MENU, self.OnExit, id=3) |
418 self.mainMenu.Append(menu, '&Server') | 411 self.mainMenu.Append(menu, '&Server') |
419 | 412 |
420 # Registration Menu | 413 # Registration Menu |
421 menu = wx.Menu() | 414 menu = wx.Menu() |
422 menu.Append( 4, 'Register', 'Register with OpenRPG server directory.') | 415 menu.Append(4, 'Register', 'Register with OpenRPG server directory.') |
423 menu.Append( 5, 'Unregister', 'Unregister from OpenRPG server directory.') | 416 menu.Append(5, 'Unregister', 'Unregister from OpenRPG server directory.') |
424 self.Bind(wx.EVT_MENU, self.OnRegister, id=4) | 417 self.Bind(wx.EVT_MENU, self.OnRegister, id=4) |
425 self.Bind(wx.EVT_MENU, self.OnUnregister, id=5) | 418 self.Bind(wx.EVT_MENU, self.OnUnregister, id=5) |
426 self.mainMenu.Append( menu, '&Registration' ) | 419 self.mainMenu.Append( menu, '&Registration' ) |
427 | 420 |
428 # Server Configuration Menu | 421 # Server Configuration Menu |
429 menu = wx.Menu() | 422 menu = wx.Menu() |
430 menu.Append( 6, 'Ban List', 'Modify Ban List.') | 423 menu.Append(6, 'Ban List', 'Modify Ban List.') |
431 menu.Append(11, 'Zombies', 'Set auto-kick time for zombie clients') | 424 menu.Append(11, 'Zombies', 'Set auto-kick time for zombie clients') |
432 menu.Append(14, 'Send Size', 'Adjust the send size limit') | 425 menu.Append(14, 'Send Size', 'Adjust the send size limit') |
433 menu.AppendSeparator() | 426 menu.AppendSeparator() |
434 menu.Append( 7, 'Start Ping', 'Ping players to validate remote connection.' ) | 427 menu.Append(7, 'Start Ping', 'Ping players to validate remote connection.' ) |
435 menu.Append( 8, 'Stop Ping', 'Stop validating player connections.' ) | 428 menu.Append(8, 'Stop Ping', 'Stop validating player connections.' ) |
436 menu.Append( 9, 'Ping Interval', 'Change the ping interval.' ) | 429 menu.Append(9, 'Ping Interval', 'Change the ping interval.' ) |
437 menu.AppendSeparator() | 430 menu.AppendSeparator() |
438 menu.AppendCheckItem( 10, 'Server Logging', 'Turn on or off the Server GUI Log').Check(self.do_log) | 431 menu.AppendCheckItem(10, 'Server Logging', |
432 'Turn on or off the Server GUI Log').Check(self.do_log) | |
439 menu.AppendCheckItem(12, 'Room Passwords', 'Allow or Deny Room Passwords').Check(False) | 433 menu.AppendCheckItem(12, 'Room Passwords', 'Allow or Deny Room Passwords').Check(False) |
440 menu.AppendCheckItem(13, 'Remote Admin', 'Allow or Deny Remote Admin').Check(False) | 434 menu.AppendCheckItem(13, 'Remote Admin', 'Allow or Deny Remote Admin').Check(False) |
441 menu.AppendCheckItem(15, 'Remote Kill', 'Allow or Deny Remote Admin Server Kill').Check(False) | 435 menu.AppendCheckItem(15, 'Remote Kill', 'Allow or Deny Remote Admin Server Kill').Check(False) |
442 self.Bind(wx.EVT_MENU, self.ModifyBanList, id=6) | 436 self.Bind(wx.EVT_MENU, self.ModifyBanList, id=6) |
443 self.Bind(wx.EVT_MENU, self.PingPlayers, id=7) | 437 self.Bind(wx.EVT_MENU, self.PingPlayers, id=7) |
444 self.Bind(wx.EVT_MENU, self.StopPingPlayers, id=8) | 438 self.Bind(wx.EVT_MENU, self.StopPingPlayers, id=8) |
445 self.Bind(wx.EVT_MENU, self.ConfigPingInterval, id=9) | 439 self.Bind(wx.EVT_MENU, self.ConfigPingInterval, id=9) |
446 self.Bind(wx.EVT_MENU, self.LogToggle, id=10) | 440 self.Bind(wx.EVT_MENU, self.LogToggle, id=10) |
447 self.mainMenu.Append( menu, '&Configuration' ) | 441 self.mainMenu.Append( menu, '&Configuration') |
448 self.SetMenuBar( self.mainMenu ) | 442 self.SetMenuBar(self.mainMenu) |
449 | 443 |
450 self.mainMenu.Enable( 2, False ) | 444 self.mainMenu.Enable(2, False) |
451 self.mainMenu.Enable( 4, False ) | 445 self.mainMenu.Enable(4, False) |
452 self.mainMenu.Enable( 5, False ) | 446 self.mainMenu.Enable(5, False) |
453 | 447 |
454 # Disable the ping menu items | 448 # Disable the ping menu items |
455 self.mainMenu.Enable( 7, False ) | 449 self.mainMenu.Enable(7, False) |
456 self.mainMenu.Enable( 8, False ) | 450 self.mainMenu.Enable(8, False) |
457 self.mainMenu.Enable( 9, False ) | 451 self.mainMenu.Enable(9, False) |
458 | 452 |
459 # Disable placeholders | 453 # Disable placeholders |
460 self.mainMenu.Enable( 11, False ) | 454 self.mainMenu.Enable(11, False) |
461 self.mainMenu.Enable( 14, False ) | 455 self.mainMenu.Enable(14, False) |
462 self.mainMenu.Enable( 12, False ) | 456 self.mainMenu.Enable(12, False) |
463 self.mainMenu.Enable( 13, False ) | 457 self.mainMenu.Enable(13, False) |
464 self.mainMenu.Enable( 15, False ) | 458 self.mainMenu.Enable(15, False) |
459 | |
465 def build_body(self): | 460 def build_body(self): |
466 """ Create the ViewNotebook and logger. """ | 461 """ Create the ViewNotebook and logger. """ |
467 splitter = wx.SplitterWindow(self, -1, style=wx.NO_3D | wx.SP_3D) | 462 splitter = wx.SplitterWindow(self, -1, style=wx.NO_3D | wx.SP_3D) |
468 nb = wx.Notebook( splitter, -1 ) | 463 nb = wx.Notebook(splitter, -1) |
469 self.conns = Connections(nb, self) | 464 self.conns = Connections(nb, self) |
470 self.groups = Groups(nb, self) | 465 self.groups = Groups(nb, self) |
471 self.msgWindow = HTMLMessageWindow( nb ) | 466 self.msgWindow = HTMLMessageWindow(nb) |
472 nb.AddPage(self.conns, "Players") | 467 nb.AddPage(self.conns, "Players") |
473 nb.AddPage(self.groups, 'Rooms') | 468 nb.AddPage(self.groups, 'Rooms') |
474 nb.AddPage( self.msgWindow, "Messages" ) | 469 nb.AddPage(self.msgWindow, "Messages") |
475 | 470 |
476 log = wx.TextCtrl(splitter, -1, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL) | 471 log = wx.TextCtrl(splitter, -1, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL) |
477 wx.Log.SetActiveTarget( wx.LogTextCtrl(log) ) | 472 wx.Log.SetActiveTarget(wx.LogTextCtrl(log)) |
478 splitter.SplitHorizontally(nb, log, 400) | 473 splitter.SplitHorizontally(nb, log, 400) |
479 splitter.SetMinimumPaneSize(40) | 474 splitter.SetMinimumPaneSize(40) |
480 self.nb = nb | 475 self.nb = nb |
481 self.log = log | 476 self.log = log |
482 | 477 |
527 self.conns.update(data) | 522 self.conns.update(data) |
528 | 523 |
529 def OnDataSent(self, bytes): | 524 def OnDataSent(self, bytes): |
530 self.total_messages_sent += 1 | 525 self.total_messages_sent += 1 |
531 self.total_data_sent += bytes | 526 self.total_data_sent += bytes |
532 self.sb.SetStatusText("Sent: %s (%d)" % (format_bytes(self.total_data_sent), self.total_messages_sent), 1) | 527 self.sb.SetStatusText("Sent: %s (%d)" % (format_bytes(self.total_data_sent), |
528 self.total_messages_sent), 1) | |
533 | 529 |
534 def OnDataRecv(self, bytes): | 530 def OnDataRecv(self, bytes): |
535 self.total_messages_received += 1 | 531 self.total_messages_received += 1 |
536 self.total_data_received += bytes | 532 self.total_data_received += bytes |
537 self.sb.SetStatusText("Recv: %s (%d)" % (format_bytes(self.total_data_received), self.total_messages_received), 2) | 533 self.sb.SetStatusText("Recv: %s (%d)" % (format_bytes(self.total_data_received), |
534 self.total_messages_received), 2) | |
538 | 535 |
539 def OnCreateGroup( self, data ): | 536 def OnCreateGroup( self, data ): |
540 (room, room_id, player, pwd) = data | 537 (room, room_id, player, pwd) = data |
541 self.groups.AddGroup(data) | 538 self.groups.AddGroup(data) |
542 self.conns.roomList[room_id] = room | 539 self.conns.roomList[room_id] = room |
550 | 547 |
551 def OnJoinGroup(self, data): | 548 def OnJoinGroup(self, data): |
552 self.conns.updateRoom(data) | 549 self.conns.updateRoom(data) |
553 | 550 |
554 def OnUpdateGroup(self, data): | 551 def OnUpdateGroup(self, data): |
555 (room, room_id, players) = data | 552 (room, room_id, players) = data; print 'update group', data |
556 self.groups.UpdateGroup(data) | 553 self.groups.UpdateGroup(data) |
557 | 554 |
558 def OnSetRole( self, data ): | 555 def OnSetRole( self, data ): |
559 (id, role) = data | 556 (id, role) = data |
560 self.conns.setPlayerRole(id, role) | 557 self.conns.setPlayerRole(id, role) |
561 | 558 |
562 ### Misc. ################################################ | 559 ### Misc. ################################################ |
563 def OnStart(self, event = None): | 560 def OnStart(self, event = None): |
564 """ Start server. """ | 561 """ Start server. """ |
565 if self.STATUS == SERVER_STOPPED: | 562 if self.STATUS == SERVER_STOPPED: |
566 # see if we already have name specified | 563 ## Set name and admin password as empty |
564 self.serverName = '' | |
565 self.bootPwd = '' | |
566 # see if we already have serverName and bootPwd specified | |
567 try: | 567 try: |
568 validate.config_file( "server_ini.xml", "default_server_ini.xml" ) | 568 validate.config_file( "server_ini.xml", "default_server_ini.xml" ) |
569 configDoc = parse(dir_struct["user"] + 'server_ini.xml').getroot() | 569 configDoc = parse(dir_struct["user"] + 'server_ini.xml').getroot() |
570 if configDoc.get("name"): self.serverName = configDoc.get("name") | 570 self.serverName = configDoc.get("name") |
571 if configDoc.get("admin"): self.bootPwd = configDoc.get("admin") | |
572 elif configDoc.get("boot"): self.bootPwd = configDoc.get("boot") | |
571 except: pass | 573 except: pass |
572 if self.serverName == '': | 574 if self.serverName == '': |
573 self.serverName = 'Server Name' | 575 self.serverName = 'Server Name' |
574 serverNameEntry = wx.TextEntryDialog(self, "Please Enter The Server Name You Wish To Use:", | 576 serverNameEntry = wx.TextEntryDialog(self, |
575 "Server's Name", self.serverName, wx.OK|wx.CANCEL|wx.CENTRE ) | 577 "Please Enter The Server Name You Wish To Use:", |
578 "Server's Name", | |
579 self.serverName, wx.OK|wx.CANCEL|wx.CENTRE) | |
576 if serverNameEntry.ShowModal() == wx.ID_OK: self.serverName = serverNameEntry.GetValue() | 580 if serverNameEntry.ShowModal() == wx.ID_OK: self.serverName = serverNameEntry.GetValue() |
577 # see if we already have password specified | |
578 try: | |
579 validate.config_file( "server_ini.xml", "default_server_ini.xml" ) | |
580 configDoc = parse(dir_struct["user"] + 'server_ini.xml').getroot() | |
581 if configDoc.get("admin"): self.bootPwd = configDoc.get("admin") | |
582 elif configDoc.get("boot"): self.bootPwd = configDoc.get("boot") | |
583 except: pass | |
584 if self.bootPwd == '': | 581 if self.bootPwd == '': |
585 serverPasswordEntry = wx.TextEntryDialog(self, | 582 serverPasswordEntry = wx.TextEntryDialog(self, |
586 "Please Enter The Server Admin Password:", "Server's Password", | 583 "Please Enter The Server Admin Password:", |
587 self.bootPwd, wx.OK|wx.CANCEL|wx.CENTRE) | 584 "Server's Password", |
585 self.bootPwd, wx.OK|wx.CANCEL|wx.CENTRE) | |
588 if serverPasswordEntry.ShowModal() == wx.ID_OK: self.bootPwd = serverPasswordEntry.GetValue() | 586 if serverPasswordEntry.ShowModal() == wx.ID_OK: self.bootPwd = serverPasswordEntry.GetValue() |
589 if len(self.serverName): | 587 if len(self.serverName): |
590 wx.BeginBusyCursor() | 588 wx.BeginBusyCursor() |
591 self.server = ServerMonitor(self.callbacks, self.conf, self.serverName, self.bootPwd) | 589 self.server = ServerMonitor(self.callbacks, self.conf, self.serverName, self.bootPwd) |
592 self.server.start() | 590 self.server.start() |
593 self.STATUS = SERVER_RUNNING | 591 self.STATUS = SERVER_RUNNING |
594 self.sb.SetStatusText("Running", 3) | 592 self.sb.SetStatusText("Running", 3) |
595 self.SetTitle(__appname__ + "- (running) - (unregistered)") | 593 self.SetTitle(__appname__ + "- (running) - (unregistered)") |
596 self.mainMenu.Enable( 1, False ) | 594 self.mainMenu.Enable(1, False) |
597 self.mainMenu.Enable( 2, True ) | 595 self.mainMenu.Enable(2, True) |
598 self.mainMenu.Enable( 4, True ) | 596 self.mainMenu.Enable(4, True) |
599 wx.EndBusyCursor() | 597 wx.EndBusyCursor() |
600 else: self.show_error("Server is already running.", "Error Starting Server") | 598 else: self.show_error("Server is already running.", "Error Starting Server") |
601 | 599 |
602 def OnStop(self, event = None): | 600 def OnStop(self, event = None): |
603 """ Stop server. """ | 601 """ Stop server. """ |
605 self.OnUnregister() | 603 self.OnUnregister() |
606 self.server.stop() | 604 self.server.stop() |
607 self.STATUS = SERVER_STOPPED | 605 self.STATUS = SERVER_STOPPED |
608 self.sb.SetStatusText("Stopped", 3) | 606 self.sb.SetStatusText("Stopped", 3) |
609 self.SetTitle(__appname__ + "- (stopped) - (unregistered)") | 607 self.SetTitle(__appname__ + "- (stopped) - (unregistered)") |
610 self.mainMenu.Enable( 1, True ) | 608 self.mainMenu.Enable(1, True) |
611 self.mainMenu.Enable( 2, False ) | 609 self.mainMenu.Enable(2, False) |
612 self.mainMenu.Enable( 4, False ) | 610 self.mainMenu.Enable(4, False) |
613 self.mainMenu.Enable( 5, False ) | 611 self.mainMenu.Enable(5, False) |
614 self.conns.DeleteAllItems() | 612 self.conns.DeleteAllItems() |
615 | 613 |
616 def OnRegister(self, event = None): | 614 def OnRegister(self, event = None): |
617 """ Call into mplay_server's register() function. | 615 """ Call into mplay_server's register() function. |
618 This will begin registerThread(s) to keep server | 616 This will begin registerThread(s) to keep server |
620 """ | 618 """ |
621 if len( self.serverName ): | 619 if len( self.serverName ): |
622 wx.BeginBusyCursor() | 620 wx.BeginBusyCursor() |
623 self.server.server.register(self.serverName) | 621 self.server.server.register(self.serverName) |
624 self.sb.SetStatusText( ("%s" % (self.serverName)), 4 ) | 622 self.sb.SetStatusText( ("%s" % (self.serverName)), 4 ) |
625 self.mainMenu.Enable( 4, False ) | 623 self.mainMenu.Enable(4, False) |
626 self.mainMenu.Enable( 5, True ) | 624 self.mainMenu.Enable(5, True) |
627 #self.mainMenu.Enable( 2, False ) | 625 #self.mainMenu.Enable( 2, False ) |
628 self.SetTitle(__appname__ + "- (running) - (registered)") | 626 self.SetTitle(__appname__ + "- (running) - (registered)") |
629 wx.EndBusyCursor() | 627 wx.EndBusyCursor() |
630 | 628 |
631 def OnUnregister(self, event = None): | 629 def OnUnregister(self, event = None): |
634 and result in the server being de-listed | 632 and result in the server being de-listed |
635 from all metas | 633 from all metas |
636 """ | 634 """ |
637 wx.BeginBusyCursor() | 635 wx.BeginBusyCursor() |
638 self.server.server.unregister() | 636 self.server.server.unregister() |
639 self.sb.SetStatusText( "Unregistered", 4 ) | 637 self.sb.SetStatusText("Unregistered", 4) |
640 self.mainMenu.Enable( 5, False ) | 638 self.mainMenu.Enable(5, False) |
641 self.mainMenu.Enable( 4, True ) | 639 self.mainMenu.Enable(4, True) |
642 #self.mainMenu.Enable( 2, True ) | 640 #self.mainMenu.Enable( 2, True ) |
643 self.SetTitle(__appname__ + "- (running) - (unregistered)") | 641 self.SetTitle(__appname__ + "- (running) - (unregistered)") |
644 wx.EndBusyCursor() | 642 wx.EndBusyCursor() |
645 | 643 |
646 def ModifyBanList(self, event): | 644 def ModifyBanList(self, event): |