Skip to content

Commit 6818d39

Browse files
committed
[Core] Change Login Logic for Watch
1 parent f0977ac commit 6818d39

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

Lagrange.Core/Internal/Logic/WtExchangeLogic.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ public async Task<bool> Logout()
118118

119119
private async Task<bool> ManualLogin(long uin, string? password)
120120
{
121-
if (string.IsNullOrEmpty(password) && _context.Config.Protocol.IsAndroid())
121+
if (string.IsNullOrEmpty(password) && (_context.Config.Protocol.IsAndroid() && _context.Config.Protocol is not Protocols.AndroidWatch)) // watch can use QRLogin
122122
{
123-
_context.LogCritical(Tag, "Android Platform can not use QRLogin, Please fill in password");
123+
_context.LogCritical(Tag, "Android Platform (except AndroidWatch) can not use QRLogin, Please fill in password");
124124
return false;
125125
}
126126

@@ -135,6 +135,12 @@ private async Task<bool> ManualLogin(long uin, string? password)
135135
}
136136
else
137137
{
138+
if (_context.Config.Protocol is Protocols.AndroidWatch)
139+
{
140+
_context.LogError(Tag, "AndroidWatch can not use password login");
141+
return false;
142+
}
143+
138144
_context.LogInfo(Tag, "Password is filled, try to login");
139145

140146
return _context.Config.Protocol.IsAndroid()

Lagrange.Core/Internal/Services/Login/TransEmpService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
namespace Lagrange.Core.Internal.Services.Login;
1010

11-
[EventSubscribe<TransEmp31EventReq>(Protocols.PC)]
12-
[EventSubscribe<TransEmp12EventReq>(Protocols.PC)]
11+
[EventSubscribe<TransEmp31EventReq>(Protocols.PC | Protocols.AndroidWatch)]
12+
[EventSubscribe<TransEmp12EventReq>(Protocols.PC | Protocols.AndroidWatch)]
1313
[Service("wtlogin.trans_emp", RequestType.D2Auth, EncryptType.EncryptEmpty)]
1414
internal class TransEmpService : BaseService<ProtocolEvent, ProtocolEvent>
1515
{

0 commit comments

Comments
 (0)