Solución DailyReward Repite el Premio al Salir y Entrar al Juego MuEmu Season 6

Publicado por Dakosmu, Feb 18, 2025, 03:39 PM

Tema anterior - Siguiente tema

Dakosmu

Solución DailyReward Repite el Premio al Salir y Entrar al Juego MuEmu Season 6

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

*Solución Daily Reward en MuEmu Season 6: Repite el premio al salir y entrar al juego.*


DataServer MuEmu Season 6




https://imgur.com/a/qM5BskE
        case 0x68:
            GDDailyRewardInfoRecv(lpMsg, index);
            break;




https://imgur.com/ZNYNWfg
    SDHP_DAILY_REWARD_INFO_SEND dailyreward = { 0 };

    dailyreward.header.set(0x68, sizeof(dailyreward));

    dailyreward.index = lpMsg->index;

    memcpy(dailyreward.name, lpMsg->name, sizeof(dailyreward.name));

    dailyreward.result = 0;

    for (int z = 0; z < 31; z++)
    {
        dailyreward.Status[z] = 0;
    }


https://imgur.com/f34VUib

        //daily reward
        if (gQueryManager.ExecQuery("SELECT * FROM DailyReward WHERE Acc='%s' AND month = MONTH(GETDATE())", lpMsg->account) == 0)
        {
            gQueryManager.Close();
        }
        else
        {
            while (gQueryManager.Fetch() != SQL_NO_DATA)
            {
                int day = (DWORD)gQueryManager.GetAsInteger("Date");
                if (day > 0 && day <= 31)
                {
                    dailyreward.Status[day - 1] = 1;
                }
            }
            gQueryManager.Close();
        }


https://imgur.com/uXqF790

#if(DAILY)
    gSocketManager.DataSend(index, (BYTE*)&dailyreward, sizeof(dailyreward));
#endif



https://imgur.com/FMDVQbe

void GDDailyRewardInfoRecv(BYTE* lpMsg, int index)
{
    SDHP_DAILY_REWARD_INFO_SEND* dailyreward = (SDHP_DAILY_REWARD_INFO_SEND*)lpMsg;

    for (int i = 0; i < 31; i++)
    {
        if (dailyreward->Status[i])
        {
            if (gQueryManager.ExecQuery("SELECT * FROM DailyReward WHERE Acc='%s' AND date = %d AND month = MONTH(GETDATE())", dailyreward->acc, i + 1) == 0 || gQueryManager.Fetch() == SQL_NO_DATA)
            {
                gQueryManager.Close();
                gQueryManager.ExecQuery("INSERT INTO DailyReward (acc, name, date) VALUES ('%s','%s', %d)", dailyreward->acc, dailyreward->name, i + 1);
                gQueryManager.Close();
            }
            else
            {
                gQueryManager.Close();
            }
        }
    }
}


https://imgur.com/undefined

void GDDailyRewardInfoRecv(BYTE* lpMsg, int index);

https://imgur.com/QLmLgnU

struct SDHP_DAILY_REWARD_INFO_SEND
{
    PWMSG_HEAD header; // C2:04
    WORD index;
    int  result;
    char acc[11];
    char name[11];
    BYTE Status[31];
};


Scrip SQL

USE [Bruce]  -- Selecciona la base de datos 'Bruce' para ejecutar las siguientes instrucciones
GO

-- Verifica si existe la tabla 'DailyReward' en la base de datos
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DailyReward]') AND type in (N'U'))
    DROP TABLE [dbo].[DailyReward]  -- Si existe, la elimina
GO

USE [Bruce]  -- Selecciona nuevamente la base de datos 'Bruce'
GO

/****** Object:  Table [dbo].[DailyReward]    Script Date: 06/16/2022 18:19:28 ******/
SET ANSI_NULLS ON  -- Configura cómo se manejan los valores NULL en comparaciones
GO

SET QUOTED_IDENTIFIER ON  -- Permite el uso de comillas dobles para identificar nombres de objetos
GO

SET ANSI_PADDING ON  -- Controla el almacenamiento de espacios en blanco en columnas de tipo varchar
GO

-- Crea la tabla 'DailyReward' con las siguientes columnas
CREATE TABLE [dbo].[DailyReward](
    [acc] [varchar](10) NOT NULL,  -- Columna 'acc' de tipo varchar con un máximo de 10 caracteres, no puede ser NULL
    [name] [varchar](10) NOT NULL,  -- Columna 'name' de tipo varchar con un máximo de 10 caracteres, no puede ser NULL
    [date] [int] NOT NULL DEFAULT DAY(GETDATE()),  -- Columna 'date' de tipo entero, no puede ser NULL, valor por defecto es el día actual
    [month] [int] NOT NULL DEFAULT MONTH(GETDATE()),  -- Columna 'month' de tipo entero, no puede ser NULL, valor por defecto es el mes actual
    [Created_At] [smalldatetime] NOT NULL DEFAULT(GETDATE()),  -- Columna 'Created_At' de tipo smalldatetime, no puede ser NULL, valor por defecto es la fecha y hora actual
) ON [PRIMARY]  -- Especifica que la tabla se almacena en el grupo de archivos primario

GO

SET ANSI_PADDING OFF  -- Restaura la configuración de manejo de espacios en blanco
GO
Bon Dia

🡱 🡳