comparison orpg/networking/mplay_server.py @ 98:95b5281e8d34 alpha

Traipse Alpha 'OpenRPG' {090925-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: 00: Update forwards to the 090909-02 Server code that now works. New default Lobby Map, designed for Traipse. Feel free to change it. Updates to Server GUI: * Admin can Ban from Backend. * Prework to modify Ban List in back end. * Server GUI finds your Lobby Name * New users default as Lurker unless a Role is set New Addition to Chat Die Roll commands. Math Ordering. Ex. [(X+Y)dZ]. Currently does pairs only, no nesting either. Cleaner TraipseSuiteAttention portability and clean up in Main (Beta!) 01: Die Roll Commands addition removed in favor of Core code {090925-00}: Updates to Server GUI: *Admin can Modify Ban List and Un Ban users. New About Dialog. A more uniform About Dialog.
author sirebral
date Fri, 25 Sep 2009 06:16:37 -0500
parents 65c1604e7949
children ded1e7a25f8d
comparison
equal deleted inserted replaced
97:bb22f0f1a7ec 98:95b5281e8d34
2078 2078
2079 except Exception, e: 2079 except Exception, e:
2080 traceback.print_exc() 2080 traceback.print_exc()
2081 self.log_msg('Exception in admin_kick() ' + str(e)) 2081 self.log_msg('Exception in admin_kick() ' + str(e))
2082 2082
2083 ### Alpha ### Addition added to assist in Un Banning users.
2084 def admin_build_banlist(self):
2085 validate.config_file("ban_list.xml", "default_ban_list.xml" )
2086 configDom = minidom.parse(dir_struct["user"] + 'ban_list.xml')
2087 self.ban_list = {}
2088 for element in configDom.getElementsByTagName('banned'):
2089 player = element.getAttribute('name').replace("&", "&amp;").replace("<", "&lt;").replace('"', "&quot;").replace(">", "&gt;")
2090 ip = element.getAttribute('ip')
2091 self.ban_list[ip] = {}
2092 self.ban_list[ip]['ip'] = ip
2093 self.ban_list[ip]['name'] = element.getAttribute('name')
2094 ################
2095
2083 def admin_banip(self, ip, name="", silent = 0): 2096 def admin_banip(self, ip, name="", silent = 0):
2084 "Ban a player from a server from the console" 2097 "Ban a player from a server from the console"
2098 self.adming_buile_banlist() ### Alpha ###
2085 try: 2099 try:
2086 self.ban_list[ip] = {} 2100 self.ban_list[ip] = {}
2087 self.ban_list[ip]['ip'] = ip 2101 self.ban_list[ip]['ip'] = ip
2088 self.ban_list[ip]['name'] = name 2102 self.ban_list[ip]['name'] = name
2089 self.saveBanList() 2103 self.saveBanList()
2123 except Exception, e: 2137 except Exception, e:
2124 traceback.print_exc() 2138 traceback.print_exc()
2125 self.log_msg('Exception in admin_ban() ' + str(e)) 2139 self.log_msg('Exception in admin_ban() ' + str(e))
2126 2140
2127 def admin_unban(self, ip): 2141 def admin_unban(self, ip):
2142 self.admin_build_banlist()
2128 try: 2143 try:
2129 if self.ban_list.has_key(ip): del self.ban_list[ip] 2144 if self.ban_list.has_key(ip): del self.ban_list[ip]
2130 self.saveBanList() 2145 self.saveBanList()
2131 2146
2132 except Exception, e: 2147 except Exception, e:
2569 pl += "<font color=" + COLOR4 + "><b><i>Statistics: groups: " + str(len(self.groups)) + " " 2584 pl += "<font color=" + COLOR4 + "><b><i>Statistics: groups: " + str(len(self.groups)) + " "
2570 pl += "players: " + str(len(self.players)) + "</i></b></font></td></tr></table>" 2585 pl += "players: " + str(len(self.players)) + "</i></b></font></td></tr></table>"
2571 except Exception, e: self.log_msg(str(e)) 2586 except Exception, e: self.log_msg(str(e))
2572 self.p_lock.release() 2587 self.p_lock.release()
2573 return pl 2588 return pl
2589
2590 server = mplay_server()