comparison orpg/networking/gsclient.py @ 36:d02e9197c066 ornery-orc

Traipse 'OpenRPG' {101220-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 (Closed) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order New to Server GUI, can now clear log New Earthdawn Dieroller New IronClaw roller, sheet, and image New ShapeShifter PC Sheet 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 Update to Dieroller. Cleaner, more effecient expression system Update to Hidden Die plugin, allows for non standard dice rolls Update to location.py, allows for more portable references when starting Traipse Update to the Features node 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 Server, removing wxPython dependencies where not needed 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 Fix to Gametree for XSLT Sheets Fix to Gametree for locating gametree files Fix to Send to Chat from Gametree Fix to Gametree, renaming and remapping operates correctly Fix to aliaslib, prevents error caused when SafeHTML is sent None
author sirebral
date Sun, 19 Dec 2010 22:44:36 -0600
parents ff154cf3350c
children
comparison
equal deleted inserted replaced
35:ee890f424e16 36:d02e9197c066
347 347
348 def add_room(self, data): 348 def add_room(self, data):
349 i = self.room_list.GetItemCount() 349 i = self.room_list.GetItemCount()
350 if (data[2]=="1") or (data[2]=="True"): pwd="yes" 350 if (data[2]=="1") or (data[2]=="True"): pwd="yes"
351 else: pwd="no" 351 else: pwd="no"
352 self.room_list.InsertStringItem(i,data[1]) 352 name = data[1].replace('&', "&")
353 name = name.replace('&quot;', '"').replace('&#39;', "'").replace("&lt;", '<').replace("&gt;", '>')
354 self.room_list.InsertStringItem(i, name)
353 self.room_list.SetStringItem(i,1,data[3]) 355 self.room_list.SetStringItem(i,1,data[3])
354 self.room_list.SetStringItem(i,2,pwd) 356 self.room_list.SetStringItem(i,2,pwd)
355 self.room_list.SetItemData(i,int(data[0])) 357 self.room_list.SetItemData(i,int(data[0]))
356 self.refresh_room_list() 358 self.refresh_room_list()
357 359
439 groups = self.session.get_groups() 441 groups = self.session.get_groups()
440 for g in groups: 442 for g in groups:
441 i = self.room_list.GetItemCount() 443 i = self.room_list.GetItemCount()
442 if (g[2]=="True") or (g[2]=="1") : pwd="yes" 444 if (g[2]=="True") or (g[2]=="1") : pwd="yes"
443 else: pwd="no" 445 else: pwd="no"
444 self.room_list.InsertStringItem(i, g[1]) 446 name = g[1].replace('&amp;', "&")
447 name = name.replace('&quot;', '"').replace('&#39;', "'").replace("&lt;", '<').replace("&gt;", '>')
448 self.room_list.InsertStringItem(i, name)
445 self.room_list.SetStringItem(i, 1, g[3]) 449 self.room_list.SetStringItem(i, 1, g[3])
446 self.room_list.SetStringItem(i, 2, pwd) 450 self.room_list.SetStringItem(i, 2, pwd)
447 self.room_list.SetItemData(i, int(g[0])) 451 self.room_list.SetItemData(i, int(g[0]))
448 if self.room_list.GetItemCount() > 0: 452 if self.room_list.GetItemCount() > 0:
449 self.colorize_group_list(groups) 453 self.colorize_group_list(groups)
479 address = n.get('address') + ':' + n.get('port') 483 address = n.get('address') + ':' + n.get('port')
480 self.rmList[address] = [] 484 self.rmList[address] = []
481 rooms = n.findall('room') 485 rooms = n.findall('room')
482 486
483 for room in rooms: 487 for room in rooms:
484 self.rmList[address].append((room.get("id"), room.get("name"), 488 name = room.get('name').replace('&amp;', "&")
489 name = name.replace('&quot;', '"').replace('&#39;', "'").replace("&lt;", '<').replace("&gt;", '>')
490 self.rmList[address].append((room.get("id"), name,
485 room.get("pwd"), room.get("num_users"))) 491 room.get("pwd"), room.get("num_users")))
486 self.svrList.sort(server_instance_compare) 492 self.svrList.sort(server_instance_compare)
487 493
488 for n in self.svrList: 494 for n in self.svrList:
489 i = self.server_list.GetItemCount() 495 i = self.server_list.GetItemCount()
566 572
567 def do_create_group(self): 573 def do_create_group(self):
568 name = self.texts["room_name"].GetValue() 574 name = self.texts["room_name"].GetValue()
569 boot_pwd = self.texts["room_boot_pwd"].GetValue() 575 boot_pwd = self.texts["room_boot_pwd"].GetValue()
570 minversion = self.texts["room_min_version"].GetValue() 576 minversion = self.texts["room_min_version"].GetValue()
571 # 577
572 # Check for & in name. We want to allow this becaus of its common use in D&D.
573 #
574 loc = name.find("&")
575 oldloc=0
576 while loc > -1:
577 loc = name.find("&",oldloc)
578 if loc > -1:
579 b = name[:loc]
580 e = name[loc+1:]
581 name = b + "&amp;" + e
582 oldloc = loc+1
583 loc = name.find('"')
584 oldloc=0
585 while loc > -1:
586 loc = name.find('"',oldloc)
587 if loc > -1:
588 b = name[:loc]
589 e = name[loc+1:]
590 name = b + "&quote;" + e
591 oldloc = loc+1
592 loc = name.find("'")
593 oldloc=0
594 while loc > -1:
595 loc = name.find("'",oldloc)
596 if loc > -1:
597 b = name[:loc]
598 e = name[loc+1:]
599 name = b + "&#39;" + e
600 oldloc = loc+1
601 if self.buttons['gs_pwd'].GetValue(): pwd = self.texts["room_pwd"].GetValue() 578 if self.buttons['gs_pwd'].GetValue(): pwd = self.texts["room_pwd"].GetValue()
602 else: pwd = "" 579 else: pwd = ""
603 if name == "": wx.MessageBox("Invalid Name","Error"); 580 if name == "": wx.MessageBox("Invalid Name","Error");
604 else: 581 else:
605 msg = "%s is creating room \'%s.\'" % (self.session.name, name) 582 msg = "%s is creating room \'%s.\'" % (self.session.name, name)