Beispiel #1
0
void ConnectEx::SendLogin(int UserIndex, CONNECTEX_LOGIN * Data)
{
	/*if(		g_License.GetLicenseID() != Customer::Zeon
		&&	g_License.GetLicenseID() != Customer::Refinery
		&&	g_License.GetLicenseID() != Customer::Bereznuk
		&&	g_License.GetLicenseID() != Customer::Reedlan
		&&	g_License.GetLicenseID() != Customer::MUAngel
		&&	g_License.GetLicenseID() != Customer::MUAngel2 
		&&	g_License.GetLicenseID() != Customer::White
		&&	g_License.GetLicenseID() != Customer::White2 
		&&  g_License.GetLicenseID() != Customer::drynea 
		&&  g_License.GetLicenseID() != Customer::virnet )
	{
		return;
	}*/
	// ----
	BuxConvert(Data->AccountID, MAX_ACCOUNT_LEN);
	BuxConvert(Data->Password, MAX_ACCOUNT_LEN);
	// ----
	char id[11];
	id[10]=0;
	memcpy(id, Data->AccountID, sizeof(Data->AccountID));
	BuxConvert(id, MAX_ACCOUNT_LEN);
	// ----
	GJPUserClose(id); //Force connection
	// ----
	if( bCanConnectMember == TRUE )
	{
		if( ConMember.IsMember(id) == FALSE )
		{
			GCJoinResult(JS_ONLY_VIP_MEMBERS, UserIndex);
			return;
		}
	}
	// ----
	LPOBJ lpObj = &gObj[UserIndex];
	// ----
	if( gObj[UserIndex].Connected != PLAYER_CONNECTED )
	{
		LogAdd(lMsg.Get(MSGGET(1, 218)), UserIndex, id);
		CloseClient(UserIndex);
		return;
	}
	// ----
	if( gObj[UserIndex].LoginMsgSnd != FALSE )
	{
		if( gObj[UserIndex].LoginMsgSnd == TRUE )
		{
			LogAdd(lMsg.Get(MSGGET(1, 219)), UserIndex, id, gObj[UserIndex].Ip_addr );
		}
		else
		{
			LogAdd("error : %d %s %d", gObj[UserIndex].LoginMsgSnd, __FILE__, __LINE__);
		}

		return;
	}
	// ----
	if( lpObj->Connected >= PLAYER_LOGGED )
	{
		return;
	}
	// ----
	SDHP_IDPASS spMsg;
	// ----
	PHeadSetB((LPBYTE)&spMsg, 0x01, sizeof(spMsg));
	spMsg.Number = UserIndex;
	memcpy(spMsg.Id, Data->AccountID, sizeof(spMsg.Id));
	memcpy(spMsg.Pass, Data->Password, sizeof(spMsg.Pass));
	strcpy(spMsg.IpAddress, gObj[UserIndex].Ip_addr);
	gObj[UserIndex].CheckTick = Data->TickCount;
	gObj[UserIndex].CheckTick2 = GetTickCount();
	gObj[UserIndex].ConnectCheckTime = GetTickCount();
	gObj[UserIndex].CheckSpeedHack = true;
	gObj[UserIndex].LoginMsgSnd = 1;
	gObj[UserIndex].LoginMsgCount = 1;
	gObj[UserIndex].AccountID[MAX_ACCOUNT_LEN] = 0;
	gObj[UserIndex].Name[MAX_ACCOUNT_LEN] = 0;
	memcpy(gObj[UserIndex].AccountID, id, MAX_ACCOUNT_LEN);
	memcpy(gObj[UserIndex].Name, Data->Name, MAX_ACCOUNT_LEN);
	gObj[UserIndex].m_cAccountItemBlock = 0;
	gObj[UserIndex].m_ConnectEx = true;
	gObj[UserIndex].ukn_30 = 0;
	// ----
	wsJServerCli.DataSend((char*)&spMsg, spMsg.h.size);
	LogAddTD("join send : (%d)%s", UserIndex, gObj[UserIndex].AccountID);
	lpObj->m_bMapSvrMoveReq = false;
	lpObj->m_sPrevMapSvrCode = -1; 
	lpObj->m_sDestMapNumber = -1;
	lpObj->m_btDestX = 0;
	lpObj->m_btDestY = 0;
}
Beispiel #2
0
void JGPAccountRequest(SDHP_IDPASSRESULT * lpMsg)
{
	char szId[11];
	int aIndex;
	char szJN[20]="";
	
	memset(szId, 0, sizeof(szId));
	memcpy(szId, lpMsg->Id , sizeof(lpMsg->Id));
	memcpy(szJN, lpMsg->JoominNumber , sizeof(lpMsg->JoominNumber));

	aIndex = lpMsg->Number ;

	switch ( lpMsg->result  )
	{
		case 1:
		case 15:
			if (gObjSetAccountLogin(aIndex, szId, lpMsg->UserNumber , lpMsg->DBNumber, szJN ) == 0 )
			{
				GJPAccountFail(aIndex, szId, lpMsg->DBNumber , lpMsg->UserNumber  );
				lpMsg->result  = 4;
			}
			else
			{	
				LogAddTD(lMsg.Get(MSGGET(1, 211)), gObj[aIndex].Ip_addr, szId, lpMsg->UserNumber , lpMsg->DBNumber );
			}

			if ( lpMsg->UserNumber  == 0 && lpMsg->DBNumber  == 0)
			{
				LogAddTD(lMsg.Get(MSGGET(1, 212)), szId, lpMsg->UserNumber , lpMsg->DBNumber );
			}
	}
#if (ENABLE_CUSTOM_OFFLINETRADE==1)

	if( lpMsg->result == 6 )
	{
		for (int n=OBJ_STARTUSERINDEX;n<OBJMAX; n++)
		{
			if ( gObj[n].Connected >= PLAYER_PLAYING)
			{
				if ( gObj[n].AccountID[0] == *szId )
				{
					if ( strcmp(&gObj[n].AccountID[0] , szId) == 0)
					{
						if( gObj[n].bOffTrade )
						{
							gObjDel(n);
						}
						break;
					}
				}
			}
		}

		lpMsg->result = 3;
	}
#else

	if( lpMsg->result == 6 )
		lpMsg->result = 3;

#endif

	if ( lpMsg->result == 0 )
		lpMsg->result = 2;

	if ( lpMsg->result  == 15 )
	{
		lpMsg->result  = 1;
		gObj[aIndex].m_cAccountItemBlock = 1;
	}
	
	gObj[aIndex].LoginMsgSnd = 0;

	if (gObj[aIndex].LoginMsgCount >= 3 )
	{
		lpMsg->result = 8;
	}

	GCJoinResult(lpMsg->result , aIndex);

	if ( lpMsg->result  != 1 )
	{
		if ( gObj[aIndex].LoginMsgCount > 3 )
		{
			CloseClient(aIndex);
		}
	}
}
Beispiel #3
0
void JGPAccountRequest(SDHP_IDPASSRESULT * lpMsg)
{
    char szId[11];
    int aIndex;
    char szJN[14]="";

    memset(szId, 0, sizeof(szId));
    memcpy(szId, lpMsg->Id , sizeof(lpMsg->Id));
    memcpy(szJN, lpMsg->JoominNumber , sizeof(lpMsg->JoominNumber));

    aIndex = lpMsg->Number ;

    if ( lpMsg->result  == 1 || lpMsg->result  == 15 )
    {
        if ( gNonPK == 0 && gLanguage == 0 )
        {
            if (gJoomin15Check(szJN) == 0 )
            {
                GJPAccountFail(aIndex, szId, lpMsg->DBNumber , lpMsg->UserNumber );
                lpMsg->result  = 17;
            }
        }

        if ( gPkLimitFree == 1 && gLanguage == 0 )
        {
            if (gJoominCheck(szJN, 18) == 0 )
            {
                GJPAccountFail(aIndex, szId, lpMsg->DBNumber , lpMsg->UserNumber );
                lpMsg->result  = 17;
            }
        }
    }

    switch ( lpMsg->result  )
    {
    case 1:
    case 15:
        if (gObjSetAccountLogin(aIndex, szId, lpMsg->UserNumber , lpMsg->DBNumber, szJN ) == 0 )
        {
            GJPAccountFail(aIndex, szId, lpMsg->DBNumber , lpMsg->UserNumber  );
            lpMsg->result  = 4;
        }
        else
        {
            LogAdd("***0467*** login     : (%s)[%s] number:%d/ db:%d", gObj[aIndex].Ip_addr, szId, lpMsg->UserNumber , lpMsg->DBNumber );
        }

        if ( lpMsg->UserNumber  == 0 && lpMsg->DBNumber  == 0)
        {
            LogAdd("Both user number and DB number are 0 (%s) %d %d", szId, lpMsg->UserNumber , lpMsg->DBNumber );
        }
    }

    if ( lpMsg->result == 0 )
        lpMsg->result = 2;

    if ( lpMsg->result  == 15 )
    {
        lpMsg->result  = 1;
        gObj[aIndex].m_cAccountItemBlock = 1;
    }

    gObj[aIndex].LoginMsgSnd = 0;

    if (gObj[aIndex].LoginMsgCount >= 3 )
    {
        lpMsg->result = 8;
    }

    GCJoinResult(lpMsg->result , aIndex);

    if ( lpMsg->result  != 1 )
    {
        if ( gObj[aIndex].LoginMsgCount > 3 )
        {
            CloseClient(aIndex);
        }
    }
}