Postado Abril 22, 2014 11 anos Autor Boa tarde Meganick, Meu servidor é um Debian, esta m Linux, poderia dar uma olhada nos arquivos do server, eu postei o link dele no primeiro comentário, já configurei o config.lua com os dados do servidor, porém não sei como rodar, pois esta é a base pura do tibia onde eu terei que editar tudo. Notei que tem uns arquivo que são da extenção do make, porém não sei como devo rodar eles e configurar o server para que ele rode dentro do server Linux. PS. Meu servidor Linux é um cloud. Segue configuração do config.lua para conexão. 281 -- Database configuration 282 -- options: mysql, sqlite, odbc or pgsql 283 database_type = "mysql" 284 285 -- SQL connection part 286 database_schema = "db.s3db" 287 -- database_schema = "otserv" -- use this for MySQL/PgSQL 288 -- database_schema = "Your Source" -- ODBC 289 290 -- there settings are not used by SQLite 291 database_host = "localhost" 292 database_port = 3306 293 -- database_port = 5432 -- use this for PgSQL 294 database_username = "root" 295 database_password = "**********" Notei que não tem a linha que devemos informar o nome da base de dados, por acaso seria a linha: 286 database_schema = "db.s3db" Editado Abril 23, 2014 11 anos por Caranthir (veja o histórico de edições)
Postado Abril 24, 2014 11 anos Autor Bom dia, Efetuei a configuração de conexão com o banco de dados da seguinte forma: 281 -- Database configuration 282 -- options: mysql, sqlite, odbc or pgsql 283 database_type = "mysql" 284 285 -- SQL connection part 286 --database_schema = "db.s3db" >> Comentei 287 database_schema = "nome_da_base" --"otserv" -- use this for MySQL/PgSQL 288 -- database_schema = "Your Source" -- ODBC 289 290 -- there settings are not used by SQLite 291 database_host = "localhost" 292 database_port = 3306 293 -- database_port = 5432 -- use this for PgSQL 294 database_username = "root" 295 database_password = "**********" Localizei vários arquivos em c++, assim efetuei uma verificação e tentei rodar o servidor, mas ele gera erro referente a localização de alguns arquivos, segue: root@linux-debian-6-64b-base-sx:/home/caranthir/pokemon/src# g++ -c server.cpp In file included from server.cpp:20: otpch.h:19:30: error: libxml/xmlmemory.h: No such file or directory otpch.h:20:27: error: libxml/parser.h: No such file or directory otpch.h:21:28: error: libxml/threads.h: No such file or directory otpch.h:22:31: error: libxml/xmlschemas.h: No such file or directory In file included from otpch.h:47, from server.cpp:20: lua.hpp:26:25: error: lua.h: No such file or directory lua.hpp:27:29: error: lauxlib.h: No such file or directory lua.hpp:28:28: error: lualib.h: No such file or directory root@linux-debian-6-64b-base-sx:/home/caranthir/pokemon/src# Por favor me informem se preciso instalar alguma biblioteca no servidor ou alterar alguma configuração.
Postado Maio 15, 2014 11 anos Solução Boa tarde, Meganick Eu configurei o Mysql e criei o gamemaster. Incluí os dados do banco no arquivo config.lua mas não seu como fazer meu server rodar e conectar com o client para ver se esta funcionando, gostaria de fazer isso primeiro antes de começar a editá-lo. xeonotech Eu percebi que o arquivo namer.xml puxa um script "nick.lua" nos arquivos do server que estou usando não tem este script, isso não irá gerar um erro? Agradeço a colaboração de todos. Depois Vai em npc/scripts e crie um nick.lua e dentro dele coloque isso local focus = 0 local talk_start = 0 local conv = 0 local target = 0 local following = false local attacking = false local talkState = {} local finalname = "" function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye sir!') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msge) local msg = string.lower(msge) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if focus == cid then talk_start = os.clock() end if (msgcontains(msg, 'hi') and (focus == 0) and (getDistanceToCreature(cid) <= 4)) then --if not isPremium(cid) then --selfSay("Hello, "..getCreatureName(cid).."! I'm sorry, but I can only give nicknames to pokemons for premium members!") --return true --end focus = cid conv = 1 talk_start = os.clock() selfSay("Hello, "..getCreatureName(cid).."! I can give your pokemon a nickname, would you like it?") elseif (msgcontains(msg, "no") or msgcontains(msg, "bye")) and focus == cid and conv ~= 3 then selfSay("No problem then, sir. Come back when you feel like it!") focus = 0 elseif msgcontains(msg, "yes") and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end selfSay("Put your pokemon at the main slot and tell me, what nickname would you like me to give to your pokemon?") conv = 3 elseif conv == 3 and focus == cid then local tablee = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "w", "y", "z", ".", ":", "'", '"', "~", "^", "@", "#", "$", "%", "&", "*", "(", ")", "-", "+", "_", "?", ">", "<", "•", ";", "°", "¹", "²", "³", "£", "¢", "¬", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} local table = {"'", '"', "!", "ã", "õ", "ç", "´", "`", "á", "à", "ó", "ò", "é", "è", "í", "ì", "ú", "ù", "¹", "²", "³", "£", "¢", "¬", "§", "°", "º", "ª", "•", "|"} for a = 1, #table do if string.find(msg, table[a]) then selfSay("Sorry, the nick has invalid symbols.") return true end end if string.len(msg) <= 1 or string.len(msg) >= 19 then selfSay("Sorry, that nick is too long or too short!") return true end local pokename = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") selfSay("Are you sure that you want to change your's "..pokename.." name to \""..msge.."\"? This is going to cost you 10 hundred dollars.") conv = 5 finalname = msge elseif msgcontains(msg, "yes") and focus == cid and conv == 5 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Where is your pokemon?! You have to keep it at the main slot!") focus = 0 return true end if doPlayerRemoveMoney(cid, 100000) == false then selfSay("You don't have enough money to afford this service, come back later.") focus = 0 conv = 0 return true end local nick = ""..finalname.."" local description = "Contains a "..getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke").."." selfSay("Done! Your pokemon now has a new name, enjoy it!") doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "nick", nick) local newdes = description.."\nIt's nickname is: "..finalname.."." doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "description", newdes) local hp = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "happy") doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "happy", hp + 25) if #getCreatureSummons(cid) >= 1 then adjustStatus(getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8).uid) end focus = 0 conv = 0 end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Want to give some nicknames to your pokemon? Talk to me!", "Did you know your pokemon gets a little happier when you give him a nickname?", "Every pokemon wants to have a nickname! Come talk to me!", "Pokemons love nicknames, you should give yours one.", } function onThink() if focus == 0 then selfTurn(1) delay = delay - 0.5 if delay <= 0 then selfSay(messages[number]) number = number + 1 if number > #messages then number = 1 end delay = math.random(intervalmin, intervalmax) end return true else if not isCreature(focus) then focus = 0 return true end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then focus = 0 return true end if (os.clock() - talk_start) > 45 then focus = 0 selfSay("Come back some other time!") end if getDistanceToCreature(focus) > 3 then selfSay("Enjoy!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end Scripter 51% [Aprendendo] Mapping 100% [Excelente] Website 93% [Encerrando] Client 26% [Aprendendo] Programmer 76% [Aprendendo] Gostou ? Rep+
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.