Skip to content

Commit

Permalink
加上const修饰符
Browse files Browse the repository at this point in the history
git-svn-id: http://subversion.assembla.com/svn/vnoc/trunk@254 36a5fca6-8feb-4701-ac75-490187a78786
  • Loading branch information
sumxxx committed Jun 13, 2012
1 parent 09ae463 commit 1e9fb51
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
22 changes: 11 additions & 11 deletions Message/MsgDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ byte* MSG_RVC::GetMachineAddress() const
return (byte*)(m_ComCommandList[0].data());
}

void MSG_RVC::SetMachineAddress( byte* in_byte_ptr, size_t len )
void MSG_RVC::SetMachineAddress(const byte* in_byte_ptr, size_t len )
{
if (in_byte_ptr == NULL)
{
Expand Down Expand Up @@ -426,7 +426,7 @@ void MSG_AVC::SetCaptchaType(byte in_byte)
m_ComCommandList[1].push_back(in_byte);
}

void MSG_AVC::SetCaptcha(byte* in_byte_ptr,size_t len)
void MSG_AVC::SetCaptcha(const byte* in_byte_ptr,size_t len)
{
if (in_byte_ptr == NULL)
{
Expand Down Expand Up @@ -497,7 +497,7 @@ byte* MSG_RLI::GetPassword() const
return (byte*)(m_ComCommandList[0].data());
}

void MSG_RLI::SetVerificationCode( byte* in_byte_ptr,size_t len )
void MSG_RLI::SetVerificationCode(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand All @@ -512,7 +512,7 @@ void MSG_RLI::SetVerificationCode( byte* in_byte_ptr,size_t len )
}
}

void MSG_RLI::SetAccountNumber( byte* in_byte_ptr,size_t len )
void MSG_RLI::SetAccountNumber(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand All @@ -527,7 +527,7 @@ void MSG_RLI::SetAccountNumber( byte* in_byte_ptr,size_t len )
}
}

void MSG_RLI::SetPassword( byte* in_byte_ptr,size_t len )
void MSG_RLI::SetPassword(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand Down Expand Up @@ -605,7 +605,7 @@ void MSG_ALI::SetLoginResult( byte in_byte )
m_ComCommandList[2].push_back(in_byte);
}

void MSG_ALI::SetToken( byte* in_byte_ptr, size_t len /*= 4*/)
void MSG_ALI::SetToken(const byte* in_byte_ptr, size_t len /*= 4*/)
{
if (in_byte_ptr == NULL)
{
Expand All @@ -620,7 +620,7 @@ void MSG_ALI::SetToken( byte* in_byte_ptr, size_t len /*= 4*/)
}
}

