comparison orpg/networking/gsclient.py @ 152:6081bdc2b8d5 beta

Traipse Beta 'OpenRPG' {091125-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 (Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana Pretty important update that can help remove thousands of dead children from your gametree. Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! New Gametree Recursion method, mapping, and context sensitivity. !Infinite Loops return error instead of freezing the software! New Syntax added for custom PC sheets Tip of the Day added, from Core and community Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix.
author sirebral
date Wed, 25 Nov 2009 06:16:35 -0600
parents e842a5f1b775
children dcae32e219f1
comparison
equal deleted inserted replaced
150:6c5f46a5924b 152:6081bdc2b8d5
55 self.addy = address 55 self.addy = address
56 self.port = port 56 self.port = port
57 57
58 def server_instance_compare(x,y): 58 def server_instance_compare(x,y):
59 """compares server insances for list sort""" 59 """compares server insances for list sort"""
60 ### Alpha ### makes changes from core.
61 DEV_SERVER = "OpenRPG DEV" 60 DEV_SERVER = "OpenRPG DEV"
62 xname = x.name 61 xname = x.name
63 xuser = int(x.user) 62 xuser = int(x.user)
64 yname = y.name 63 yname = y.name
65 yuser = int(y.user) 64 yuser = int(y.user)
297 #make sure address is updated just in case list select wasn't done 296 #make sure address is updated just in case list select wasn't done
298 try: self.on_select(evt) 297 try: self.on_select(evt)
299 except: pass 298 except: pass
300 address = self.texts["address"].GetValue() 299 address = self.texts["address"].GetValue()
301 if self.session.is_connected(): 300 if self.session.is_connected():
302 if self.session.host_server == address : 301 if self.session.host_server == address : return #currently connected to address. Do nothing.
303 #currently connected to address. Do nothing. 302 else: self.frame.kill_mplay_session() #address differs, disconnect.
304 return
305 else:
306 #address differs, disconnect.
307 self.frame.kill_mplay_session()
308 self.do_connect(address) 303 self.do_connect(address)
309 304
310 def on_room_dbclick(self, evt=None): 305 def on_room_dbclick(self, evt=None):
311 #make sure address is updated just in case list select wasn't done 306 #make sure address is updated just in case list select wasn't done
312 try: self.on_select(evt) 307 try: self.on_select(evt)
353 #print "ADDRESS id = ", id, "index = ", self.cur_server_index 348 #print "ADDRESS id = ", id, "index = ", self.cur_server_index
354 self.cur_server_index = -1 349 self.cur_server_index = -1
355 evt.Skip() 350 evt.Skip()
356 351
357 def add_room(self, data): 352 def add_room(self, data):
358 #debug()
359 i = self.room_list.GetItemCount() 353 i = self.room_list.GetItemCount()
360 if (data[2]=="1") or (data[2]=="True"): pwd="yes" 354 if (data[2]=="1") or (data[2]=="True"): pwd="yes"
361 else: pwd="no" 355 else: pwd="no"
362 self.room_list.InsertStringItem(i,data[1]) 356 self.room_list.InsertStringItem(i,data[1])
363 self.room_list.SetStringItem(i,1,data[3]) 357 self.room_list.SetStringItem(i,1,data[3])
364 self.room_list.SetStringItem(i,2,pwd) 358 self.room_list.SetStringItem(i,2,pwd)
365 self.room_list.SetItemData(i,int(data[0])) 359 self.room_list.SetItemData(i,int(data[0]))
366 self.refresh_room_list() 360 self.refresh_room_list()
367 361
368 def del_room(self, data): 362 def del_room(self, data):
369 #debug(data)
370 i = self.room_list.FindItemData(-1, int(data[0])) 363 i = self.room_list.FindItemData(-1, int(data[0]))
371 self.room_list.DeleteItem(i) 364 self.room_list.DeleteItem(i)
372 self.refresh_room_list() 365 self.refresh_room_list()
373 366
374 def update_room(self, data): 367 def update_room(self, data):
398 self.room_list.DeleteAllItems() 391 self.room_list.DeleteAllItems()
399 self.set_cur_room_text("Not Connected!") 392 self.set_cur_room_text("Not Connected!")
400 self.cur_room_index = -1 393 self.cur_room_index = -1
401 self.frame.status.set_connect_status("Not Connected") 394 self.frame.status.set_connect_status("Not Connected")
402 else: 395 else:
403 #data = self.session.get_my_group()
404 self.frame.status.set_connect_status(self.name) 396 self.frame.status.set_connect_status(self.name)
405 self.set_cur_room_text("Lobby") 397 self.set_cur_room_text("Lobby")
406 398
407 def gs_connect(self, evt): 399 def gs_connect(self, evt):
408 address = self.texts['address'].GetValue() 400 address = self.texts['address'].GetValue()
483 if len(node_list): 475 if len(node_list):
484 length = len(node_list) 476 length = len(node_list)
485 part = 0 477 part = 0
486 partLength = 1.0/length 478 partLength = 1.0/length
487 for n in node_list: 479 for n in node_list:
488 #if n.get('id') and n.get('name') and n.get('num_users') and n.get('address') and n.get('port'):
489 self.svrList.append(server_instance(n.get('id'), n.get('name'), 480 self.svrList.append(server_instance(n.get('id'), n.get('name'),
490 n.get('num_users'), n.get('address'), 481 n.get('num_users'), n.get('address'),
491 n.get('port'))) 482 n.get('port')))
492 address = n.get('address') + ':' + n.get('port') 483 address = n.get('address') + ':' + n.get('port')
493 self.rmList[address] = [] 484 self.rmList[address] = []
622 msg = "%s is creating room \'%s.\'" % (self.session.name, name) 613 msg = "%s is creating room \'%s.\'" % (self.session.name, name)
623 self.session.send(msg) 614 self.session.send(msg)
624 self.session.send_create_group(name, pwd, boot_pwd, minversion) 615 self.session.send_create_group(name, pwd, boot_pwd, minversion)
625 self.set_lobbybutton(1); #enable the Lobby quickbutton 616 self.set_lobbybutton(1); #enable the Lobby quickbutton
626 617
627 #---------------------------------------------------------
628 # [START] Snowdog: Updated Game Server Window 12/02
629 #---------------------------------------------------------
630
631 def on_size(self, evt): 618 def on_size(self, evt):
632 # set column widths for room list 619 # set column widths for room list
633 # set column widths for server list 620 # set column widths for server list
634 pass 621 pass
635
636 #---------------------------------------------------------
637 # [END] Snowdog: Updated Game Server Window 12/02
638 #---------------------------------------------------------
639 622
640 def colorize_group_list(self, groups): 623 def colorize_group_list(self, groups):
641 try: 624 try:
642 hex = orpg.tools.rgbhex.RGBHex() 625 hex = orpg.tools.rgbhex.RGBHex()
643 for gr in groups: 626 for gr in groups: