Ir para conteúdo

Featured Replies

Postado

Muchas gracias amigo por responder, ahora adjuntaré aquí mi archivo "init.lua", "advanced_updater", y una captura de pantalla para que puedas ver la carpeta api

 

 

"init.lua"

 

             

-- If you don't use updater or other service, set it to updater = ""
Services = {
  website = "http://www.vagosclub.cl/", -- currently not used
  updater = "http://www.vagosclub.cl/api/updater_advanced.php",
  stats = "",
  crash = "",
  feedback = "",
  status = ""
}

-- Servers accept http login url, websocket login url or ip:port:version
Servers = {
  VagosClub = "www.vagosclub.cl:7171:860"
}

--USE_NEW_ENERGAME = true -- uses entergamev2 based on websockets instead of entergame
ALLOW_CUSTOM_SERVERS = false -- if true it shows option ANOTHER on server list

g_app.setName("VagosClub V.1.0.0")
-- CONFIG END

-- print first terminal message

if not g_resources.directoryExists("/data") then
  g_logger.fatal("Data dir doesn't exist.")
end

if not g_resources.directoryExists("/modules") then
  g_logger.fatal("Modules dir doesn't exist.")
end

-- settings
g_configs.loadSettings("/config.otml")

-- set layout
local settings = g_configs.getSettings()
local layout = DEFAULT_LAYOUT
if g_app.isMobile() then
  layout = "mobile"
elseif settings:exists('layout') then
  layout = settings:getValue('layout')
end
g_resources.setLayout(layout)

-- load mods
g_modules.discoverModules()
g_modules.ensureModuleLoaded("corelib")
  
local function loadModules()
  -- libraries modules 0-99
  g_modules.autoLoadModules(99)
  g_modules.ensureModuleLoaded("gamelib")

  -- client modules 100-499
  g_modules.autoLoadModules(499)
  g_modules.ensureModuleLoaded("client")

  -- game modules 500-999
  g_modules.autoLoadModules(999)
  g_modules.ensureModuleLoaded("game_interface")

  -- mods 1000-9999
  g_modules.autoLoadModules(9999)
end

-- report crash
if type(Services.crash) == 'string' and Services.crash:len() > 4 and g_modules.getModule("crash_reporter") then
  g_modules.ensureModuleLoaded("crash_reporter")
end

-- run updater, must use data.zip
if type(Services.updater) == 'string' and Services.updater:len() > 4 
  and g_resources.isLoadedFromArchive() and g_modules.getModule("updater") then
  g_modules.ensureModuleLoaded("updater")
  return Updater.init(loadModules)
end

loadModules()

 

UPDATER_ADVANCED

 

<?php
// CONFIG
$files_dir = "/var/htdocs/api/files";
$files_url = "http://www.vagosclub.cl/api/files";
$files_and_dirs = array("init.lua", "data", "modules", "layouts");
$checksum_file = "checksums.txt";
$checksum_update_interval = 60; // seconds
$binaries = array(
    "WIN32-WGL" => "otclient_gl.exe",
    "WIN32-EGL" => "otclient_dx.exe",
    "WIN32-WGL-GCC" => "otclient_gcc_gl.exe",
    "WIN32-EGL-GCC" => "otclient_gcc_dx.exe",
    "X11-GLX" => "otclient_linux",
    "X11-EGL" => "otclient_linux",
    "ANDROID-EGL" => "", // we can't update android binary
    "ANDROID64-EGL" => "" // we can't update android binary
);
// CONFIG END

function sendError($error) {
    echo(json_encode(array("error" => $error)));
    die();    
}

$data = json_decode(file_get_contents("php://input"));
//if(!$data) {
//    sendError("Invalid input data");
//}

$version = $data->version ?: 0; // APP_VERSION from init.lua
$build = $data->build ?: ""; // 2.4, 2.4.1, 2.5, etc
$os = $data->os ?: "unknown"; // android, windows, mac, linux, unknown
$platform = $data->platform ?: ""; // WIN32-WGL, X11-GLX, ANDROID-EGL, etc
$args = $data->args; // custom args when calling Updater.check()
$binary = $binaries[$platform] ?: "";

$forVersion = "";
if($args && $args->version) {
    $forVersion = strval($args->version);
}

