comparison orpg/networking/mplay_server_gui.py @ 236:9230a33defd9 beta

Traipse Beta 'OpenRPG' {100616-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 (Closing/Closed) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order New to Server GUI, can now clear log Updates: Update to Warhammer PC Sheet. Rollers set as macros. Should work with little maintanence. Update to Browser Server window. Display rooms with ' " & cleaner Update to Server. Handles ' " & cleaner. Fixes: Fix to InterParse that was causing an Infernal Loop with Namespace Internal Fix to XML data, removed old Minidom and switched to Element Tree Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread Fix to metaservers.xml file not being created Fix to Single and Double quotes in Whiteboard text Fix to Background images not showing when using the Image Server Fix to Duplicate chat names appearing Fix to Server GUI's logging output Fix to FNB.COLORFUL_TABS bug.
author sirebral
date Wed, 16 Jun 2010 03:06:20 -0500
parents b29454610f36
children
comparison
equal deleted inserted replaced
226:b29454610f36 236:9230a33defd9
346 broadcast = '<chat type="1" version="1.0"><font color="#FF0000">' +msg+ '</font></chat>' 346 broadcast = '<chat type="1" version="1.0"><font color="#FF0000">' +msg+ '</font></chat>'
347 chat = Element('chat') 347 chat = Element('chat')
348 chat.set('type', '1') 348 chat.set('type', '1')
349 chat.set('version', '1.0') 349 chat.set('version', '1.0')
350 chat.text = broadcast 350 chat.text = broadcast
351 msg = self.main.server.server.buildMsg('all', '0', '1', tostring(chat)) 351 msg = self.main.server.server.buildMsg('all',
352 '0',
353 str(self.main.server.server.players[playerID]),
354 tostring(chat))
352 355
353 if len(msg): self.main.server.server.send_to_group('0', str(groupID), msg ) 356 if len(msg): self.main.server.server.send_to_group('0', str(groupID), msg )
354 elif menuItem == 6: 357 elif menuItem == 6:
355 msg = self.GetMessageInput( "Broadcast Server Message" ) 358 msg = self.GetMessageInput( "Broadcast Server Message" )
356 if len(msg): self.main.server.server.broadcast(msg ) 359 if len(msg): self.main.server.server.broadcast(msg )
418 421
419 # File Menu 422 # File Menu
420 menu = wx.Menu() 423 menu = wx.Menu()
421 menu.Append(1, 'Start', 'Start server.') 424 menu.Append(1, 'Start', 'Start server.')
422 menu.Append(2, 'Stop', 'Shutdown server.') 425 menu.Append(2, 'Stop', 'Shutdown server.')
426 menu.Append(16, 'Clear Log', 'Empty server log')
423 menu.AppendSeparator() 427 menu.AppendSeparator()
424 menu.Append(3, 'E&xit', 'Exit application.') 428 menu.Append(3, 'E&xit', 'Exit application.')
425 self.Bind(wx.EVT_MENU, self.OnStart, id=1) 429 self.Bind(wx.EVT_MENU, self.OnStart, id=1)
426 self.Bind(wx.EVT_MENU, self.OnStop, id=2) 430 self.Bind(wx.EVT_MENU, self.OnStop, id=2)
427 self.Bind(wx.EVT_MENU, self.OnExit, id=3) 431 self.Bind(wx.EVT_MENU, self.OnExit, id=3)
453 self.Bind(wx.EVT_MENU, self.ModifyBanList, id=6) 457 self.Bind(wx.EVT_MENU, self.ModifyBanList, id=6)
454 self.Bind(wx.EVT_MENU, self.PingPlayers, id=7) 458 self.Bind(wx.EVT_MENU, self.PingPlayers, id=7)
455 self.Bind(wx.EVT_MENU, self.StopPingPlayers, id=8) 459 self.Bind(wx.EVT_MENU, self.StopPingPlayers, id=8)
456 self.Bind(wx.EVT_MENU, self.ConfigPingInterval, id=9) 460 self.Bind(wx.EVT_MENU, self.ConfigPingInterval, id=9)
457 self.Bind(wx.EVT_MENU, self.LogToggle, id=10) 461 self.Bind(wx.EVT_MENU, self.LogToggle, id=10)
462 self.Bind(wx.EVT_MENU, self.ClearLog, id=16)
458 self.mainMenu.Append( menu, '&Configuration') 463 self.mainMenu.Append( menu, '&Configuration')
459 464
460 # Traipse Suite of Additions. 465 # Traipse Suite of Additions.
461 self.traipseSuite = wx.Menu() 466 self.traipseSuite = wx.Menu()
462 self.debugger = DebugConsole(self) 467 self.debugger = DebugConsole(self)
559 564
560 565
561 # Event handler for out logging event 566 # Event handler for out logging event
562 def LogToggle(self, event): 567 def LogToggle(self, event):
563 self.do_log = event.IsChecked() 568 self.do_log = event.IsChecked()
569
570 def ClearLog(self, event):
571 self.log.SetValue('')
564 572
565 def OnLogMessage( self, event ): 573 def OnLogMessage( self, event ):
566 self.Log( event.message ) 574 self.Log( event.message )
567 575
568 # Event handler for out logging event 576 # Event handler for out logging event
656 self.mainMenu.Enable(2, True) 664 self.mainMenu.Enable(2, True)
657 self.mainMenu.Enable(4, True) 665 self.mainMenu.Enable(4, True)
658 wx.EndBusyCursor() 666 wx.EndBusyCursor()
659 else: self.show_error("Server is already running.", "Error Starting Server") 667 else: self.show_error("Server is already running.", "Error Starting Server")
660 668
661 def OnStop(self, event = None): 669 def OnStop(self, event=None):
662 """ Stop server. """ 670 """ Stop server. """
663 if self.STATUS == SERVER_RUNNING: 671 if self.STATUS == SERVER_RUNNING:
664 self.OnUnregister() 672 self.OnUnregister(event)
665 self.server.stop() 673 self.server.stop()
666 self.STATUS = SERVER_STOPPED 674 self.STATUS = SERVER_STOPPED
667 self.sb.SetStatusText("Stopped", 3) 675 if event != 'Quit':
668 self.SetTitle(__appname__ + "- (stopped) - (unregistered)") 676 self.sb.SetStatusText("Stopped", 3)
669 self.mainMenu.Enable(1, True) 677 self.SetTitle(__appname__ + "- (stopped) - (unregistered)")
670 self.mainMenu.Enable(2, False) 678 self.mainMenu.Enable(1, True)
671 self.mainMenu.Enable(4, False) 679 self.mainMenu.Enable(2, False)
672 self.mainMenu.Enable(5, False) 680 self.mainMenu.Enable(4, False)
673 self.conns.DeleteAllItems() 681 self.mainMenu.Enable(5, False)
682 self.conns.DeleteAllItems()
674 683
675 def OnRegister(self, event = None): 684 def OnRegister(self, event = None):
676 """ Call into mplay_server's register() function. 685 """ Call into mplay_server's register() function.
677 This will begin registerThread(s) to keep server 686 This will begin registerThread(s) to keep server
678 registered with configured metas 687 registered with configured metas
693 and result in the server being de-listed 702 and result in the server being de-listed
694 from all metas 703 from all metas
695 """ 704 """
696 wx.BeginBusyCursor() 705 wx.BeginBusyCursor()
697 self.server.server.unregister() 706 self.server.server.unregister()
698 self.sb.SetStatusText("Unregistered", 4) 707 if event != 'Quit':
699 self.mainMenu.Enable(5, False) 708 self.sb.SetStatusText("Unregistered", 4)
700 self.mainMenu.Enable(4, True) 709 self.mainMenu.Enable(5, False)
701 #self.mainMenu.Enable( 2, True ) 710 self.mainMenu.Enable(4, True)
702 self.SetTitle(__appname__ + "- (running) - (unregistered)") 711 #self.mainMenu.Enable( 2, True )
712 self.SetTitle(__appname__ + "- (running) - (unregistered)")
703 wx.EndBusyCursor() 713 wx.EndBusyCursor()
704 714
705 def ModifyBanList(self, event): 715 def ModifyBanList(self, event):
706 if self.BanListDialog.IsShown() == True: self.BanListDialog.Hide() 716 if self.BanListDialog.IsShown() == True: self.BanListDialog.Hide()
707 else: self.BanListDialog.Show() 717 else: self.BanListDialog.Show()
724 dlg.Destroy() 734 dlg.Destroy()
725 self.ExitConfirmed() 735 self.ExitConfirmed()
726 736
727 def ExitConfirmed(self, event=None): 737 def ExitConfirmed(self, event=None):
728 """ Quit the program. """ 738 """ Quit the program. """
729 self.OnStop() 739 self.OnStop('Quit')
730 self.BanListDialog.Destroy() 740 self.BanListDialog.Destroy()
731 wx.CallAfter(self.Destroy) 741 wx.CallAfter(self.Destroy)
732 742
733 class BanListDialog(wx.Frame): 743 class BanListDialog(wx.Frame):
734 def __init__(self, parent): 744 def __init__(self, parent):