void MSG_ALI::SetATLGUID( byte* in_byte_ptr, size_t len /*= 16*/ )
void MSG_ALI::SetATLGUID(const byte* in_byte_ptr, size_t len /*= 16*/ )
{
if (in_byte_ptr == NULL)
{
Expand Down Expand Up @@ -722,7 +722,7 @@ void MSG_RPS::SetRank( byte in_byte )
}


void MSG_RPS::SetNickname( byte* in_byte_ptr,size_t len )
void MSG_RPS::SetNickname(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand All @@ -738,7 +738,7 @@ void MSG_RPS::SetNickname( byte* in_byte_ptr,size_t len )
}


void MSG_RPS::SetAutograph( byte* in_byte_ptr,size_t len )
void MSG_RPS::SetAutograph(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand All @@ -760,7 +760,7 @@ void MSG_RPS::SetHeadForm( byte in_byte )
m_ComCommandList[1].push_back(in_byte);
}

void MSG_RPS::SetHeadPortrait( byte* in_byte_ptr,size_t len )
void MSG_RPS::SetHeadPortrait(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand Down Expand Up @@ -812,7 +812,7 @@ byte* MSG_APS::GetMessageSynchro() const
return (byte*)(m_ComCommandList[0].data());
}

void MSG_APS::SetMessageSynchro( byte* in_byte_ptr,size_t len )
void MSG_APS::SetMessageSynchro(const byte* in_byte_ptr,size_t len )
{
if (in_byte_ptr == NULL)
{
Expand Down
22 changes: 11 additions & 11 deletions Message/MsgDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MSG_RVC: public CMessage
//机器地址
byte* GetMachineAddress() const;

void SetMachineAddress(byte* in_byte_ptr, size_t len);
void SetMachineAddress(const byte* in_byte_ptr, size_t len);

int GetMachineAddressLen()const{
return m_MachineAddressLen;
Expand Down Expand Up @@ -284,7 +284,7 @@ class MSG_AVC: public CMessage

void SetCaptchaType(byte in_byte);

void SetCaptcha(byte* in_byte_ptr,size_t len);
void SetCaptcha(const byte* in_byte_ptr,size_t len);


//
Expand Down Expand Up @@ -349,11 +349,11 @@ class MSG_RLI:public CMessage
byte* GetPassword() const;


void SetVerificationCode(byte* in_byte_ptr,size_t len);
void SetVerificationCode(const byte* in_byte_ptr,size_t len);

void SetAccountNumber(byte* in_byte_ptr,size_t len);
void SetAccountNumber(const byte* in_byte_ptr,size_t len);

void SetPassword(byte* in_byte_ptr,size_t len);
void SetPassword(const byte* in_byte_ptr,size_t len);


int GetVerificationCodeLen() const{
Expand Down Expand Up @@ -426,9 +426,9 @@ class MSG_ALI:public CMessage

void SetLoginResult(byte in_byte);

void SetToken(byte* in_byte_ptr,size_t len = 4);
void SetToken(const byte* in_byte_ptr,size_t len = 4);

void SetATLGUID(byte* in_byte_ptr, size_t len = 16);
void SetATLGUID(const byte* in_byte_ptr, size_t len = 16);


int GetATLGUIDLen() const{
Expand Down Expand Up @@ -502,13 +502,13 @@ class MSG_RPS:public CMessage

void SetRank(byte in_byte);

void SetNickname(byte* in_byte_ptr,size_t len);
void SetNickname(const byte* in_byte_ptr,size_t len);

void SetAutograph(byte* in_byte_ptr,size_t len);
void SetAutograph(const byte* in_byte_ptr,size_t len);

void SetHeadForm(byte in_byte);

void SetHeadPortrait(byte* in_byte_ptr,size_t len);
void SetHeadPortrait(const byte* in_byte_ptr,size_t len);


int GetNicknameLen() const{
Expand Down Expand Up @@ -575,7 +575,7 @@ class MSG_APS:public CMessage
//个人信息同步通知
byte* GetMessageSynchro() const;

void SetMessageSynchro(byte* in_byte_ptr,size_t len);
void SetMessageSynchro(const byte* in_byte_ptr,size_t len);

int GetMessageSynchroLen() const{
return m_MessageSynchroLen;
Expand Down
10 changes: 3 additions & 7 deletions VNOC/VNOC/VNOCLoginDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,9 @@ void CVNOCLoginDlg::OnBnClickedOk()
ATLASSERT(pInet);
if (pInet)
{
byte Name[MAX_NAME_LEN] = {0};
byte Password[MAX_PASSWORD_LEN] = {0};
memcpy(Password,(LPCTSTR)m_strPassword,lstrlen((LPCTSTR)m_strPassword )*(sizeof(TCHAR))+1);
memcpy(Name,(LPCTSTR)m_strUsername,lstrlen((LPCTSTR)m_strUsername)*(sizeof(TCHAR))+1);
MSG_RLI mRli;
mRli.SetAccountNumber(Name,lstrlen((LPCTSTR)m_strUsername)*(sizeof(TCHAR))+1);
mRli.SetPassword(Password,lstrlen((LPCTSTR)m_strUsername)*(sizeof(TCHAR))+1);
mRli.SetAccountNumber((const byte*)(LPCTSTR)m_strUsername,m_strUsername.GetLength()*sizeof(TCHAR));
mRli.SetPassword((const byte*)(LPCTSTR)m_strPassword,m_strUsername.GetLength()*sizeof(TCHAR));
pInet->SendServer(mRli);
//mRli.SetVerificationCode()
_SetVerifyState(TRUE);
Expand Down Expand Up @@ -163,7 +159,7 @@ BOOL CVNOCLoginDlg::Refresh()
HRESULT CVNOCLoginDlg::OnMessage( const CMessage& msg )
{
Global->Log(LogFile_Net,_T("接收到网络包"));
if (msg.GetMessageType() == MSG_AVC_TYPE)
if (msg.GetMessageType() == MSG_ALI_TYPE)
{
const MSG_ALI* ma = dynamic_cast<const MSG_ALI*>(&msg);
if (ma->GetLoginResult() == 1)
Expand Down

0 comments on commit 1e9fb51

Please sign in to comment.