Ir para conteúdo

texzin

Membro
  • Registro em

  • Última visita

  1. ALGUÉM AJUDA CONCERTAR ? TFS 0.3.6 Versão 8.60 Adicione a "data/creaturescripts/antmagebomb.xml" function onLogin(cid, words, param, channel) local _ip = nil local p = 0 local list, ips = {}, {} local players = getPlayersOnline() local max = 3 -- Maximo de players no mesmo IP. for i, pid in ipairs(players) do local ip = getPlayerIp(pid) local tmp = table.find(ips, ip) if(tmp ~= nil and (not _ip or _ip == ip)) then if(table.countElements(list, ip) == 0) then list[players[tmp]] = ip end list[pid] = ip end table.insert(ips, ip) end if(table.maxn(list) > 0) then meip = getPlayerIp(cid) mename = getCreatureName(cid) for pid, ip in pairs(list) do local metmp = table.find(ips, meip) if (metmp ~= nil) then p = p + 1 end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem ".. p .." chars online!") if p > max then doRemoveCreature(cid, mename) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem ".. p+1 .." char online!") end return true end Em "data/creaturescripts/creaturescripts.xml" adicione essa linha: <event type="login" name="AntMageBomb" event="script" value="AntMageBomb.lua"/> ERRO : ele funciona melhor que todos os outros que eu testei ate hoje, porem... quando entro com varias accounts manager ao mesmo tempo ( magebomb ) da esse erro. e acaba dado CRASH.. ALGUÉM AJUDA CONCERTAR ?
  2. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    UPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP Por favor alguem me ajuda???
  3. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    up up up up up up ele funciona melhor que todos os outros que eu testei ate hoje, porem... quando entro com varias accounts manager ao mesmo tempo ( magebomb ) da esse erro. e acaba dado CRASH.. Obs:Meu distro/scripts não possui erros !! apenas depois que adicionei o script.
  4. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    Obrigado pelo Post, mais não deu certo. ele kica os player de forma até q mais rapida . mais nao enibi o acesso, até q ele kick os account ja lagou tudo
  5. bombaaaa ( up )
  6. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    Bom, boa noite, Estou a procura de algum Account manager que funcione de maneira mais eficaz. Antes de mais nada ( EU JA FIZ A PESQUISA DE SCRIPTS AQUI NO FORUM ) ja utilizei diversos scripts e sem muito resultado . Uso Windows, < INFELIZMENTE > e na versão 8.60 TFS 0.3.6 SE ALGUEM PUDER ME AJUDAR COM UM SCRIPT MAIS EFICAZ, ACHEI BEM INTERESANTE UM DO VODKART QUE BANI O IP DO CARA, mais ele costuma bugar meu distro quando algum FD# entra com mage bomb, e nao consigo ver qual o erro que aparece
  7. UPPPPPP !!!!!!!!!!!!
  8. Boa Noite, Gostaria de criar um site de divulgação de Open Server, Similar ao OTSERVLIST entre outros ai.
  9. Sei que pode ser considerado (FLOOD). Mais eu nao quero criar outro topico, e a pouco voltei a mexer com Otserv e ainda preciso do script. se alguem souber como fazer eu agradeço !
  10. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    REP+ Obrigado, faltou apenas aquela que combinamos por WHATS.
  11. texzin reagiu a uma resposta no tópico: Compilando TFS ( GUI )
  12. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    Conforme contato via whatsapp : http://www.speedyshare.com/yVFvZ/cryingdamson-0.3.6-8.60-V8.2-Source.rar
  13. http://www.tibiaking.com/forum/topic/52600-compilando-tfs-gui/
  14. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    Compilador: Default compiler Building Makefile: "C:\Users\Itamar\Desktop\Nova pasta\cryingdamson 0.3.6 (8.60) V8.2 Source\dev-cpp\Makefile.win" Executando make... make.exe -f "C:\Users\Itamar\Desktop\Nova pasta\cryingdamson 0.3.6 (8.60) V8.2 Source\dev-cpp\Makefile.win" all g++.exe -c ../databaseodbc.cpp -o obj/databaseodbc.o -I"C:/Users/Itamar/Desktop/Nova pasta/Stian's Repack Dev-Cpp/include" -D__ENABLE_SERVER_DIAGNOSTIC__ -D__ROOT_PERMISSION__ -D__GROUND_CACHE__ -D__USE_SQLITE__ -D__USE_MYSQL__ -fexpensive-optimizations -O1 ../databaseodbc.cpp: In constructor `ODBCResult::ODBCResult(void*)': ../databaseodbc.cpp:351: error: `res' was not declared in this scope make.exe: *** [obj/databaseodbc.o] Error 1 Execução terminada //////////////////////////////////////////////////////////////////////// // OpenTibia - an opensource roleplaying game //////////////////////////////////////////////////////////////////////// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////// // C++ Implementation: databaseodbc // Description: Frontend for ODBC connections // // Author: Bruno R Ferreira <[email protected]>, (C) 2007 //////////////////////////////////////////////////////////////////////// #include "otpch.h" #include <iostream> #include "database.h" #include "databaseodbc.h" #include "configmanager.h" extern ConfigManager g_config; #define RETURN_SUCCESS(ret) (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) DatabaseODBC::DatabaseODBC() { m_connected = false; char* dns = new char[SQL_MAX_DSN_LENGTH]; char* user = new char[32]; char* pass = new char[32]; strcpy((char*)dns, g_config.getString(ConfigManager::SQL_DB).c_str()); strcpy((char*)user, g_config.getString(ConfigManager::SQL_USER).c_str()); strcpy((char*)pass, g_config.getString(ConfigManager::SQL_PASS).c_str()); SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_env); if(!RETURN_SUCCESS(ret)) { std::cout << "Failed to allocate ODBC SQLHENV enviroment handle." << std::endl; m_env = NULL; return; } ret = SQLSetEnvAttr(m_env, SQL_ATTR_ODBC_VERSION, (SQLPOINTER*)SQL_OV_ODBC3, 0); if(!RETURN_SUCCESS(ret)) { std::cout << "SQLSetEnvAttr(SQL_ATTR_ODBC_VERSION): Failed to switch to ODBC 3 version." << std::endl; SQLFreeHandle(SQL_HANDLE_ENV, m_env); m_env = NULL; } if(m_env == NULL) { std::cout << "ODBC SQLHENV enviroment not initialized." << std::endl; return; } ret = SQLAllocHandle(SQL_HANDLE_DBC, m_env, &m_handle); if(!RETURN_SUCCESS(ret)) { std::cout << "Failed to allocate ODBC SQLHDBC connection handle." << std::endl; m_handle = NULL; return; } ret = SQLSetConnectAttr(m_handle, SQL_ATTR_CONNECTION_TIMEOUT, (SQLPOINTER*)5, 0); if(!RETURN_SUCCESS(ret)) { std::cout << "SQLSetConnectAttr(SQL_ATTR_CONNECTION_TIMEOUT): Failed to set connection timeout." << std::endl; SQLFreeHandle(SQL_HANDLE_DBC, m_handle); m_handle = NULL; return; } ret = SQLConnect(m_handle, (SQLCHAR*)dns, SQL_NTS, (SQLCHAR*)user, SQL_NTS, (SQLCHAR*)pass, SQL_NTS); if(!RETURN_SUCCESS(ret)) { std::cout << "Failed to connect to ODBC via DSN: " << dns << " (user " << user << ")" << std::endl; SQLFreeHandle(SQL_HANDLE_DBC, m_handle); m_handle = NULL; return; } m_connected = true; } DatabaseODBC::~DatabaseODBC() { if(m_connected) { SQLDisconnect(m_handle); SQLFreeHandle(SQL_HANDLE_DBC, m_handle); m_handle = NULL; m_connected = false; } SQLFreeHandle(SQL_HANDLE_ENV, m_env); } bool DatabaseODBC::getParam(DBParam_t param) { switch(param) { case DBPARAM_MULTIINSERT: default: break; } return false; } bool DatabaseODBC::beginTransaction() { return true; // return executeQuery("BEGIN"); } bool DatabaseODBC::rollback() { return true; // SQL_RETURN ret = SQLTransact(m_env, m_handle, SQL_ROLLBACK); // return RETURN_SUCCESS(ret); } bool DatabaseODBC::commit() { return true; // SQL_RETURN ret = SQLTransact(m_env, m_handle, SQL_COMMIT); // return RETURN_SUCCESS(ret); } bool DatabaseODBC::executeQuery(const std::string& query) { if(!m_connected) return false; #ifdef __SQL_QUERY_DEBUG__ std::cout << "ODBC QUERY: " << query << std::endl; #endif SQLHSTMT stmt; SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_STMT, m_handle, &stmt); if(!RETURN_SUCCESS(ret)) { std::cout << "Failed to allocate ODBC SQLHSTMT statement." << std::endl; return false; } std::string buf = _parse(query); ret = SQLExecDirect(stmt, (SQLCHAR*)buf.c_str(), buf.length()); if(!RETURN_SUCCESS(ret)) { std::cout << "SQLExecDirect(): " << query << ": ODBC ERROR." << std::endl; return false; } return true; } DBResult* DatabaseODBC::storeQuery(const std::string& query) { if(!m_connected) return NULL; #ifdef __SQL_QUERY_DEBUG__ std::cout << "ODBC QUERY: " << query << std::endl; #endif SQLHSTMT stmt; SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_STMT, m_handle, &stmt); if(!RETURN_SUCCESS(ret)) { std::cout << "Failed to allocate ODBC SQLHSTMT statement." << std::endl; return NULL; } std::string buf = _parse(query); ret = SQLExecDirect(stmt, (SQLCHAR*)buf.c_str(), buf.length() ); if(!RETURN_SUCCESS(ret)) { std::cout << "SQLExecDirect(): " << query << ": ODBC ERROR." << std::endl; return NULL; } DBResult* results = (DBResult*)new ODBCResult(stmt); return verifyResult(results); } std::string DatabaseODBC::escapeBlob(const char *s, uint32_t length) { std::string buf = "'"; for(uint32_t i = 0; i < length; i++) { switch(s[i]) { case '\'': buf += "\'\'"; break; case '\0': buf += "\\0"; break; case '\\': buf += "\\\\"; break; case '\r': buf += "\\r"; break; case '\n': buf += "\\n"; break; default: buf += s[i]; } } buf += "'"; return buf; } std::string DatabaseODBC::_parse(const std::string& s) { std::string query = ""; query.reserve(s.size()); bool inString = false; for(uint32_t a = 0; a < s.length(); a++) { uint8_t ch = s[a]; if(ch == '\'') { if(inString && s[a + 1] != '\'') inString = false; else inString = true; } if(ch == '`' && !inString) ch = '"'; query += ch; } return query; } int32_t ODBCResult::getDataInt(const std::string& s) { listNames_t::iterator it = m_listNames.find(s); if(it != m_listNames.end()) { int32_t value; SQLRETURN ret = SQLGetData(m_handle, it->second, SQL_C_SLONG, &value, 0, NULL); if(RETURN_SUCCESS(ret)) return value; else std::cout << "Error during getDataInt(" << s << ")." << std::endl; } std::cout << "Error during getDataInt(" << s << ")." << std::endl; return 0; // Failed } int64_t ODBCResult::getDataLong(const std::string& s) { listNames_t::iterator it = m_listNames.find(s); if(it != m_listNames.end()) { int64_t value; SQLRETURN ret = SQLGetData(m_handle, it->second, SQL_C_SBIGINT, &value, 0, NULL); if(RETURN_SUCCESS(ret)) return value; else std::cout << "Error during getDataLong(" << s << ")." << std::endl; } std::cout << "Error during getDataLong(" << s << ")." << std::endl; return 0; // Failed } std::string ODBCResult::getDataString(const std::string& s) { listNames_t::iterator it = m_listNames.find(s); if(it != m_listNames.end()) { char* value = new char[1024]; SQLRETURN ret = SQLGetData(m_handle, it->second, SQL_C_CHAR, value, 1024, NULL); if(RETURN_SUCCESS(ret)) { std::string buff = std::string(value); return buff; } else std::cout << "Error during getDataString(" << s << ")." << std::endl; } std::cout << "Error during getDataString(" << s << ")." << std::endl; return std::string(""); // Failed } const char* ODBCResult::getDataStream(const std::string& s, uint64_t& size) { listNames_t::iterator it = m_listNames.find(s); if(it != m_listNames.end()) { char* value = new char[1024]; if(RETURN_SUCCESS(SQLGetData(m_handle, it->second, SQL_C_BINARY, value, 1024, (SQLLEN*)&size))) return value; } std::cout << "Error during getDataStream(" << s << ")." << std::endl; size = 0; return 0; // Failed } void ODBCResult::free() { if(m_handle) { SQLFreeHandle(SQL_HANDLE_STMT, m_handle); delete this; } else std::cout << "[Warning - ODBCResult::free] Trying to free already freed result." << std::endl; } bool ODBCResult::next() { SQLRETURN ret = SQLFetch(m_handle); return RETURN_SUCCESS(ret); } ODBCResult::ODBCResult(SQLHSTMT stmt) { if(!res) { delete this; return; } m_handle = stmt; int16_t numCols = 0; SQLNumResultCols(m_handle, &numCols); for(int32_t i = 1; i <= numCols; i++) { char* name = new char[129]; SQLDescribeCol(m_handle, i, (SQLCHAR*)name, 129, NULL, NULL, NULL, NULL, NULL); m_listNames[name] = i; } }
  15. texzin postou uma resposta no tópico em Suporte Tibia OTServer
    Boa Noite, vou ser pratico e obejetivo... preciso compilar uma Source aqui 0,3,6 TFS, mais eu preciso fazer em GUI e nao CONSOLE. Como fazer isso ?
  16. texzin reagiu a uma resposta no tópico: Como resolver este erro no distro?
  17. Desculpe ,Sei que suas respostas são visando ajudar . Porém vce so está fazendo comentarios desnecessarios, Pois este script está perfeito e foi criado por um dos cara mais top que eu ja vi.. VODKART.

Informação Importante

Confirmação de Termo