From: Daniel A. <cor...@us...> - 2002-01-26 23:30:02
|
Update of /cvsroot/planeshift/planeshift/src/server In directory usw-pr-cvs1:/tmp/cvs-serv3074/src/server Modified Files: chatmanager.cpp Log Message: updated obscenity list Index: chatmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/chatmanager.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** chatmanager.cpp 2002/01/26 23:17:11 1.24 --- chatmanager.cpp 2002/01/26 23:29:59 1.25 *************** *** 17,20 **** --- 17,45 ---- SCF_IMPLEMENT_IBASE_END + /* Move this to database some time */ + static const char *bad_words[] = + { "shit", + "damn", + "bastard", + "bitch", + "fucker", + "fuckwitt", + "damnit", + "fuck", + "fuk", + "asshole", + "ass", + "@$$", + "whore", + "wh0re", + "dickhead", + "$#!T", + "masterbate", + "cybersex", + "fag", + "h4x0r", + "wanker", + NULL }; + ChatManager::ChatManager(MsgHandler *mh,ClientConnectionSet *pClnts) { *************** *** 59,85 **** { char *badword; - - if ((badword = strstr(buff,"fuck"))) - { - strncpy(badword+1, "$@!", 3); - continue; - } - - if ((badword = strstr(buff,"shit"))) - { - strncpy(badword+1, "$@!", 3); - continue; - } - - if ((badword = strstr(buff,"bastard"))) - { - strncpy(badword+1, "$@!$@!", 6); - continue; - } ! if ((badword = strstr(buff,"damn"))) { ! strncpy(badword+1, "$@!", 3); ! continue; } --- 84,95 ---- { char *badword; ! for (int i = 0; bad_words[i] != NULL; i++) { ! if ((badword = strstr(buff, bad_words[i]))) ! { ! strncpy(badword+1, "$@!", strlen(bad_words[i])-1); ! continue; ! } } |