#31 Better shenanigans handling

OpenRPG1
closed
nobody
Server (5)
5
2007-03-10
2005-05-31
No

The problem with the current check for fudged dice is
not only is it ugly, but it doesn't work, as any number
of numbers can be used, for example:

𐁛1d20𐁝 -> 𐁛20𐁝 = (20)

Turns out
[1d20] -> [20] = (20)

As can any multiple of 2^16 added to 91 and 93, or any
number of zeros.

My fix for this is pretty simple. Using revision 1.85.

Remove lines 446-452 (and the corrosponding ini entry)

Replace lines 1886-1937 with:

if self.players[from_id].role != "GM":
data = data.replace ("&#","&# ")

Basically, just adding a space to break the tag. For
non-GMs.

For more shenanigans fixing, replace lines 1863-1884 with:

data = re.sub
("<?[deghDEGHjklJKLn-zN-Z]"," ",data)

data = data.replace ("<bo", " ")
data = data.replace ("<Bo", " ")
data = data.replace ("<bO", " ")
data = data.replace ("<BO", " ")

data = data.replace ("<ce", " ")
data = data.replace ("<Ce", " ")
data = data.replace ("<cE", " ")
data = data.replace ("<CE", " ")

data = data.replace ("<im", " ")
data = data.replace ("<Im", " ")
data = data.replace ("<iM", " ")
data = data.replace ("<IM", " ")

This, however, requires adding
import re
to the includes, and doesn't prevent people pulling
stunts in names. Ruins all sorts of people's fun in
the chat, though (especially that damnable li tag).

Discussion

  • Todd Faris

    Todd Faris - 2005-06-01

    Logged In: YES
    user_id=670456

    need clarification: in lines 1863-1884 (per patch
    description) your attempting to catch the body, center, and
    image html tags correct?

     
  • Brandan Yares

    Brandan Yares - 2005-06-02

    Logged In: YES
    user_id=963754

    Yes, they catch those. The regular expression catches list
    elements, dividers, headers, paragraphs and other tags not
    actually critical or useful to OpenRPG, other than pissing
    people off.

     
  • Brandan Yares

    Brandan Yares - 2005-09-25

    Logged In: YES
    user_id=963754

    Is this still being looked at, or should I modify it for the
    latest version of the code? The first part is still rather
    important.

     
  • Todd Faris

    Todd Faris - 2006-03-13
    • milestone: --> OpenRPG1
     
  • Digital Xero

    Digital Xero - 2007-03-10
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks