1+ using Lagrange . Core . Common ;
2+ using Lagrange . Core . Common . Entity ;
3+ using Lagrange . Core . Internal . Event ;
4+ using Lagrange . Core . Internal . Event . Message ;
5+ using Lagrange . Core . Internal . Packets . Service . Oidb ;
6+ using Lagrange . Core . Internal . Packets . Service . Oidb . Request ;
7+ using Lagrange . Core . Utility . Extension ;
8+ using ProtoBuf ;
9+
10+ namespace Lagrange . Core . Internal . Service . Message ;
11+
12+ [ EventSubscribe ( typeof ( GetStrangerGroupInfoEvent ) ) ]
13+ [ Service ( "OidbSvcTrpcTcp.0x88d_110" ) ]
14+ internal class GetStrangerGroupInfoService : BaseService < GetStrangerGroupInfoEvent >
15+ {
16+ protected override bool Build ( GetStrangerGroupInfoEvent input , BotKeystore keystore , BotAppInfo appInfo ,
17+ BotDeviceInfo device , out Span < byte > output , out List < Memory < byte > > ? extraPackets )
18+ {
19+ var packet = new OidbSvcTrpcTcpBase < OidbSvcTrpcTcp0x88D > ( new OidbSvcTrpcTcp0x88D
20+ {
21+ Field1 = ( uint ) Random . Shared . NextInt64 ( ) ,
22+ Config = new OidbSvcTrpcTcp0x88DConfig
23+ {
24+ Uin = input . Uin ,
25+ Flags = new OidbSvcTrpcTcp0x88DFlags
26+ {
27+ CreateTime = true ,
28+ MaxMemberCount = true ,
29+ MemberCount = true ,
30+ Name = "" ,
31+ Uin = true ,
32+ }
33+ }
34+ } , 0x88d , 110 ) ;
35+
36+ output = packet . Serialize ( ) ;
37+ extraPackets = null ;
38+ return true ;
39+ }
40+
41+ protected override bool Parse ( Span < byte > input , BotKeystore keystore , BotAppInfo appInfo , BotDeviceInfo device ,
42+ out GetStrangerGroupInfoEvent output , out List < ProtocolEvent > ? extraEvents )
43+ {
44+ var payload = Serializer . Deserialize < OidbSvcTrpcTcpBase < OidbSvcTrpcTcp0x88D_0Response > > ( input ) ;
45+
46+ if ( payload . ErrorCode == 0 )
47+ {
48+ output = GetStrangerGroupInfoEvent . Result ( 0 , null , new BotStrangerGroupInfo
49+ {
50+ CreateTime = payload . Body . GroupInfo . Results . CreateTime ,
51+ MaxMemberCount = payload . Body . GroupInfo . Results . MaxMemberCount ,
52+ MemberCount = payload . Body . GroupInfo . Results . MemberCount ,
53+ Name = payload . Body . GroupInfo . Results . Name ,
54+ Uin = payload . Body . GroupInfo . Results . Uin ,
55+ } ) ;
56+ }
57+ else
58+ {
59+ output = GetStrangerGroupInfoEvent . Result ( ( int ) payload . ErrorCode , payload . ErrorMsg , new ( ) ) ;
60+ }
61+ extraEvents = null ;
62+ return true ;
63+ }
64+ }
0 commit comments