$cache = null;
$cache_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $checksum_file;
if (file_exists($cache_file) && (filemtime($cache_file) + $checksum_update_interval > time())) {
    $cache = json_decode(file_get_contents($cache_file), true);
}
if(!$cache) { // update cache
    $dir = realpath($files_dir);
    $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS));
    $cache = array(); 
    foreach ($rii as $file) {
        if (!$file->isFile())
            continue;
        $path = str_replace($dir, '', $file->getPathname());
        $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
        $cache[$path] = hash_file("crc32b", $file->getPathname()); 
    }
    file_put_contents($cache_file . ".tmp", json_encode($cache));
    rename($cache_file . ".tmp", $cache_file);
}
$ret = array("url" => $files_url, "files" => array(), "keepFiles" => empty($forVersion) ? false : true);
foreach($cache as $file => $checksum) {
    $base = trim(explode("/", ltrim($file, "/"))[0]); 
    if(strpos($file, "data/things") !== false && (empty($forVersion) || strpos($file, $forVersion) === false)) {
        continue;
    }
    if(in_array($base, $files_and_dirs)) {
        $ret["files"][$file] = $checksum;
    }
    if($base == $binary && !empty($binary)) {
        $ret["binary"] = array("file" => $file, "checksum" => $checksum);
    }
}

echo(json_encode($ret, JSON_PRETTY_PRINT));

?>

 

FILES

 

 

Sin título.png

muito obrigado antecipadamente amigo @marcoshps11

 

Editado por vagosclub2 (veja o histórico de edições)

  • Respostas 96
  • Visualizações 39.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Excelente tutorial, obrigado pelo conteúdo! OBS: Escutem o áudio do inicio da postagem, é importante.

  • fiquei esperando surgir uma voz bonita mas nem audio tem, decepcionado.. Obrigado pelo guia @marcoshps11, otcv8 é muito bacana, eu sempre uso quando precisa logar em algum Ot. Com certeza va

  • Esse é o preço que pagamos por fazer tutorial enquanto está no escritório /trabalhando/  Por isso já deixei o áudio de saudações.. ai pode imaginar o tutorial sendo descrito com aquela voz *miste

Posted Images

Postado
  • Autor
3 horas atrás, XGaduX disse:

@marcoshps11 como que criptografa a versão mobile?

 

Faça o mesmo processo, a diferença é que você vai substituir os arquivos que estão no data do mobile pelo o que você criptografou no pc

22 minutos atrás, vagosclub2 disse:

Muchas gracias amigo por responder, ahora adjuntaré aquí mi archivo "init.lua", "advanced_updater", y una captura de pantalla para que puedas ver la carpeta api

 

 

"init.lua"

 


             

-- If you don't use updater or other service, set it to updater = ""
Services = {
  website = "http://www.vagosclub.cl/", -- currently not used
  updater = "http://www.vagosclub.cl/api/updater_advanced.php",
  stats = "",
  crash = "",
  feedback = "",
  status = ""
}

-- Servers accept http login url, websocket login url or ip:port:version
Servers = {
  VagosClub = "www.vagosclub.cl:7171:860"
}

--USE_NEW_ENERGAME = true -- uses entergamev2 based on websockets instead of entergame
ALLOW_CUSTOM_SERVERS = false -- if true it shows option ANOTHER on server list

g_app.setName("VagosClub V.1.0.0")
-- CONFIG END

-- print first terminal message

if not g_resources.directoryExists("/data") then
  g_logger.fatal("Data dir doesn't exist.")
end

if not g_resources.directoryExists("/modules") then
  g_logger.fatal("Modules dir doesn't exist.")
end

-- settings
g_configs.loadSettings("/config.otml")

-- set layout
local settings = g_configs.getSettings()
local layout = DEFAULT_LAYOUT
if g_app.isMobile() then
  layout = "mobile"
elseif settings:exists('layout') then
  layout = settings:getValue('layout')
end
g_resources.setLayout(layout)

-- load mods
g_modules.discoverModules()
g_modules.ensureModuleLoaded("corelib")
  
local function loadModules()
  -- libraries modules 0-99
  g_modules.autoLoadModules(99)
  g_modules.ensureModuleLoaded("gamelib")

  -- client modules 100-499
  g_modules.autoLoadModules(499)
  g_modules.ensureModuleLoaded("client")

  -- game modules 500-999
  g_modules.autoLoadModules(999)
  g_modules.ensureModuleLoaded("game_interface")

  -- mods 1000-9999
  g_modules.autoLoadModules(9999)
end

-- report crash
if type(Services.crash) == 'string' and Services.crash:len() > 4 and g_modules.getModule("crash_reporter") then
  g_modules.ensureModuleLoaded("crash_reporter")
end

-- run updater, must use data.zip
if type(Services.updater) == 'string' and Services.updater:len() > 4 
  and g_resources.isLoadedFromArchive() and g_modules.getModule("updater") then
  g_modules.ensureModuleLoaded("updater")
  return Updater.init(loadModules)
end

loadModules()

 

UPDATER_ADVANCED

 


