BadNames Filter
Locked
FLHook Development
-
Badname Filter
sorry, bad englich
Hi,
folgendes Problem,
ich hab vor Jahren im altem DN coder Forum mal einen Script für einen Badname Filter gefunden,
damals wollten wir das in unsere Hook (5.5) einbinden was uns auch gelang,jetzt nutzen wir die flhook plugin 5.9 und da wollte ich diese Funktion wider einbinden
doch der Filter scheint trotz 0 error beim compiliren nicht in der 5.9 zu funktionieren
denn man kann nach wie vor jeden namen der in der Badnames liste steht erstellenFLHook - 0 error(s), 0 warning(s)
–-------------------- Done ----------------------
Rebuild All: 1 succeeded, 0 failed, 0 skipped
Hier mal der quellcode,
ich weis leider nicht mehr wer der autor dieses codes istBad name list Created a namefilter for new characters so you can block certain words in a characters name or specific names entirely. It used the wildcard stuff that IP bans use as well. Names are defined in a list in flhook.ini under the header [BadNames] 1\. Open up server.h and place this struct anywhere on the page: Code: struct SCreateCharacterInfo { wchar_t wszCharname[256]; }; 2\. Open up global.h and add this after "// setting variables" at the end: Code: extern list <wstring>set_lstNames; 3\. Open up Settings.cpp and add this after "// setting variables" at the end: Code: list <wstring>set_lstNames; 4\. Open up Settings.cpp and add this inside "void LoadSettings()" at the end: Code: // names set_lstNames.clear(); IniGetSection(set_scCfgFile, "BadNames", lstValues); lstValues.pop_front(); foreach(lstValues, INISECTIONVALUE, itisv) set_lstNames.push_back(stows(itisv->scKey)); 5\. Open up HkCbIServerImpl.cpp and inside "void __stdcall CreateNewCharacter" right after "ISERVER_LOGARG_UI(iClientID);" add: Code: foreach(set_lstNames, wstring, itb) { if(Wildcard::wildcardfit(wstos(*itb).c_str(), wstos(ToLower(scci.wszCharname)).c_str())) { HkKick(ARG_CLIENTID(iClientID)); return; } } All this will kick the player before he can create the char so even if he comes back, the char won't actualy be created. For the flhook.ini add a new section named "[BadNames]" and put all your 'unwanted' names below it. Use wildcards to disalow certain word in names. It would look like this [BadNames] *adolf* *admin*</wstring></wstring>