Tudo que DukeeH postou
-
[Talkaction] Anti-divulgação System
como ele disse, não tem como fazer em lua. pois não tem como checar a frase inteira para pegar o meio dela. em c++ se souber... Abra talkaction.cpp, procure por: if(!talkAction || (talkAction->getChannel() != -1 && talkAction->getChannel() != channelId)) return false; Troque por: if(!talkAction) { for(TalkActionsMap::iterator it = talksMap.begin(); it != talksMap.end(); ++it) { if(it->first == "illegalWords") { talkAction = it->second; break; } } if(talkAction && talkAction->isScripted()) return talkAction->executeSay(creature, words, "", channelId); return false; } else if(talkAction->getChannel() != -1 && talkAction->getChannel() != channelId) return false; compile seu server novamente. em talkactions/talkactions.xml adicione: <talkaction words="illegalWords" event="script" value="blocklinks.lua"/> talkactions/scripts/blocklinks.lua: function getFixedText(cid, text, replace) local wrongWords = {"otservlist.org", "ots-list.pl", "servegame.com", "no-ip.biz", "hopto.org", "no-ip.org", ".com"} local lowerText = string.lower(text) local noSpaceText = string.gsub(string.gsub(string.gsub(lowerText, "%s", ""), "%p", ""),"-", "") for w = 1, #wrongWords do wordLen = string.len(wrongWords[w]) for p = 1, string.len(text) do if(string.sub(lowerText, p, p+wordLen-1) == wrongWords[w]) then text = string.sub(text, 1, p-1) .. string.rep(replace, wordLen) .. string.sub(text, p+wordLen) end end end if(string.lower(text) == lowerText) then for c = 1, #wrongWords do if(string.find(noSpaceText, string.gsub(string.gsub(wrongWords[c], "%p", ""),"-", "")) ~= nil) then return "I want to post forbidden links.." end end end return text end local blocked_channels = {5,8,9} --Game-Chat, Real Chat, Help Channel local trade_channels = {6,7} --All trade channels <- These are also blocked local replace = "°" --Symbols which are shown instead of forbidden links -> ° local delay = {16246,5} -- {empty_storage, lenght of muted} function onSay(cid, words, param, channel) local fixedWords = getFixedText(cid, words, replace) if words ~= fixedWords and getPlayerAccess(cid) == 0 then if getPlayerStorageValue(cid,delay[1]) > os.time() then return doPlayerSendCancel(cid,"You are still muted for ".. getPlayerStorageValue(cid,delay[1])-os.time() .." seconds.") end setPlayerStorageValue(cid,delay[1],os.time()+delay[2]) if channel == CHANNEL_DEFAULT then doCreatureSay(cid, fixedWords, TALKTYPE_SAY) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Link: "..words.." is forbidden.") return true elseif isInArray(trade_channels, channel) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Link: "..words.." is forbidden on the trade channel.") return true elseif isInArray(blocked_channels, channel) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Link: "..words.." is forbidden.") doPlayerSendChannelMessage(cid, getCreatureName(cid), fixedWords, TALKTYPE_CHANNEL_Y, channel) return true end end return false end :b
- Guild war erro
-
Compilar Otserver Em Linux Desde O Inicio.
Erro: root@onservers-virtual-machine:/otserv/sources# ./autogen.sh autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force --warnings=none autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force --warnings=none autoreconf: running: /usr/bin/autoheader --force --warnings=none autoreconf: running: automake --add-missing --copy --force-missing --warnings=none configure.ac:3: installing `./install-sh' configure.ac:3: installing `./missing' Makefile.am: installing `./depcomp' autoreconf: Leaving directory `.' root@onservers-virtual-machine:/otserv/sources# ./configure --enable-mysql checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/timeb.h usability... yes checking sys/timeb.h presence... yes checking for sys/timeb.h... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... no checking for an ANSI C-conforming const... yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for ptrdiff_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for working memcmp... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for ceil... yes checking for floor... yes checking for ftime... yes checking for gethostbyname... yes checking for gethostname... yes checking for memset... yes checking for pow... yes checking for sqrt... yes checking for strcasecmp... yes checking for strncasecmp... yes checking for strstr... yes checking for strtol... yes checking for xml2-config... /usr/bin/xml2-config checking for libxml - version >= 2.6.5... yes (version 2.7.7) checking gmp.h usability... yes checking gmp.h presence... yes checking for gmp.h... yes checking for __gmpz_init2 in -lgmp... yes checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for main in -lz... yes checking for main in -lboost_thread-gcc-mt... no checking for main in -lboost_thread-mt... yes checking for main in -lboost_regex-gcc-mt... no checking for main in -lboost_regex-mt... yes checking for main in -lboost_system-gcc-mt... no checking for main in -lboost_system-mt... yes checking for main in -lpthread... yes checking for main in -lboost_date_time-gcc-mt... no checking for main in -lboost_date_time-mt... yes checking for main in -lboost_filesystem-gcc-mt... no checking for main in -lboost_filesystem-mt... yes checking openssl/rsa.h usability... yes checking openssl/rsa.h presence... yes checking for openssl/rsa.h... yes checking openssl/bn.h usability... yes checking openssl/bn.h presence... yes checking for openssl/bn.h... yes checking openssl/err.h usability... yes checking openssl/err.h presence... yes checking for openssl/err.h... yes checking openssl/sha.h usability... yes checking openssl/sha.h presence... yes checking for openssl/sha.h... yes checking openssl/md5.h usability... yes checking openssl/md5.h presence... yes checking for openssl/md5.h... yes checking for main in -lcrypto... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LUA... yes checking mysql/mysql.h usability... yes checking mysql/mysql.h presence... yes checking for mysql/mysql.h... yes checking for main in -lmysqlclient... yes configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands theforgottenserver 0.4.3777 Server diagnostics.......... : no Login server mode........... : no OTAdmin protocol............ : no Root run permission......... : no Login server mode........... : no Home-directory configuration : no OTServ custom allocator..... : no Debug build................. : no Using LuaJIT................ : no Build with MySQL............ : yes Build with SQLite........... : no Build with PostgreSQL....... : no Configure complete, now you may type './build.sh'. root@onservers-virtual-machine:/otserv/sources# ./build.sh TheForgottenServer build script - Using ccache CCache binaries located in /usr/lib/ccache Start building on 1 cores, using 2 processes make all-am make[1]: Entrando no diretório `/otserv/sources' CXX actions.o CXX allocator.o CXX baseevents.o CXX beds.o CXX chat.o CXX combat.o CXX condition.o CXX configmanager.o CXX connection.o CXX container.o CXX creature.o CXX creatureevent.o CXX cylinder.o CXX database.o CXX databasemanager.o CXX databasemysql.o CXX depot.o CXX dispatcher.o CXX exception.o CXX fileloader.o CXX game.o CXX globalevent.o CXX group.o CXX house.o CXX housetile.o CXX ioban.o CXX ioguild.o CXX iologindata.o CXX iomap.o CXX iomapserialize.o CXX item.o CXX itemattributes.o CXX items.o CXX luascript.o CXX mailbox.o CXX manager.o CXX map.o CXX monster.o CXX monsters.o CXX movement.o CXX networkmessage.o CXX npc.o CXX otserv.o CXX outfit.o CXX outputmessage.o CXX party.o CXX player.o CXX position.o CXX protocol.o CXX protocolgame.o CXX protocolhttp.o CXX protocollogin.o CXX protocolold.o CXX quests.o make[1]: *** Sem regra para processar o alvo `rsa.o', necessário por `theforgottenserver'. Pare. make[1]: ** Esperando que outros processos terminem. CXX raids.o make[1]: Saindo do diretório `/otserv/sources' make: ** [all] Erro 2 root@onservers-virtual-machine:/otserv/sources# ajuda ai :s