예제 #1
0
/*void OffTradeLogin(int aIndex,LPBYTE aRecv)
{
	PMSG_IDPASS *lpMsg = (PMSG_IDPASS*)aRecv;

	char AccountID[11];
	AccountID[10] = 0;
	memcpy(AccountID,lpMsg->Id,sizeof(lpMsg->Id));
	BuxConvert(AccountID,10);

	for(int i = OBJECT_MIN; i<OBJECT_MAX;i++)
	{
		OBJECTSTRUCT *lpObj = (OBJECTSTRUCT*)OBJECT_POINTER(i);

		if(lpObj->Connected == 3)
		{
			if(!strcmp(AccountID,lpObj->AccountID))
			{
				if(OfflineShop[i].IsOffTrade == 1)
				{
					GJPUserClose(lpObj->AccountID);
					g_Console.ConsoleOutput(4,"[OFFTRADE][%s][%s] Close Offline Shop",lpObj->AccountID,lpObj->Name);
					//LogAdder ("OFFTRADE","Close Offline Shop",i);
					gObjDel(i);
					OfflineShop[i].IsOffTrade = 0;
					//SQL.OffTradeOff(aIndex);
				
				}
			}
		}


	
	}
}*/
void OffTradeLogin(int aIndex,LPBYTE aRecv)
{
	PMSG_IDPASS *lpMsg = (PMSG_IDPASS*)aRecv;

	char AccountID[11];
	AccountID[10] = 0;
	memcpy(AccountID,lpMsg->Id,sizeof(lpMsg->Id));
	BuxConvert(AccountID,10);

	for(int i = OBJECT_MIN; i<OBJECT_MAX;i++)
	{
		OBJECTSTRUCT *lpObj = (OBJECTSTRUCT*)OBJECT_POINTER(i);

		if(lpObj->Connected == 3)
		{
			if(!strcmp(AccountID,lpObj->AccountID))
			{
				if(OfflineShop[i].IsOffTrade == 1)
				{
					GJPUserClose(lpObj->AccountID);
					g_Console.ConsoleOutput(4,"[OFFTRADE][%s][%s] Close Offline Shop",lpObj->AccountID,lpObj->Name);
					//LogAdder ("OFFTRADE","Close Offline Shop",i);
					gObjDel(i);
					OfflineShop[i].IsOffTrade = 0;
					//SQL.OffTradeOff(aIndex);
				}
			}
		}
	}
}
// -------------------------------------------------------------------------------------------------------------------------------------------------------
void JSProtocol::JSProtocolCore(int aIndex, BYTE HeadCode, LPBYTE aRecv, int iSize)
{
	switch (HeadCode)
	{
		case JS_PROTO_CORE_SRV_LOGIN:
		{
			this->JoinServerLogin(aIndex, (JOIN_SERVER_INFO *)aRecv);				// Done & Revised By WolF	[24/12/2011]
			// -----
		}	break;
		// -----
		case JS_PROTO_CORE_ACC_REQUEST:
		{
			this->JGPAccountRequest(aIndex, (JOIN_SERVER_ACC_REQUEST *)aRecv);			// Done & Revised By WolF	[24/12/2011]
			// -----
		}	break;
		// -----
		case JS_PROTO_CORE_JOIN_FAIL:
		{
			this->GJPAccountFail(aIndex, (JOIN_SERVER_JOIN_FAIL *)aRecv);				// Done & Revised By WolF	[24/12/2011]
			// -----
		}	break;
		// -----
		case JS_PROTO_CORE_ACC_CLOSE:
		{
			GJPUserClose(aIndex, (JOIN_SERVER_USER_CLOSE *)aRecv);						// Done & Revised By WolF	[24/12/2011]
			// -----
		}	break;
	}
}
예제 #3
0
void cOffExp::Close(char * AccountID)
{
	for( int i = OBJ_STARTUSERINDEX; i < OBJMAX; i++ )
	{
		LPOBJ lpUser = &gObj[i];
		// ----
		if( lpUser->Connected != PLAYER_PLAYING || !lpUser->OffExp || strcmp(AccountID, lpUser->AccountID) )
		{
			continue;
		}
		// ----
		GJPUserClose(lpUser->AccountID);
		gObjDel(i);
		lpUser->OffExp = false;
	}
}
예제 #4
0
void OfflineTrade::Close(char * AccountID)
{
	for( int i = OBJ_STARTUSERINDEX; i < OBJMAX; i++ )
	{
		LPOBJ lpUser = &gObj[i];
		// ----
		if( lpUser->Connected != PLAYER_PLAYING || !lpUser->IsOffTrade || strcmp(AccountID, lpUser->AccountID) )
		{
			continue;
		}
		// ----
		GJPUserClose(lpUser->AccountID);
		gObjDel(i);
		lpUser->IsOffTrade = false;
		// ----
		g_OfflineTradeLog.Output("[%s] [%s] Offline shop has been closed, account free", 
			lpUser->AccountID, lpUser->Name);
	}
}
예제 #5
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;
}