Mercurial > traipse_dev
diff orpg/chat/chatwnd.py @ 97:bb22f0f1a7ec alpha
Traipse Alpha 'OpenRPG' {090924-01}
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
author | sirebral |
---|---|
date | Thu, 24 Sep 2009 21:21:49 -0500 |
parents | 65c1604e7949 |
children | 217fb049bd00 |
line wrap: on
line diff
--- a/orpg/chat/chatwnd.py Thu Sep 24 02:05:08 2009 -0500 +++ b/orpg/chat/chatwnd.py Thu Sep 24 21:21:49 2009 -0500 @@ -1854,7 +1854,6 @@ matches = reg.findall(s) for i in xrange(0,len(matches)): newstr = self.PraseUnknowns(matches[i]) - newstr = self.ParseMathOrder(matches[i]) qmode = 0 newstr1 = newstr if newstr[0].lower() == 'q': @@ -1886,20 +1885,6 @@ s = s.replace(matches[i][0], newstr, 1).replace(matches[i][1], '', 1).replace(matches[i][2], '', 1) dlg.Destroy() return s - - def ParseMathOrder(self, s): - ### Alpha ### New Code allows for Math Ordering with ()'s. Currently allows only pairs. - reg = re.compile("\(([^]]*?)\)") - matches = reg.findall(s) - for i in xrange(0,len(matches)): - node_math = self.ParseNode(matches[i]) - do_math = list(str(node_math)) - if do_math[1] == '+': math = int(do_math[0]) + int(do_math[2]) - if do_math[1] == '-': math = int(do_math[0]) - int(do_math[2]) - if do_math[1] == '*': math = int(do_math[0]) * int(do_math[2]) - if do_math[1] == '/': math = int(do_math[0]) / int(do_math[2]) - s = s.replace(matches[i], str(math)).replace('(', '').replace(')','') - return s # This subroutine builds a chat display name. #