<?php
// CONFIG
$files_dir = "/var/htdocs/api/files";
$files_url = "http://www.vagosclub.cl/api/files";
$files_and_dirs = array("init.lua", "data", "modules", "layouts");
$checksum_file = "checksums.txt";
$checksum_update_interval = 60; // seconds
$binaries = array(
    "WIN32-WGL" => "otclient_gl.exe",
    "WIN32-EGL" => "otclient_dx.exe",
    "WIN32-WGL-GCC" => "otclient_gcc_gl.exe",
    "WIN32-EGL-GCC" => "otclient_gcc_dx.exe",
    "X11-GLX" => "otclient_linux",
    "X11-EGL" => "otclient_linux",
    "ANDROID-EGL" => "", // we can't update android binary
    "ANDROID64-EGL" => "" // we can't update android binary
);
// CONFIG END

function sendError($error) {
    echo(json_encode(array("error" => $error)));
    die();    
}

$data = json_decode(file_get_contents("php://input"));
//if(!$data) {
//    sendError("Invalid input data");
//}

$version = $data->version ?: 0; // APP_VERSION from init.lua
$build = $data->build ?: ""; // 2.4, 2.4.1, 2.5, etc
$os = $data->os ?: "unknown"; // android, windows, mac, linux, unknown
$platform = $data->platform ?: ""; // WIN32-WGL, X11-GLX, ANDROID-EGL, etc
$args = $data->args; // custom args when calling Updater.check()
$binary = $binaries[$platform] ?: "";

$forVersion = "";
if($args && $args->version) {
    $forVersion = strval($args->version);
}

$cache = null;
$cache_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $checksum_file;
if (file_exists($cache_file) && (filemtime($cache_file) + $checksum_update_interval > time())) {
    $cache = json_decode(file_get_contents($cache_file), true);
}
if(!$cache) { // update cache
    $dir = realpath($files_dir);
    $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS));
    $cache = array(); 
    foreach ($rii as $file) {
        if (!$file->isFile())
            continue;
        $path = str_replace($dir, '', $file->getPathname());
        $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
        $cache[$path] = hash_file("crc32b", $file->getPathname()); 
    }
    file_put_contents($cache_file . ".tmp", json_encode($cache));
    rename($cache_file . ".tmp", $cache_file);
}
$ret = array("url" => $files_url, "files" => array(), "keepFiles" => empty($forVersion) ? false : true);
foreach($cache as $file => $checksum) {
    $base = trim(explode("/", ltrim($file, "/"))[0]); 
    if(strpos($file, "data/things") !== false && (empty($forVersion) || strpos($file, $forVersion) === false)) {
        continue;
    }
    if(in_array($base, $files_and_dirs)) {
        $ret["files"][$file] = $checksum;
    }
    if($base == $binary && !empty($binary)) {
        $ret["binary"] = array("file" => $file, "checksum" => $checksum);
    }
}

echo(json_encode($ret, JSON_PRETTY_PRINT));

?>

 

FILES

 

 

Sin título.png


Aparentemente é um problema ou com a versão do xampp ou versão do PHP, você pode acessar o link do updater pelo navegar e verificar os erros

Postado
29 minutos atrás, marcoshps11 disse:

 

Haz el mismo proceso, la diferencia es que reemplazarás los archivos que están en los datos del móvil por el que encriptaste en la pc


Aparentemente é um problema ou com a versão do xampp ou versão do PHP, você pode acessar o link do updater pelo navegar e verificar os erros

 

Obrigado por responder amigo, acredite, estou tentando ver esse tópico há 2 dias, mas gostaria de saber de que tipo de xampp vou precisar? , Estou usando o ZNOTE ACC. Isso influencia alguma coisa?

Estou usando a versão XAMPP:

xampp-windows-x64-7.3.27-0-VC15-installer

Espero que você possa me ajudar. Muito obrigado antecipadamente @marcoshps11

Postado
  • Autor
52 minutos atrás, vagosclub2 disse:

 

Obrigado por responder amigo, acredite, estou tentando ver esse tópico há 2 dias, mas gostaria de saber de que tipo de xampp vou precisar? , Estou usando o ZNOTE ACC. Isso influencia alguma coisa?

Estou usando a versão XAMPP:

xampp-windows-x64-7.3.27-0-VC15-installer

Espero que você possa me ajudar. Muito obrigado antecipadamente @marcoshps11

 

isso foge do meu conhecimento, é uma questão web, fica aberto caso alguém da área posso ajuda-lo 

@Endless talvez saiba

Editado por marcoshps11 (veja o histórico de edições)

Postado
49 minutos atrás, marcoshps11 disse:

 

isso foge do meu conhecimento, é uma questão web, fica aberto caso alguém da área posso ajuda-lo 

@Endless talvez saiba

oh amigo, pensei que você ainda soubesse como publicou isso ... mas quais programas você recomenda usar para fazer como está? @marcoshps11

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo