示例#1
0
void	DBAgentSession::OnRecv(void *pMsg, INT16 nSize)
{
	ENTER_FUNCTION_FOXNET
		MsgHead* pHead = (MsgHead*)pMsg;
	PackCommon* pPack = g_SvrPackMgr.AllocPack(pHead->GetMsgID());
	if (!pPack)
	{
		return;
	}

	ReadBuf read((UINT8*)pMsg, nSize);
	pPack->UnPack(read);

	switch (pHead->GetMsgID())
	{
	case eSvrMsg_CheckLogin_DBSvr:
	{

	}
		break;
	default:
		g_SvrPackMgr.Free(pPack);
		break;
	};
	LEAVE_FUNCTION_FOXNET
}
示例#2
0
void CClientMsgParser::proc_message(const message_t& msg, CProtoSocket* p)
{
    unsigned short totalsize = *((unsigned short*)msg.data);
    unsigned short headsize = *((unsigned short*)msg.data + 1);
    unsigned short mark = 2 * sizeof(unsigned short);
    MsgHead Msghead;
    Msghead.ParseFromArray(msg.data + mark, headsize);
    unsigned short msgBodyBegin = mark + headsize;
    switch(Msghead.type())
    {
    case G2C_LoginMacACK:
    {
        MsgG2CLoginMacACK Msg;
        Msg.ParseFromArray(msg.data + msgBodyBegin, Msghead.msgsize());
        MyLog::log->notice("MsgG2CLoginMacACK receive account[%l]", Msg.account());

    }
    break;
    case G2C_MsgG2CErrorACK:
    {
        MsgG2CErrorACK Msg;
        Msg.ParseFromArray(msg.data + msgBodyBegin, Msghead.msgsize());
        switch(Msg.en())
        {
        case MsgG2CErrorACK_enResult_LG_ALREADYLOGIN:
        {
            MyLog::log->notice("you are already login");
        }
        break;
        }
    }
    break;

    }
}
示例#3
0
void CClientMsgParser::proc_message(const message_t& msg, CProtoSocket* p)
{
	unsigned short totalsize = *((unsigned short*)msg.data);
	//unsigned short headsize = *((unsigned short*)msg.data + 1);
	unsigned short mark = sizeof(unsigned short);
	MsgHead Msghead;
	Msghead.ParseFromArray(msg.data + mark, totalsize);
	//unsigned short msgBodyBegin = mark + headsize;
	switch(Msghead.type())
	{
	//case G2C_LoginMacACK:
	//	{
	//		MsgG2CLoginMacACK Msg;
	//		Msg.ParseFromString(Msghead.body());
	//		MyLog::log->notice("MsgG2CLoginMacACK receive account[%lu]", Msg.account());
	//		account = Msg.account();

	//	}
	//	break;
	case G2C_MsgG2CErrorACK:
		{
			MsgG2CErrorACK Msg;
			Msg.ParseFromString(Msghead.body());
			MyLog::log->notice("recive message [MsgG2CErrorACK] ");
			switch(Msg.en())
			{
			case MsgG2CErrorACK_enResult_LG_ALREADYLOGIN:
				{
					MyLog::log->notice("you are already login");
				}
				break;
			}
		}
		break;
	case LG2C_MsgBindMailACK:
		{
			MsgLG2GateBindACK Msg;
			Msg.ParseFromString(Msghead.body());
			switch(Msg.entype())
			{
			case TypeBindLogic_BindMail:
				{
					MyLog::log->notice("recive message [LG2C_MsgBindMailACK_TypeBindLogic_BindMail]");
				}
				break;
			case TypeBindLogic_UnbindMac:
				{
					MyLog::log->notice("recive message [LG2C_MsgBindMailACK_TypeBindLogic_UnbindMac]");
				}
				break;
			case TypeBindLogic_BindMac:
				{
					MyLog::log->notice("recive message [LG2C_MsgBindMailACK_TypeBindLogic_BindMac]");
				}
				break;
			}

			MyLog::log->notice("recive message [LG2C_MsgBindMailACK]");

		}
		break;

	}
}