Postado Abril 10, 2016 9 anos Eu estou tentando colocar em meu sevidor, e da erro no aquivo.php poderia me ajudar Spoiler Editado Abril 10, 2016 9 anos por xande00 (veja o histórico de edições)
Postado Julho 9, 2016 8 anos Desculpe reviver o tópico mas tive um probleminha... Ele não muda.. Só fica desse jeito: Apresentou erro na Distro: Editado Julho 9, 2016 8 anos por moviebr (veja o histórico de edições)
Postado Fevereiro 20, 2017 8 anos Em 07/08/2015 ás 17:22, Natanael Beckman disse: Opa galera eu mais uma vez postando mais uma novidade na área de OTServer! StreamTemple é um sistema que proporciona uma visualização em tempo real da movimentação de characters em um determinado local do server, isso vai depender das suas configurações... Esse sistema foi criado por Gesior.pl para versão TFS 1.0 e migrado para a versão TFS 0.4 por Killua(90%) e Eu(Fix bug player move) Vamos la galera, em data/globalevents/scripts crie um arquivo .lua e nomeie para stream_temple.lua adicione dentro do mesmo este code: -- for linux default: '/var/www/streamtemple/stream.json' -- create folder 'streamtemple' in main folder of acc. maker! -- [LINUX] check that folder 'streamtemple' has rights to create new file by anyone local playerJsonInfoPath = '/var/www/streamtemple/stream.json' -- center position of your 'stream' - make sure you set valid left/top corner of image in PHP! -- stream show only players on same 'floor'/'level' local centerPosition = {x = 32349, y = 32222, z = 7} --[[ I RECOMMEND TO NOT SET WIDTH HIGHER THEN 20, BECAUSE IT MAY CAUSE LITTLE LAG ON SERVERS WITH 300-400 ONLINE! ]]-- -- viewWidth is not really width of stream, if viewWidth is '11': -- then stream shows players 11 tiles to the left and 11 tiles to the right from center positon, so real width is 23 tiles! local viewWidth = 11 -- viewHeight is not really height of stream, if viewHeight is '6': -- then stream shows players 6 tiles to the top and 6 tiles to the bottom from center positon, so real height is 13 tiles! local viewHeight = 6 function onThink() -- get players/monsters/npcs in area list local spectators = getSpectators(centerPosition, viewWidth, viewHeight, false) -- generate information local stream = "{" if(spectators) then for _, spectator in pairs(spectators) do local player = spectator if(player) then local playerPosition = getCreaturePosition(player) local playerOutfit = getCreatureOutfit(player) if(centerPosition.z == playerPosition.z) then stream = stream .. '"'..getCreatureName(player)..'":['.. playerPosition.x ..','.. playerPosition.y ..','.. playerPosition.z ..','.. playerOutfit.lookType ..','.. playerOutfit.lookAddons ..','.. playerOutfit.lookHead ..','.. playerOutfit.lookBody ..','.. playerOutfit.lookLegs ..','.. playerOutfit.lookFeet ..','.. getPositionByDirection(player) ..','.. getCreatureLookDirection(player) ..',' .. playerOutfit.lookTypeEx .. ','.. getCreatureSkullType(player) ..'],' end end end end stream = stream .. '}' -- save to file local streampath = io.open(playerJsonInfoPath, "w") streampath:write(stream) streampath:close() return true end No arquivo acima faça as seguintes alterações: Aqui altere pro local correto onde ficara localizada a pasta streamtemple na pasta do site. local playerJsonInfoPath = '/var/www/streamtemple/stream.json' Aqui você vai botar as coordenada central de acordo com a imagem que vai utilizar. local centerPosition = {x = 32349, y = 32222, z = 7} Em globalevents.xml registre esse code: <!-- Stream Temple --> <globalevent name="stream" interval="700" script="stream_temple.lua"/> No site você vai adicionar o arquivo .php chamado de streamtemple.php com esse code: <style type="text/css"> .alpha_wrapper { padding-top: 8px; float: left; position: relative; color: #fff; width: 96px; text-align: center; } .name { white-space: nowrap; color: rgb(0, 255, 0); font-size:10px; width: 50%; margin: 0px auto; padding-bottom: 2px; font-family: Verdana; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; } .skull { background: transparent url(images/skulls/redskull.gif) no-repeat; position: absolute; top: 31px; left: 57px; width: 11px; height: 11px; width: 50%; margin: 0px auto; } </style> <div style="float:center;text-align:center;margin: 0 auto;text-shadow:0 0 5px #fff;font-family:Georgia,serif;font-weight:strong;font-size:35px;"><img src=megastr.png></div> <!-- Your temple image must have tiles width/height 32px! --> <!-- There is 'streamtemple/temple.png', if you keep your temple image in other format or on other host, edit this. DO NOT FORGET TO EDIT THIS PART OF LINE BELOW: 'width:600px;height:380px', there must be width and height of your temple image! --> <div style="background-image:url('streamtemple/temple.png');width:600px;height:380px;box-shadow:0 0 20px #000;font-family:Arial, sans-serif;border:2px solid black;margin:5px auto;text-align:center;overflow:hidden;position:relative;" id="templeAnimationWindow"></div> <script type="text/javascript"> // -- CONFIG -- // url to stream file - it's NOT full path to that file like 'c:\xampp\...' var playerJsonInfoURL = 'streamtemple/stream.json'; // BEST VALUE IS SAME AS INTERVAL IN GLOBALEVENTS.XML var updateIntervalInSeconds = 1; // It's NOT same position as center of stream in LUA, this position depends on your temple image on www! // set it to position that is in game when you look at top-left corner of your temple image (+/- 1 after tests on www) // -- example: // HARD PART: If your image on www shows 16x8 tiles of 'game screen' and left-top corner positon is '1000,1000' then.. // What is center-position and width/height for LUA script config? [if it's on floor 7..] // YES! It's: Position(1008, 1004, 7), width: 8 (8*2+1 = 17, more then your image!), height: 4 (4*2+1 = 9, more ..!) // --- // but don't worry, if you set it to (32337,32220,7) and set width 15 and height 15 it will work too! (just use more CPU then it should) var leftTopCornetX = 32339; var leftTopCornetY = 32216; // adjust these values (from -32 to 32, it's value in pixels) to make your character stand at same position as in game // you must compare image on www and in game by yourself var imageCorrectionX = 2; var imageCorrectionY = 4; // images URL var itemImagesURL = 'http://item-images.ots.me/1030/'; // outfit generation script URL, you need your own outfit images host, how to create: // http://otland.net/threads/gesior2012-make-your-own-outfits-items-country-flags-hosting-recommended.210844/ var outfitImagesURL = 'outfit.php'; // -- END OF CONFIG -- function disableSelection(target) { if (typeof target.onselectstart!="undefined") { target.onselectstart=function(){return false} } else if (typeof target.style.MozUserSelect!="undefined") { target.style.MozUserSelect="none"; } else { target.onmousedown=function(){return false} } target.style.cursor = "default"; } disableSelection(document.body); var uid = Math.floor(Math.random()*(10000000-1))+10000000; function handler(data) { setTimeout(update, updateIntervalInSeconds * 1000); try { var obj = eval("(" + data + ")"); } catch(err) {} var s = ''; for (x in obj) { var k = obj[x]; s += '<div style="z-index:'+(k[1]-20)+';position:absolute;top:'+(((k[1]-leftTopCornetY)*32)+imageCorrectionY)+'px;left:'+(((k[0]-leftTopCornetX)*32)+imageCorrectionX)+'px;width:64px;height:64px;background:transparent url('; if(k[3] == 0) { s += itemImagesURL + k[11]+'.gif'; } else { var mountID = parseInt(k[9]); if(mountID > 0) { mountID += 65536; } s += outfitImagesURL + '?id='+k[3]+'&addons='+k[4]+'&head='+k[5]+'&body='+k[6]+'&legs='+k[7]+'&feet='+k[8]+'&direction='+(parseInt(k[10])+1); } s += ') no-repeat right bottom;">' + '<div class="alpha_wrapper">' + '<div class="name" style="margin: 5px 19px">'+x.replace(/( )/g,' ')+'</div>' + '<div style="margin-left: 34px; margin-top: -7px; width: 25px; height: 2px; background-color: rgb(0, 191, 0); border: 1px solid black;"></div>'; if(k[12] >= 3) { // known problem: there is no white skull image in Gesior2012, if you got it, you can put it in your /images/skulls/ s += '<div class="skull" style="background-image:url(images/skulls/'+(k[12] == 3 ? 'white' : (k[12] == 4 ? 'red' : 'black')) + 'skull.gif);"> </div>'; } s += '</div></div>'; } document.getElementById('templeAnimationWindow').innerHTML = s; } function update() { var xhr; try { xhr=new XMLHttpRequest(); } catch (e) { try { xhr=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xhr=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xhr.open("GET", playerJsonInfoURL + "?"+Math.random(), true); xhr.onreadystatechange=function() { // status 4 = query realized without problems if(xhr.readyState==4) { // if query failed for some reason, it will stop animation handler(xhr.responseText); } } xhr.send(null); } update(); </script> E o outfit.php. Certo aqui você baixe a pasta abaixo que já com o arquivo stream.json e uma imagem que utilizo no meu servidor. streamtemple E baixe essa pasta de outfits pro sistema funcionar perfeitamente: outfits Veja um exemplo do sistema: ______________________ todo mundo esta com o mesmo erro, sera que tem como você nos ajudar?
Postado Março 3, 2017 8 anos @Natanael Beckman estou com problema tbm na parte php, no Script globalevents não deu erro na distro, mais não estou sabendo colocar a parte PHP alguem saberia explicar melhor como fazer a parte PHP ? coloquei a parte PHP e o site ficou igual a imagem abaixo : o problema que coloquei a imagem em PNG do meu templo e não mudou no site fica a imagem do templo de Thais ainda segue a imagem : 1- é o jeito que ficou no site 2- é a imagem do meu templo, (estou tentando colocar mais não muda no site) Editado Março 3, 2017 8 anos por Micheel15 (veja o histórico de edições)
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.