Last Login

Codes already submitted by people of the forums.
Post Reply
50-pesos
just visiting
Posts: 3
Joined: Sun Jan 01, 2006 1:11 pm

Post by 50-pesos »

The server will show you the last time you entered to the game:

Code: Select all

Your last visit in HBArmageddon: 18:21:54 - 31/07/11
Game.cpp:
Search:

Code: Select all

m_iTotalClients++;
        if (m_iTotalClients > m_iMaxClients) { 
            m_iMaxClients = m_iTotalClients;
        }
right under that add:

Code: Select all

//50Cent - Last Login
        m_pClientList[i]->bShowLastLogin = TRUE;
At the end of the method:

Code: Select all

void CGame::RequestInitDataHandler(int iClientH, char * pData, char cKey)
add:

Code: Select all

//50Cent - Last Login
    if(m_pClientList[iClientH]->bShowLastLogin == TRUE)
    {
        wsprintf(G_cTxt, "Your last visit in HBArmageddon: %d:%d:%d - %d/%d/%d", m_pClientList[iClientH]->m_iLastHora, m_pClientList[iClientH]->m_iLastMin, m_pClientList[iClientH]->m_iLastSeg, m_pClientList[iClientH]->m_iLastDia, m_pClientList[iClientH]->m_iLastMes,m_pClientList[iClientH]->m_iLastAno);
        ShowClientMsg(iClientH, G_cTxt);
        m_pClientList[iClientH]->bShowLastLogin = FALSE;
    }
Search:

Code: Select all

case 80: // v2.15 �ö�¸¾ÆÀÌÅÛ¾÷±×·¹À̵å
                if (_bGetIsStringIsNumber(token) == FALSE) {
                    wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iGizonItemUpgradeLeft - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                    PutLogList(cTxt);
                    delete pContents;
                    delete pStrTok;
                    return FALSE;
                }

                m_pClientList[iClientH]->m_iGizonItemUpgradeLeft = atoi(token);
                cReadModeA = 0;
                break;
under that add:

Code: Select all

case 87://50Cent - Last Login
                switch (cReadModeB)
                {
                    case 1://Hora
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastHora - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastHora = atoi(token);
                        cReadModeB = 2;
                        break;
                    case 2://Minuto
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastMin - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastMin = atoi(token);
                        cReadModeB = 3;
                        break;
                    case 3://Segundo
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastSeg - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastSeg = atoi(token);
                        cReadModeB = 4;
                        break;
                    case 4://Dia
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastDia - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastDia = atoi(token);
                        cReadModeB = 5;
                        break;
                    case 5://Mes
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastMes - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastMes = atoi(token);
                        cReadModeB = 6;
                        break;
                    case 6://Año
                        if (_bGetIsStringIsNumber(token) == FALSE) {
                            wsprintf(cTxt, "(!!!) Player(%s) data file error! wrong m_iLastAno - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
                            PutLogList(cTxt);
                            delete pContents;
                            delete pStrTok;
                            return FALSE;
                        }
                        m_pClientList[iClientH]->m_iLastAno = atoi(token);
                        cReadModeA = 0;
                        cReadModeB = 0;
                        break;
                }
                break;
Search:

Code: Select all

if (memcmp(token, "[EOF]", 5) == 0) goto DPDC_STOP_DECODING;
before that add:

Code: Select all

//50Cent - Last Login
            if (memcmp(token, "last-login", 10) == 0) {
                cReadModeA = 87;
                cReadModeB = 1;
            }
Search:

Code: Select all

strcat(pData,"\n\n");

    // ij¸¯ÅÃ�ÀÇ ¿ÜÇüÇ¥Çö Appr4°³¸¦ ÀúÀåÇÑ´Ù. ÀÌ°Ã�˼ °ÔÀÓ¼Â*¹ö¿¡¼Â*´Â »ç¿ëÇÃ�Ã�ö ¾ÊÀ¸¸ç ·Î±×¼Â*¹ö->Ŭ¶óÀ̾ðÆ®°£¿¡ »ç¿ëµÈ´Ù.
    strcat(pData, "appr1 = ");
    itoa( m_pClientList[iClientH]->m_sAppr1, cTxt, 10);
    strcat(pData, cTxt);
    strcat(pData, "\n");
    strcat(pData, "appr2 = ");
before that add:

Code: Select all

//50Cent - Last Login
    GetLocalTime(&SysTime);
    wsprintf(cTxt, "last-login = %d %d %d %d %d %d", SysTime.wHour, SysTime.wMinute, SysTime.wSecond, SysTime.wDay, SysTime.wMonth, SysTime.wYear);
    strcat(pData, cTxt);
    strcat(pData, "\n");
Client.cpp:
Search:

Code: Select all

m_bMagicPauseTime = FALSE;
just under that add:

Code: Select all

//50Cent - Last Login
    m_iLastHora = m_iLastMin = m_iLastSeg = m_iLastDia = m_iLastMes = m_iLastAno = 0;
    bShowLastLogin = TRUE;
Client.h:
Search:

Code: Select all

char m_cSaveCount;
add under:

Code: Select all

//50Cent - Last Login
    int m_iLastHora, m_iLastMin, m_iLastSeg, m_iLastDia, m_iLastMes, m_iLastAno;
    BOOL bShowLastLogin;
really old code but works ; ) hope you like it
<img src='http://i722.photobucket.com/albums/ww22 ... ippy-5.gif' border='0' alt='user posted image' />
Post Reply