public Boolean OnCmdConnectNotify(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StConnectNotify ConnectNotify = new StConnectNotify(); ConnectNotify.Read(ReadHelper); Byte ConType = ConnectNotify.btConType; if (ConType == (Byte)ConnectionType.TYPE_SVR_PROXY) { ConnectNotify.btConType = (Byte)ConnectionType.TYPE_CLT_PLAYER; ConnectNotify.u64ConnID = m_u64ClientID; m_WriteHelper.BeginWrite((UInt16)Command_ID.CMD_CONNECT_NOTIFY, (Byte)CmdHandler_ID.CMDH_SVR_CON); ConnectNotify.Write(m_WriteHelper); m_WriteHelper.EndWrite(); SendData(m_WriteHelper.GetData(), (int)m_WriteHelper.GetDataLen()); StCharEnterGameReq CharEnterGameReq = new StCharEnterGameReq(); CharEnterGameReq.u64CharID = m_u64ClientID; CharEnterGameReq.dwIdentifyCode = m_dwIdentifyCode; m_WriteHelper.BeginWrite((UInt16)Command_ID.CMD_CHAR_ENTER_GAME_REQ, (Byte)CmdHandler_ID.CMDH_SENCE); CharEnterGameReq.Write(m_WriteHelper); m_WriteHelper.EndWrite(); SendData(m_WriteHelper.GetData(), (int)m_WriteHelper.GetDataLen()); } else if (ConType == (Byte)ConnectionType.TYPE_SVR_LOGIN) { SetConnectState(ConnectState.Succ_Connect); } return(true); }
public Boolean OnCmdHeartBeatAck(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StCharHeartBeatAck CharHeartBeatAck = new StCharHeartBeatAck(); CharHeartBeatAck.Read(ReadHelper); return(true); }
public override Boolean OnCommandHandle(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { switch (wCommandID) { case Command_ID.CMD_CHAR_LOGIN_ACK: { StCharLoginAck Ack = new StCharLoginAck(); Ack.Read(ReadHelper); } break; case Command_ID.CMD_CHAR_NEW_CHAR_ACK: { } break; case Command_ID.CMD_CHAR_DEL_CHAR_ACK: { } break; case Command_ID.CMD_CHAR_NEW_ACCOUNT_ACK: { UInt16 nRetCode = ReadHelper.ReadUint16(); } break; case Command_ID.CMD_CHAR_ENTER_GAME_ACK: { } break; case Command_ID.CMD_CHAR_NEARBY_ADD: { } break; case Command_ID.CMD_CHAR_NEARBY_UPDATE: { } break; case Command_ID.CMD_CHAR_NEARBY_REMOVE: { } break; default: { } break; } return true; }
public override Boolean OnCommandHandle(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { switch (wCommandID) { case Command_ID.CMD_CHAR_LOGIN_ACK: { StCharLoginAck Ack = new StCharLoginAck(); Ack.Read(ReadHelper); } break; case Command_ID.CMD_CHAR_NEW_CHAR_ACK: { } break; case Command_ID.CMD_CHAR_DEL_CHAR_ACK: { } break; case Command_ID.CMD_CHAR_NEW_ACCOUNT_ACK: { UInt16 nRetCode = ReadHelper.ReadUint16(); } break; case Command_ID.CMD_CHAR_ENTER_GAME_ACK: { } break; case Command_ID.CMD_CHAR_NEARBY_ADD: { } break; case Command_ID.CMD_CHAR_NEARBY_UPDATE: { } break; case Command_ID.CMD_CHAR_NEARBY_REMOVE: { } break; default: { } break; } return(true); }
public Boolean OnCmdPickCharAck(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StCharPickCharAck CharPickCharAck = new StCharPickCharAck(); CharPickCharAck.Read(ReadHelper); if (CharPickCharAck.nRetCode == 0) { DisConnect(); m_u64ClientID = CharPickCharAck.u64CharID; m_dwIdentifyCode = CharPickCharAck.dwIdentifyCode; m_WriteHelper.m_u64ClientID = CharPickCharAck.u64CharID; ConnectToServer(CharPickCharAck.szProxyIpAddr, CharPickCharAck.nProxyPort); } return(true); }
//浠ヤ笅鏄唴閮ㄧ殑娑堟伅澶勭悊 public Boolean OnCommandHandle(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { Boolean bHandled = false; switch (wCommandID) { case Command_ID.CMD_CONNECT_NOTIFY: { OnCmdConnectNotify(wCommandID, u64ConnID, ReadHelper); bHandled = true; } break; case Command_ID.CMD_CHAR_PICK_CHAR_ACK: { OnCmdPickCharAck(wCommandID, u64ConnID, ReadHelper); bHandled = true; } break; default: { foreach (MessageHandler h in m_MsghandlerList) { if (h.OnCommandHandle(wCommandID, u64ConnID, ReadHelper)) { bHandled = true; break; } } } break; } if (!bHandled) { Debug.Print("Message %d is not by handled!", wCommandID); } return(true); }
public abstract Boolean OnCommandHandle(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper);
//�������ڲ�����Ϣ���� public Boolean OnCommandHandle(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { Boolean bHandled = false; switch (wCommandID) { case Command_ID.CMD_CONNECT_NOTIFY: { OnCmdConnectNotify(wCommandID, u64ConnID, ReadHelper); bHandled = true; } break; case Command_ID.CMD_CHAR_PICK_CHAR_ACK: { OnCmdPickCharAck(wCommandID, u64ConnID, ReadHelper); bHandled = true; } break; default: { foreach (MessageHandler h in m_MsghandlerList) { if (h.OnCommandHandle(wCommandID, u64ConnID, ReadHelper)) { bHandled = true; break; } } } break; } if (!bHandled) { Debug.Print("Message %d is not by handled!", wCommandID); } return true; }
public Boolean OnCmdPickCharAck(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StCharPickCharAck CharPickCharAck = new StCharPickCharAck(); CharPickCharAck.Read(ReadHelper); if (CharPickCharAck.nRetCode == 0) { DisConnect(); m_u64ClientID = CharPickCharAck.u64CharID; m_dwIdentifyCode = CharPickCharAck.dwIdentifyCode; m_WriteHelper.m_u64ClientID = CharPickCharAck.u64CharID; ConnectToServer(CharPickCharAck.szIpAddr, CharPickCharAck.sPort); } return true; }
public Boolean OnCmdHeartBeatAck(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StCharHeartBeatAck CharHeartBeatAck = new StCharHeartBeatAck(); CharHeartBeatAck.Read(ReadHelper); return true; }
public Boolean OnCmdConnectNotify(Command_ID wCommandID, UInt64 u64ConnID, ReadBufferHelper ReadHelper) { StConnectNotify ConnectNotify = new StConnectNotify(); ConnectNotify.Read(ReadHelper); Byte ConType = ConnectNotify.btConType; ConnectNotify.btConType = (Byte)ConnectionType.TYPE_CLT_PLAYER; ConnectNotify.u64ConnID = m_u64ClientID; m_WriteHelper.BeginWrite((UInt16)Command_ID.CMD_CONNECT_NOTIFY, (Byte)CmdHandler_ID.CMDH_SVR_CON); ConnectNotify.Write(m_WriteHelper); m_WriteHelper.EndWrite(); SendData(m_WriteHelper.GetData(), (int)m_WriteHelper.GetDataLen()); if (ConType == (Byte)ConnectionType.TYPE_SVR_PROXY) { StCharEnterGameReq CharEnterGameReq = new StCharEnterGameReq(); CharEnterGameReq.u64CharID = m_u64ClientID; CharEnterGameReq.dwIdentifyCode = m_dwIdentifyCode; m_WriteHelper.BeginWrite((UInt16)Command_ID.CMD_CHAR_ENTER_GAME_REQ, (Byte)CmdHandler_ID.CMDH_SENCE); CharEnterGameReq.Write(m_WriteHelper); m_WriteHelper.EndWrite(); SendData(m_WriteHelper.GetData(), (int)m_WriteHelper.GetDataLen()); } else if (ConType == (Byte)ConnectionType.TYPE_SVR_LOGIN) { SetConnectState(ConnectState.Succ_Connect); } return true; }