未注册时采用系统名称,Key里面包含机器码

This commit is contained in:
Stone 2016-06-06 10:00:34 +00:00
parent 311e3bf02a
commit c83d4fe449
2 changed files with 13 additions and 0 deletions

View File

@ -235,6 +235,12 @@ void TokenClient::SayHello(bool broadcast)
ext.Cipher = "RC4";
ext.Name = Cfg->User();
// 未注册时采用系统名称
if(!ext.Name)
{
ext.Name = Sys.Name;
ext.Key = Buffer(Sys.ID, 16);
}
ext.WriteMessage(msg);
ext.Show(true);
@ -326,6 +332,12 @@ bool TokenClient::OnLocalHello(TokenMessage& msg, TokenController* ctrl)
ext2.Cipher = "RC4";
ext2.Name = Cfg->User();
// 未注册时采用系统名称
if(!ext2.Name)
{
ext2.Name = Sys.Name;
ext2.Key = Buffer(Sys.ID, 16);
}
// 使用当前时间
ext2.LocalTime = DateTime::Now().TotalMs();

View File

@ -83,6 +83,7 @@ void TokenController::Open()
{
if (Opened) return;
assert(Socket, "还没有Socket呢");
if(!Port) Port = dynamic_cast<ITransport*>(Socket);
assert(Port, "还没有传输口呢");