예제 #1
0
NS_IMETHODIMP
nsEnigMimeDecrypt::StopRequest(PRUint32 status)
{
  DEBUG_LOG(("nsEnigMimeDecrypt::StopRequest:\n"));

  ProcessEnd(nsnull);
  mDone = PR_TRUE;

  return NS_OK;
}
예제 #2
0
파일: nMain.c 프로젝트: zenbaku/nano
void nExitSystem(int rc)
{
  START_CRITICAL();

    nFprintf(2,"Estadisticas finales:\n");
    ProcessEnd();
    MsgEnd();
    TimeEnd();
    IOEnd();

    exit(rc);
}
예제 #3
0
void __stdcall ReceivedMsgServer(DWORD dwConnectionIndex,char* pMsg,DWORD dwLength)
{
	EXCEPTION_POINTERS* pException = NULL;//020508 lsw
	__try	//020508 lsw
	{

		BYTE bID;
		bID = (BYTE)pMsg[0];

		if (dwConnectionIndex == 0)
		{
	#ifdef __ON_DEBUG
	//		_asm int 3;
	#endif
			return;
		}

		if( bID == (BYTE)PTCL_NOTIFY_SERVER_UP )
		{
			if( g_pServerTable->OnRecvServerUpMsg(dwConnectionIndex, *(WORD*)(pMsg+1)) )
			{
	#ifdef __ON_DEBUG
	//			_asm int 3;
	#endif
			}
			return;
		}

		LP_SERVER_DATA pSender = g_pServerTable->GetConnectedServerData( dwConnectionIndex );

		if( !pSender ) return;

		switch (bID)
		{
		// -------------
		// 기본패킷 
		// -------------
		// 전용
		case PTCL_ORDER_SET_SERVER_LIST:
		case PTCL_ORDER_CONNECT_TO_SERVERS:
		case PTCL_ORDER_SET_DB_DEMON:
		case PTCL_ORDER_TO_REPORT_SERVER_DATAS:
		case PTCL_NOTIFY_YOU_ARE_CERTIFIED:

		//공통
		case PTCL_ORDER_DESTROY_SERVER:
		case PTCL_NOTIFY_SERVER_STATUS:
		case PTCL_SERVER_TRY_TO_CHECK_CONNECTION:
		case PTCL_SERVER_CONNECTION_OK:
		case PTCL_ORDER_TO_REPORT_SERVER_STATUS:
			{
				if( !g_pServerTable->OnRecvNegotiationMsgs( pSender, bID, pMsg+1, dwLength-1 ) )
				{
					MyLog( LOG_FATAL, "OnRecvNegotiationMsg() Failed :: (pSender(%d), bId(%d), MsgLength(%d))", pSender->wPort, bID, dwLength );
	#ifdef __ON_DEBUG
	//				_asm int 3;
	#endif
				}
			}
			break;
		case PTCL_AGENT_TO_DB_REMOVE_USER_FROM_LOGIN_TABLE:
			{
				char id[20];
				memset(id,0,20);
				memcpy(id,pMsg+4+1,20);
				if(LocalMgr.IsAbleNation(TAIWAN|CHINA|HONGKONG))//021007 lsw
				{
					//2001/02/24 zhh
					if(dwLength>1+4+ID_LENGTH+2+15)
					{
					char in[15],out[15];
					memset(in,0,15);
					memset(out,0,15);
					memcpy(out,pMsg+1+4+ID_LENGTH+2, 15);
					memcpy(in ,pMsg+1+4+ID_LENGTH+2+15, 15);

					//2001/08/30 zhh
					char IP[20]={0,};
					memcpy(IP ,pMsg+1+4+ID_LENGTH+2+15+15, 20);


					//2001/02/19 zhh
					for(int i=0;i<14;i++)
					{
						if(out[i]==' ')	out[i]='0';
						if( in[i]==' ')	 in[i]='0';
					}
					// acer5
					if(ConQ && out[0]!=0 && in[0]!=0)
						ConQ->AskCheckLogoutWithIP(id,in,out,IP);
					}
				}

				//001218 zhh
				int ret = onepass.DeleteUsedID_SQL_ForPay(NULL,id,0);
				if( ret != 1 )
				{
					MyLog( LOG_NORMAL, "<zoung>%d %s close ret = %d(1 = success)", dwConnectionIndex, id, ret);
				}
			}
			break;
		case PTCL_AGENT_TO_DB_REQUEST_REMOVE_USER:
			{
				ClearUserCN(dwConnectionIndex,pMsg,dwLength);
			}
			break;
		case PTCL_AGENT_TO_DB:
		case PTCL_MAP_TO_DB:
			{
				DWORD dwUniqID;
				t_packet raja_packet;
				memset(&raja_packet,0,sizeof(t_packet));
				memcpy(&dwUniqID, pMsg+1, 4);
				memcpy(raja_packet.h.data, pMsg+1+4, HEADER_SIZE);
				memcpy(raja_packet.u.data, pMsg+1+4+HEADER_SIZE, raja_packet.h.header.size);
			
				DWORD cn = GetUserCN( pSender, dwUniqID, raja_packet.h.header.type );
				//if( cn == -1 ) break;
				///////////////////////////////////////////////////////////////////////////
				
				connections[cn].dwUserID = dwUniqID;
				connections[cn].dwConIndex = dwConnectionIndex;

				//sprintf(txt,"cn: %d USERID %d Index %d",cn, dwUniqID,dwConnectionIndex);
				//WriteText(txt);

				HandleCommand( connections, dwConnectionIndex, &raja_packet ,dwUniqID,cn );
			}
			break;





		// Added by chan78 at 2000/12/17
		case PTCL_ORDER_TO_CLEAR_PAY_TABLE:
			{
				onepass.DeleteUsedID_SQL_ForPay(NULL," ", (int)*(WORD*)(pMsg+1));
			}
			break;
		// Added by chan78 at 2001/03/16
		// -----------------------------
		case PTCL_MANAGER_QUERY:
			{
				if( !OnRecvMsgFromManager( (LP_MANAGER_PACKET)pMsg, dwLength ) )
				{
					MyLog( LOG_FATAL, "PTCL_MANAGER_ANSWER :: OnRecvMsgFromManager() has return false(%d)", pSender->wPort );
					break;
				}
			}
			break;
		// Added by chan78 at 2001/03/16
		case PTCL_MANAGER_ANSWER:
			{
				// 있을 수 없다.
				MyLog( LOG_FATAL, "PTCL_MANAGER_ANSWER :: has received!!!(%d)", pSender->wPort );
				g_pServerTable->DestroyServer( FINISH_TYPE_UNKNOWN_ERROR);
			}
			break;
		// -----------------------------

		// Added by KBS 011012
		case PTCL_RM_FROM_PROXY:
			{
				RMProc(dwConnectionIndex, pMsg, dwLength);
			}
			break;
		//

		default:
			{
				MyLog( LOG_FATAL, "Unknown bID(%d) Received. From %s(wPort:%d) Size(%d) ConnectionID(%d)", bID, GetTypedServerText(pSender->dwServerType), pSender->wPort, dwLength, dwConnectionIndex);
	#ifdef __ON_DEBUG
	//			_asm int 3;
	#endif
			}
			break;
			
		}
	}
	__except(pException = GetExceptionInformation())//020508 lsw
	{
		//acer7
		DumpException( pException, "Exception Raised on HadleCommand()", pMsg, dwLength );
		ProcessEnd(FINISH_TYPE_UNKNOWN_ERROR);
	}