Skip to content

Commit

Permalink
<提交LOG>
Browse files Browse the repository at this point in the history
  • Loading branch information
vnoc-YeZi committed Sep 16, 2012
1 parent 1719533 commit 29a5a77
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
20 changes: 0 additions & 20 deletions MessageAutoDispose/MessageAutoDispose/MessageAutoDispose.sln.old

This file was deleted.

Binary file not shown.
8 changes: 8 additions & 0 deletions NetService/src/RliMessageHandler.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "VnocProtocol.hpp"
#include "UserManage.hpp"
#include <ezlogger_headers.hpp>

class RliMessageHandler : public IMessageHandler
{
Expand All @@ -9,24 +10,31 @@ class RliMessageHandler : public IMessageHandler
{
protocol_->RegisterMessageHandler(this);
}

virtual MSGTYPE getMessageType() const
{
return MSG_RLI_TYPE;
}

virtual int operator()(const CMessage *msg, MessageContext *ctx)
{
MSG_ALI aliMessage;
const MSG_RLI * rliMessage = dynamic_cast<const MSG_RLI *>(msg);
userinfo UserInfo = {0};

if (CUserManage::GetInstance()->Authenticate((char*)rliMessage->GetAccountNumber(), (char*)rliMessage->GetPassword(), &UserInfo) == LOGIN_OK)
{
aliMessage.SetLoginResult(0); //µÇ½³É¹¦
EZLOGGERVLSTREAM(axter::log_often)<<"Login successfully."<<endl;
}
else
{
aliMessage.SetLoginResult(1);//ʧ°Ü
EZLOGGERVLSTREAM(axter::log_often)<<"Login error."<<endl;
}

protocol_->SendVnocMessage(&aliMessage, ctx);
EZLOGGERVLSTREAM(axter::log_often)<<"Server has sended Ali to client."<<endl;
return 1;
}
private:
Expand Down
5 changes: 5 additions & 0 deletions NetService/src/RvcMessageHandler.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include "VnocProtocol.hpp"
#include <ezlogger_headers.hpp>

class RvcMessageHandler: public IMessageHandler
{
Expand All @@ -8,10 +9,12 @@ class RvcMessageHandler: public IMessageHandler
{
protocol_->RegisterMessageHandler(this);
}

virtual MSGTYPE getMessageType() const
{
return MSG_RVC_TYPE;
}

virtual int operator()(const CMessage *msg, MessageContext *ctx)
{
MSG_AVC avcMessage;
Expand All @@ -20,8 +23,10 @@ class RvcMessageHandler: public IMessageHandler
avcMessage.SetCaptcha(captcha,sizeof(captcha));
avcMessage.SetLoginTag(1);
protocol_->SendVnocMessage(&avcMessage, ctx);
EZLOGGERVLSTREAM(axter::log_often)<<"Server has sended Rvc to client."<<endl;
return 1;
}

private:
VnocProtocol *protocol_;
};

0 comments on commit 29a5a77

Please sign in to comment.