SMF - Just Installed!
#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.
// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
// Construtor vazio. Caso necessite, adicione inicializações aqui.
}
CLayout gLayout;
void CLayout::UpdateLayoutPanelWindow()
{
// Variável estática para controlar o estado da tecla F4
static bool isF4Pressed = false;
bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;
if (currentF4State && !isF4Pressed)
{
// Alterna a flag de exibição do painel
gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;
isF4Pressed = true;
}
else if (!currentF4State)
{
isF4Pressed = false;
}
}
int CLayout::DrawToolTip(int X, int Y, LPCSTR Text, ...)
{
char Buff[2048];
int BuffLen = sizeof(Buff);
ZeroMemory(Buff, BuffLen);
va_list args;
va_start(args, Text);
int Len = vsprintf_s(Buff, BuffLen, Text, args);
va_end(args);
return pDrawToolTip(X, Y, Buff);
}
// Variáveis globais para controle do drag e da posição do painel
bool m_isDragging = false;
POINT m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;
void CLayout::DrawLayoutPanelWindow()
{
// Se o painel não estiver para ser exibido, sai da função
if (!gInterface.Data[eLayout_MAIN].OnShow)
return;
// Garante o foco do cursor
pSetCursorFocus = true;
// Dimensões fixas do painel
const float MainWidth = 230.0f;
const float MainHeight = 240.0f;
// Lógica para drag and drop
if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
{
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
{
if (!m_isDragging)
{
m_isDragging = true;
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
else
{
float deltaX = pCursorX - m_dragStartPoint.x;
float deltaY = pCursorY - m_dragStartPoint.y;
m_windowPosX += deltaX;
m_windowPosY += deltaY;
if (m_windowPosX < 0)
m_windowPosX = 0;
else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
m_windowPosX = MAX_WIN_WIDTH - MainWidth;
if (m_windowPosY < 0)
m_windowPosY = 0;
else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
m_windowPosY = MAX_WIN_HEIGHT - MainHeight;
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
}
else
{
m_isDragging = false;
}
}
else
{
m_isDragging = false;
}
// Desenha o painel flutuante na posição atual
gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);
// Define a posição base para o texto
float StartX = m_windowPosX;
float StartY = m_windowPosY;
// Cria um vetor de linhas de texto
std::vector<std::string> textos;
textos.push_back("SEJA BEM VINDO AO MUONLINE");
textos.push_back("O continente de MU era glorioso e vasto,");
textos.push_back("Quando Kundun surgiu, trazendo o caos mortal.");
textos.push_back("Heróis lutaram com força e magia.");
textos.push_back("Criaturas sombrias espalharam terror.");
// Vetor com os tamanhos (em pontos) para cada linha
std::vector<int> fontSizes;
fontSizes.push_back(20);
fontSizes.push_back(16);
fontSizes.push_back(16);
fontSizes.push_back(16);
fontSizes.push_back(16);
// Define o espaçamento vertical entre as linhas
float linhaAltura = 30.0f;
// Para cada linha, cria e aplica uma fonte personalizada com o tamanho correspondente e desenha o texto
for (size_t i = 0; i < textos.size(); i++)
{
HFONT hCustomFont = CreateFontA(
-fontSizes[i], // Tamanho da fonte (em pontos)
0, // Largura: ajuste automático
0, // Escapamento
0, // Orientação
FW_BOLD, // Peso: negrito
FALSE, // Não itálico
FALSE, // Sem sublinhado
FALSE, // Sem tachado
DEFAULT_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
CLEARTYPE_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"Segoe UI" // Nome da fonte (deve estar instalada)
);
if (hCustomFont)
{
pSetFont(pTextThis(), (int)hCustomFont);
pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
textos[i].c_str(), 260, 0, (LPINT)3, 0);
DeleteObject(hCustomFont);
}
}
// --- Botão de fechar ---
// Altere a posição do botão close para que fique mais para cima e à direita.
// Aqui muda a posição X do botão close (mais à direita)
float closeButtonX = m_windowPosX + MainWidth - 20;
// Aqui muda a posição Y do botão close (mais para cima)
float closeButtonY = m_windowPosY - 10;
// Desenha o botão de fechar
gInterface.DrawGUI(eMenu_CLOSE, closeButtonX, closeButtonY);
// Se o cursor estiver sobre o botão, exibe o tooltip "Close"
if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29))
{
this->DrawToolTip(closeButtonX + 5, closeButtonY + 25, "Close");
}
// Verifica se o botão de fechar foi clicado
if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29) && (GetAsyncKeyState(VK_LBUTTON) & 0x8000))
{
gInterface.Data[eLayout_MAIN].OnShow = false;
}
}
#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.
// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
// Construtor vazio. Caso necessite, adicione inicializações aqui.
}
CLayout gLayout;
void CLayout::UpdateLayoutPanelWindow()
{
// Variável estática para controlar o estado da tecla F4
static bool isF4Pressed = false;
bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;
if (currentF4State && !isF4Pressed)
{
// Alterna a flag de exibição do painel
gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;
isF4Pressed = true;
}
else if (!currentF4State)
{
isF4Pressed = false;
}
}
// Variáveis globais para controle do drag e da posição do painel
bool m_isDragging = false;
POINT m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;
void CLayout::DrawLayoutPanelWindow()
{
// Se o painel não estiver para ser exibido, sai da função
if (!gInterface.Data[eLayout_MAIN].OnShow)
return;
// Garante o foco do cursor (certifique-se de que pSetCursorFocus está implementado corretamente)
pSetCursorFocus = true;
// Dimensões fixas do painel
const float MainWidth = 230.0f;
const float MainHeight = 240.0f;
// Lógica para drag and drop: se o mouse estiver sobre o painel ou se já estiver sendo arrastado
if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
{
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
{
if (!m_isDragging)
{
// Inicia o arraste: registra a posição corrente do cursor
m_isDragging = true;
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
else
{
// Atualiza a posição com base na variação do cursor
float deltaX = pCursorX - m_dragStartPoint.x;
float deltaY = pCursorY - m_dragStartPoint.y;
m_windowPosX += deltaX;
m_windowPosY += deltaY;
// Limita a posição horizontal
if (m_windowPosX < 0)
m_windowPosX = 0;
else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
m_windowPosX = MAX_WIN_WIDTH - MainWidth;
// Limita a posição vertical
if (m_windowPosY < 0)
m_windowPosY = 0;
else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
m_windowPosY = MAX_WIN_HEIGHT - MainHeight;
// Atualiza o ponto de referência para o próximo cálculo
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
}
else
{
// Se o botão esquerdo não está pressionado, encerra o arraste
m_isDragging = false;
}
}
else
{
m_isDragging = false;
}
// Desenha o painel flutuante na posição atual
gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);
// Define a posição base para o texto (origem: canto superior esquerdo do painel)
float StartX = m_windowPosX;
float StartY = m_windowPosY;
// Cria um vetor de linhas de texto e um vetor correspondente com os tamanhos de fonte desejados
std::vector<std::string> textos;
textos.push_back("SEJA BEM VINDO AO MUONLINE");
textos.push_back("O continente de MU era glorioso e vasto,");
textos.push_back("Quando Kundun surgiu, trazendo o caos mortal.");
textos.push_back("Heróis lutaram com força e magia.");
textos.push_back("Criaturas sombrias espalharam terror.");
// Vetor com os tamanhos (em pontos) para cada linha
std::vector<int> fontSizes;
fontSizes.push_back(20); // Por exemplo, a primeira linha um pouco maior
fontSizes.push_back(16);
fontSizes.push_back(16);
fontSizes.push_back(16);
fontSizes.push_back(16);
// Define o espaçamento vertical entre as linhas
float linhaAltura = 30.0f;
// Para cada linha, cria e aplica uma fonte personalizada com o tamanho correspondente e desenha o texto
for (size_t i = 0; i < textos.size(); i++)
{
// Cria a fonte: o valor negativo indica o tamanho em pontos desejado
HFONT hCustomFont = CreateFontA(
-fontSizes[i], // Altura da fonte (em pontos)
0, // Largura: 0 para ajuste automático
0, // Escapamento
0, // Orientação
FW_BOLD, // Peso da fonte: Bold (negrito)
FALSE, // Não itálico
FALSE, // Sem sublinhado
FALSE, // Sem tachado
DEFAULT_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
CLEARTYPE_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"Segoe UI" // Nome da fonte (use uma fonte TrueType instalada)
);
if (hCustomFont)
{
// Aplica a fonte personalizada
pSetFont(pTextThis(), (int)hCustomFont);
// Desenha a linha de texto na posição calculada
pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
textos[i].c_str(), 260, 0, (LPINT)3, 0);
// Libera o objeto de fonte após o uso para evitar vazamentos
DeleteObject(hCustomFont);
}
}
// Variável para eventuais usos gráficos (por exemplo, definição de cores)
DWORD Color = eGray100;
}
#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.
// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
// Construtor vazio. Caso necessite, adicione inicializações aqui.
}
CLayout gLayout;
void CLayout::UpdateLayoutPanelWindow()
{
// Variável estática para controlar o estado da tecla F4
static bool isF4Pressed = false;
bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;
if (currentF4State && !isF4Pressed)
{
// Alterna a flag de exibição do painel
gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;
isF4Pressed = true;
}
else if (!currentF4State)
{
isF4Pressed = false;
}
}
// Variáveis globais para controle do drag e da posição do painel
bool m_isDragging = false;
POINT m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;
void CLayout::DrawLayoutPanelWindow()
{
// Se o painel não estiver para ser exibido, sai da função
if (!gInterface.Data[eLayout_MAIN].OnShow)
return;
// Garante o foco do cursor – certifique-se de que pSetCursorFocus esteja implementado corretamente
pSetCursorFocus = true;
// Dimensões fixas do painel
const float MainWidth = 230.0f;
const float MainHeight = 240.0f;
// Lógica para drag and drop: se o mouse estiver sobre o painel ou se já estiver sendo arrastado
if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
{
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
{
if (!m_isDragging)
{
// Inicia o arraste: registra a posição corrente do cursor
m_isDragging = true;
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
else
{
// Atualiza a posição com base na variação do cursor
float deltaX = pCursorX - m_dragStartPoint.x;
float deltaY = pCursorY - m_dragStartPoint.y;
m_windowPosX += deltaX;
m_windowPosY += deltaY;
// Limita para não ultrapassar as bordas da tela (horizontal)
if (m_windowPosX < 0)
m_windowPosX = 0;
else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
m_windowPosX = MAX_WIN_WIDTH - MainWidth;
// Limita para não ultrapassar as bordas da tela (vertical)
if (m_windowPosY < 0)
m_windowPosY = 0;
else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
m_windowPosY = MAX_WIN_HEIGHT - MainHeight;
// Atualiza o ponto de referência para o próximo cálculo
m_dragStartPoint.x = pCursorX;
m_dragStartPoint.y = pCursorY;
}
}
else
{
// Se o botão esquerdo não está pressionado, encerra o arraste
m_isDragging = false;
}
}
else
{
m_isDragging = false;
}
// Desenha o painel flutuante na posição atual
gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);
// Define a posição base para o texto (origem: canto superior esquerdo do painel)
float StartX = m_windowPosX;
float StartY = m_windowPosY;
// Cria uma fonte personalizada para exibir o texto em Bold, tamanho 24
HFONT hCustomFont = CreateFontA(
-20, // Altura da fonte: -24 indica 24 pontos
0, // Largura: 0 para ajuste automático
0, // Escapamento
0, // Orientação
FW_BOLD, // Peso da fonte: Bold
FALSE, // Não itálico
FALSE, // Sem sublinhado
FALSE, // Sem tachado
DEFAULT_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
CLEARTYPE_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"Segoe UI" // Nome da fonte
);
if (hCustomFont)
{
// Aplica a fonte personalizada
pSetFont(pTextThis(), (int)hCustomFont);
// Cria um vetor para armazenar as linhas de texto usando push_back
std::vector<std::string> textos;
textos.push_back("SEJA BEM VINDO AO MUONLINE");
textos.push_back("MU era glorioso e vasto,");
textos.push_back("Quando Kundun surgiu, trazendo o caos.");
textos.push_back("Heróis lutaram com força e magia.");
textos.push_back("Criaturas sombrias espalharam terror.");
// Define o espaçamento vertical entre as linhas
float linhaAltura = 30.0f;
// Exibe cada linha de texto, uma abaixo da outra
for (size_t i = 0; i < textos.size(); i++)
{
pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
textos[i].c_str(), 260, 0, (LPINT)3, 0);
}
// Libera o objeto de fonte após o uso para evitar vazamentos de recursos
DeleteObject(hCustomFont);
}
// Variável para eventuais usos gráficos (por exemplo, definição de cores)
DWORD Color = eGray100;
}
<iframe src="http://TU-NOIP+PUERTO-O-IP+PUERTO-O-IP/web_post_pvp_host.php" id="web" name="ramegm" height="200" frameborder="0" width="420" scrolling="Auto"></iframe>
REMPLAZAMOS<?
$rootname = 'E:\MuServer\GameServer\POST_LOG'; //REEMPLAZA POR TU DIRECCION DE CARPETA
$servername = 'Server1'; // REMPLAZA POR TU NOMBRE DE SERVER
$limit=50; // Limite de mensajes que se mostraran en la web
echo '<iframe width="400" height="180" scrolling="no" src="web_post_pvp.php?root='.$rootname.'&name='.$servername.'&='.$limit.'" frameborder="1" style="background-color:#1A1917"></iframe>'; //COLOR DE FONDO
?>
<?php
$rootname = $_GET['root']; // Disco y Carpeta donde esta el servidor
$servername = $_GET['name']; // Nombre del Server en GameServer\Data\serverinfo.dat
$postlimit=isset($_GET['limit']) ? $_GET['limit'] : 50;
$fecha = date('Y-m-d');
echo "<strong style='padding-left:100px'>.:: P o s t s d e l S e r v i d o r ".$servername." ::.</strong><br>";
if(file_exists($rootname."\POST_LOG ".$fecha."_".$servername.".txt")){
$ordeninverso = array_reverse(file($rootname."\POST_LOG ".$fecha."_".$servername.".txt"));
$count=1;
foreach($ordeninverso as $archivo){
echo preg_replace("#(.*?) \[Post\] <(.*?)> (.*)#i","<br /><div style='display:inline;'><div style='color:gray;float:left;'><em>$count) \\1</em></div> <div style='color:orange; width:76px; float:left;padding-left:10px'><strong>[\\2]</strong></div><div style='color:#00CC00; display:inline;'> [".htmlentities('\\3')."] </div></div>",$archivo);
if($count==$postlimit){
break;
}
$count++;
}
}
?>
este script va dentro de tu archivo "web_post_pvp_host.php" o .PHP nuevo que creaste ok<?
$rootname = 'E:\MuServer\GameServer\POST_LOG'; // Disco y Carpeta donde esta el servidor y los archivos de Post Log
$servername = 'Server1'; // Nombre del Server en GameServer\Data\serverinfo.dat
$limit=50; // Limite de mensajes que se mostraran en la web
echo '<iframe width="400" height="180" scrolling="no" src="web_post_pvp.php?root='.$rootname.'&name='.$servername.'&='.$limit.'" frameborder="1" style="background-color:#1A1917"></iframe>';
?>
SEGUNDO CÓDIGO A PEGAR EN TU INDEX.PHP<?php
$rootname = $_GET['root']; // Disco y Carpeta donde esta el servidor
$servername = $_GET['name']; // Nombre del Server en GameServer\Data\serverinfo.dat
$postlimit=isset($_GET['limit']) ? $_GET['limit'] : 50;
$fecha = date('Y-m-d');
echo "<strong style='padding-left:100px'>.:: P o s t s d e l S e r v i d o r ".$servername." ::.</strong><br>";
if(file_exists($rootname."\POST_LOG ".$fecha."_".$servername.".txt")){
$ordeninverso = array_reverse(file($rootname."\POST_LOG ".$fecha."_".$servername.".txt"));
$count=1;
foreach($ordeninverso as $archivo){
echo preg_replace("#(.*?) \[Post\] <(.*?)> (.*)#i","<br /><div style='display:inline;'><div style='color:gray;float:left;'><em>$count) \\1</em></div> <div style='color:orange; width:76px; float:left;padding-left:10px'><strong>[\\2]</strong></div><div style='color:#00CC00; display:inline;'> [".htmlentities('\\3')."] </div></div>",$archivo);
if($count==$postlimit){
break;
}
$count++;
}
}
?>
ASI DEBERIA DE QUEDAR TU INDEX.PHP CON LOS DOS CODIGOSUPDATE 12:
- Custom NPC move
- CustomCommandInfo (v2)
- Custom RankUser OverHead
- Custom Party Icon(s4/s6)
- Trade Value
- Party Disable PK
- New Anti SpeedHack Skill System
Cita de: dexign en Mar 21, 2025, 05:05 AMcomo hiciste para que funcionara el lua?