-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathdao.py
2537 lines (2078 loc) · 79.5 KB
/
dao.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from __future__ import annotations
from datetime import datetime, timedelta
from data_struct import ConfigInterface, to_raw_type
class DaoObject:
def __repr__(self):
return str(self.__dict__)
class GameInfo(DaoObject):
def __init__(self, data: dict):
self.bizName = data["bizName"]
self.bizCode = data["bizCode"]
self.gameCode = data["gameCode"]
self.wxAppid = data["wxAppid"]
self.type = data["type"]
def is_mobile_game(self):
return self.type == "1"
class GameRoleInfo(ConfigInterface):
def __init__(self):
self.sBizCode = "jx3"
self.sOpenId = ""
self.sRoleInfo = RoleInfo()
self.dtUpdateTime = "2020-08-23 06:38:04"
def is_mobile_game(self):
return self.sRoleInfo.type == "1"
class RoleInfo(ConfigInterface):
def __init__(self):
# 端游
# dnf
self.roleCode = "71672841"
self.roleName = "风之凌殇呀"
self.systemKey = ""
self.systemID = "1"
self.serviceID = "11"
self.serviceName = "浙江一区"
self.channelName = ""
self.channelID = ""
self.channelKey = ""
self.areaName = "浙江"
self.areaID = "30"
self.gameName = "地下城与勇士"
self.bizCode = "dnf"
self.showAreaName = ""
self.accountId = "71672841"
self.type = "0"
self.isHasService = "1"
# 命运方舟
# self.roleCode = "5000000000004678510"
# self.roleName = "风之凌殇"
# self.systemKey = "pc"
# self.systemID = "2"
# self.serviceID = ""
# self.serviceName = "卢佩恩"
# self.channelName = "卢佩恩"
# self.channelID = "50"
# self.channelKey = ""
# self.areaName = "卡丹"
# self.areaID = "4"
# self.gameName = "命运方舟"
# self.bizCode = "fz"
# self.showAreaName = "卡丹"
# self.type = 0
# self.isHasService = 0
self.version = 3
self.area = "50"
self.platid = "2"
self.partition = "4"
# 手游
# self.roleCode = "2814890504594928763"
# self.roleName = "风之凌殇"
# self.systemKey = "android"
# self.systemID = "1"
# self.serviceID = "20001"
# self.serviceName = "梦江南"
# self.channelName = "手Q"
# self.channelID = "2"
# self.channelKey = "qq"
# self.areaName = "梦江南"
# self.areaID = "20001"
# self.gameName = "剑网3:指尖江湖"
# self.bizCode = "jx3"
# self.showAreaName = ""
# self.accountId = "2814890504594928763"
# self.type = "1"
# self.isHasService = "0"
def clone(self) -> RoleInfo:
return RoleInfo().auto_update_config(to_raw_type(self))
class TemporaryChangeBindRoleInfo(ConfigInterface):
def __init__(self):
self.roleCode = "71672841"
self.serviceID = "11"
class GoodsInfo(ConfigInterface):
def __init__(self):
self.type = "3"
self.actId = "3"
self.propId = "24074"
self.propName = "曜-云鹰飞将"
self.busId = "yxzj"
self.propDesc = ""
self.propImg = "http://ossweb-img.qq.com/images/daoju/app/yxzj/rectangle/13-52202-0-r684.jpg?_t=1596187484"
self.propImg2 = ""
self.propVideoId = ""
self.propCoverId = ""
self.limitPerOrder = "1"
self.totalLimit = "0"
self.recommend = "80"
self.valiDate: list[GoodsValiDateInfo] = []
self.heroSkin = []
self.related = False
self.category = GoodsCategoryInfo()
self.isCombinPkg = 0
self.IsOwn = 0
def fields_to_fill(self):
return [
("valiDate", GoodsValiDateInfo),
]
class GoodsValiDateInfo(ConfigInterface):
def __init__(self):
self.day = "永久"
self.name = "曜-云鹰飞将"
self.pic = "http://ossweb-img.qq.com/images/daoju/app/yxzj/rectangle/13-52202-0-r684.jpg?_t=1596187484"
self.picMid = None
self.code = "24074"
self.gameCode = "52202"
self.sendType = 13
self.oldPrice = "16880"
self.curPrice = "16880"
self.iGoldPrice = "0"
self.iDqPrice = "16880"
self.rushBegin = "0000-00-00 00:00:00"
self.rushEnd = "0000-00-00 00:00:00"
self.isMobile = 0
self.waterMark = 0
self.label = ""
self.rushPrice = 0
self.gold_price_rush = 0
self.dq_price_rush = 0
self.twin_price = 0
self.twin_dq_price = 0
self.twin_code = ""
self.isskin = 0
self.left = "0"
self.bought = "0"
self.todayBought = 0
self.award: dict[str, list] = {"list": []}
self.isFunc = 0
self.beanCut = 0
self.maxBeanCutPrice = 0
self.maxBeanCutNum = 0
self.beanRush = 0
self.beanBegin = "0000-00-00 00:00:00"
self.beanEnd = "0000-00-00 00:00:00"
self.acctPlat = "0"
self.supportPresent = "1"
self.supportCart = "1"
self.pinPrice = 0
self.pinDqPrice = 0
self.pinBegin = "0000-00-00 00:00:00"
self.pinEnd = "0000-00-00 00:00:00"
class GoodsCategoryInfo(ConfigInterface):
def __init__(self):
self.mainCategory = "170"
self.subCategory = "0"
class DnfRoleInfoList(ConfigInterface):
def __init__(self):
self.role_list: list[DnfRoleInfo] = []
def fields_to_fill(self):
return [
("role_list", DnfRoleInfo),
]
class DnfRoleInfo(ConfigInterface):
def __init__(self):
self.roleid = "0"
self.rolename = "风之凌殇"
# 已知:0-男鬼剑,3-女魔法师,13-男枪士,14-女圣职者
self.forceid = 0
self.level = 110
def update_params(self, roleid: str, rolename: str, forceid: str, level: str):
self.roleid = str(roleid)
self.rolename = str(rolename)
self.forceid = int(forceid)
self.level = int(level)
def get_force_name(self) -> str:
force_id_to_name = {
0: "鬼剑士(男)",
1: "格斗家(女)",
2: "神枪手(男)",
3: "魔法师(女)",
4: "圣职者(男)",
5: "神枪手(女)",
6: "暗夜使者",
7: "格斗家(男)",
8: "魔法师(男)",
9: "黑暗武士",
10: "缔造者",
11: "鬼剑士(女)",
12: "守护者",
13: "魔枪士",
14: "圣职者(女)",
15: "枪剑士",
}
if self.forceid not in force_id_to_name:
return str(self.forceid)
return force_id_to_name[self.forceid]
class MobileGameRoleInfo(DaoObject):
def __init__(self, roleid, rolename):
self.roleid = roleid
self.rolename = rolename
class MobileGameGiftInfo(DaoObject):
def __init__(self, sTask, iRuleId):
self.sTask = sTask
self.iRuleId = iRuleId
class UpdateInfo(DaoObject):
def __init__(self):
self.latest_version = ""
self.netdisk_link = ""
self.netdisk_passcode = ""
self.update_message = ""
XIN_YUE_MIN_LEVEL = 3
class XinYueInfo(DaoObject):
SPECIAL_MEMBER_LEVEL = 10
level_to_name = {
1: "游戏家",
2: "游戏家PRO",
3: "心悦VIP1",
4: "心悦VIP2",
5: "心悦VIP3",
6: "心悦VIP4",
7: "心悦VIP5",
SPECIAL_MEMBER_LEVEL: "特邀会员",
}
def __init__(self):
# 等级含义见上述描述
self.xytype = 1
self.xytype_str = "获取失败"
# 特邀会员
self.is_special_member = False
# 勇士币
self.ysb = 0
# 成就点
self.score = 0
# 抽奖券
self.ticket = 0
# 用户名
self.username = ""
# 头像框地址
self.usericon = ""
# 登录QQ
self.login_qq = ""
# ------------- 赛利亚打工相关信息 -------------
# 工作状态(-2:摸鱼状态,1:可以领取工资, 2: 打工人搬砖中)
self.work_status = -2
# 工作结束时间(unix时间戳,0时表示摸鱼状态)
self.work_end_time = 0
# 领取奖励结束时间
self.take_award_end_time = 0
def work_info(self) -> str:
if self.work_status == -2:
return "摸鱼中"
elif self.work_status == 1:
return "坐等领工资"
else:
return "打工仔搬砖中"
def is_xinyue_or_special_member(self) -> bool:
return self.xytype >= XIN_YUE_MIN_LEVEL or self.is_special_member
def is_xinyue_level(self, *levels: int) -> bool:
for level in levels:
if self.xytype == XIN_YUE_MIN_LEVEL + level - 1:
return True
return False
class XinYueItemInfo(DaoObject):
def __init__(
self,
total_obtain_two_score,
used_two_score,
total_obtain_free_do,
used_free_do,
total_obtain_refresh,
used_refresh,
):
# 免做卡
self.免做卡 = int(total_obtain_free_do) - int(used_free_do)
# 双倍卡
self.双倍卡 = int(total_obtain_two_score) - int(used_two_score)
# 免做卡
self.刷新卡 = int(total_obtain_refresh) - int(used_refresh)
# 总计获得的双倍卡
self.total_obtain_two_score = total_obtain_two_score
# 已使用的双倍卡
self.used_two_score = used_two_score
# 总计获得的免做卡
self.total_obtain_free_do = total_obtain_free_do
# 已使用的免做卡
self.used_free_do = used_free_do
# 总计获得的刷新卡
self.total_obtain_refresh = total_obtain_refresh
# 已使用的刷新卡
self.used_refresh = used_refresh
class XinYueMyTeamInfo(ConfigInterface):
def __init__(self):
self.ret = 0
self.num = 0
self.list: list[XinYueTeamMember] = []
self.teamAllOpenId = "" # "1054073896,qq_2"
# self.result = 0
# self.id = "" # note:新版的这个id需要通过查询 131104(自己队伍ID) 来获取
# self.award_summary = "大大小|小中大"
# self.members: list[XinYueTeamMember] = []
def fields_to_fill(self):
return [
("list", XinYueTeamMember),
]
def is_team_full(self) -> bool:
return self.num == 2
class XinYueTeamMember(ConfigInterface):
def __init__(self):
self.activityId = "15488"
self.teamId = 166396
self.isCaptain = 1
self.avatar = "http://thirdqq.qlogo.cn/ek_qqapp/AQWLTKahHNrg5aEvmT7Y1ySCaia3aCJmJjicmcib1xYGR85uY9jTCAeNiaIHhHCAPYtApfXdoBMQ/40"
self.nickName = "%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87"
self.uid = "1054073896"
self.role = {
"area_id": 11,
"partition_id": 11,
"role_id": "71672841",
"role_name": "",
"plat_id": 2,
"game_openid": "1054073896",
"g_openid": "",
"game_appid": "",
"device": "pc",
}
# self.headurl = "http://thirdqq.qlogo.cn/g?b=oidb&k=KJKNiasFOwe0EGjTyHI7CLg&s=640&t=1556481203"
# self.nickname = "%E6%9C%88%E4%B9%8B%E7%8E%84%E6%AE%87"
# self.qq = ""
# self.captain = 0
# self.pak = ""
# self.code = ""
class XinYueSummaryTeamInfo(ConfigInterface):
def __init__(self):
self.teamCode = "DNF_TEAM_NOT_FOUND"
self.teamName = "%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87"
self.teamLimit = 2
self.teamMemberNum = 2
class SailiyamWorkInfo(ConfigInterface):
def __init__(self):
self.startTime = 0
self.endTime = 0
self.endLQtime = 0
self.iPackageId = "2168441"
self.status = 0
self.nowtime = 0
class AmesvrCommonModRet(ConfigInterface):
def __init__(self):
self.iRet = "0"
self.sMsg = "SUC"
self.sOutValue1 = ""
self.sOutValue2 = ""
self.sOutValue3 = ""
self.sOutValue4 = ""
self.sOutValue5 = ""
self.sOutValue6 = ""
self.sOutValue7 = ""
self.sOutValue8 = ""
def parse_amesvr_common_info(res) -> AmesvrCommonModRet:
return AmesvrCommonModRet().auto_update_config(res["modRet"])
class AmesvrUserBindInfo(ConfigInterface):
def __init__(self):
self.Fid = "7179"
self.Fuin = "1054073896"
self.FnickName = ""
self.FplatId = ""
self.Ffarea = "0"
self.Farea = "11"
self.FareaName = "%E6%B5%99%E6%B1%9F%E4%B8%80%E5%8C%BA"
self.FPartition = "11"
self.Fsex = "11"
self.FroleId = "71672841"
self.FroleName = "%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87%E5%91%80"
self.FroleLevel = "100"
self.Fcheckparam = (
"dnf|yes|1054073896|11|45168567*45230145*45481100*62889873*64327847*64327855*64333408*64333413*64349521*64349525*64370730*64370732*64632622*64632641*69837948*69837951*71672841*||||%E9%A3%8E%E4%B9%8B%E5%87%8C%E6"
"%AE%87*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87%E5%96%B5*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87%E5%93%87*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87Meow*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E4%B8%80%E5%8F%B7*%E5%8D%A2%E5%8"
"5%8B%E5%A5%B6%E5%A6%88%E4%BA%8C%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E4%B8%89%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E5%9B%9B%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E4%BA%94%E5%8F%B7*%E5"
"%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E5%85%AD%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E4%B8%83%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E5%85%AB%E5%8F%B7*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87%E5%96%B5%E"
"5%96%B5*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87%E5%96%B5%E5%91%9C*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E4%B9%9D%E5%8F%B7*%E5%8D%A2%E5%85%8B%E5%A5%B6%E5%A6%88%E5%8D%81%E5%8F%B7*%E9%A3%8E%E4%B9%8B%E5%87%8C%E6%AE%87"
"%E5%91%80*|0*3*13*14*14*14*14*14*14*14*14*14*3*3*14*14*11*||1600743086|"
)
self.Fmd5str = "FDAF0B1B1E51111CCC0AAD240317E96F"
self.Fdate = "2020-09-22 10:51:29"
self.FupdateDate = "2020-09-22 10:51:29"
self.sAmsNewRoleId = ""
self.sAmsSerial = "AMS-DNF-0922105129-ng2JeR-215651-558226"
class AmesvrQueryRole(ConfigInterface):
def __init__(self):
self.version = "V1.0.20201105.20201105101730"
self.retCode = "0"
self.serial_num = "AMS-DNF-1220171837-4zFGHv-348623-5381"
self.data = (
"_idip_req_id_=&_webplat_msg=21|45168567 风之凌殇 0 100|45230145 风之凌殇喵 3 100|45481100 风之凌殇哇 13 100|62889873 风之凌殇Meow 14 100|64327847 卢克奶妈一号 14 100|64327855 卢克奶妈二号 14 100|64333408 卢克奶妈三号 14 100"
"|64333413 卢克奶妈四号 14 100|64349521 卢克奶妈五号 14 100|64349525 卢克奶妈六号 14 100|64370730 卢克奶妈七号 14 100|64370732 卢克奶妈八号 14 100|64632622 风之凌殇喵喵 3 100|64632641 风之凌殇喵呜 3 100|69837948 卢克奶妈九号 1"
"4 100|69837951 卢克奶妈十号 14 100|71672841 风之凌殇呀 11 100|72282733 风之凌殇哦 4 100|72522431 风之凌殇咯 3 100|72574316 风之凌殇咩 3 100|72767454 风之凌殇嘿 3 100|&_webplat_msg_code=0&area=11&msg=21|45168567 风之凌殇 0 "
"100|45230145 风之凌殇喵 3 100|45481100 风之凌殇哇 13 100|62889873 风之凌殇Meow 14 100|64327847 卢克奶妈一号 14 100|64327855 卢克奶妈二号 14 100|64333408 卢克奶妈三号 14 100|64333413 卢克奶妈四号 14 100|64349521 卢克奶妈五号 "
"14 100|64349525 卢克奶妈六号 14 100|64370730 卢克奶妈七号 14 100|64370732 卢克奶妈八号 14 100|64632622 风之凌殇喵喵 3 100|64632641 风之凌殇喵呜 3 100|69837948 卢克奶妈九号 14 100|69837951 卢克奶妈十号 14 100|71672841 风之凌殇"
"呀 11 100|72282733 风之凌殇哦 4 100|72522431 风之凌殇咯 3 100|72574316 风之凌殇咩 3 100|72767454 风之凌殇嘿 3 100|&result=0&uin=1054073896&"
)
self.msg = "success"
self.checkparam = (
"dnf|yes|1054073896|11|45168567*45230145*45481100*62889873*64327847*64327855*64333408*64333413*64349521*64349525*64370730*64370732*64632622*64632641*69837948*69837951*71672841*72282733*72522431*72574316*72767454"
"*||||风之凌殇*风之凌殇喵*风之凌殇哇*风之凌殇Meow*卢克奶妈一号*卢克奶妈二号*卢克奶妈三号*卢克奶妈四号*卢克奶妈五号*卢克奶妈六号*卢克奶妈七号*卢克奶妈八号*风之凌殇喵喵*风之凌殇喵呜*卢克奶妈九号*卢克奶妈十号*风之凌殇呀*风之凌殇哦*风之"
"凌殇咯*风之凌殇咩*风之凌殇嘿*|0*3*13*14*14*14*14*14*14*14*14*14*3*3*14*14*11*4*3*3*3*||1608455917|"
)
self.md5str = "3F7F5D5C92CF3E633A40E246A637CC0B"
self.infostr = ""
self.checkstr = ""
class RankUserInfo(ConfigInterface):
def __init__(self):
self.score = "10"
self.sendScore = 0
self.giftStatus = {}
self.canGift = 0
class DnfWarriorsCallInfo(ConfigInterface):
def __init__(self):
self.page = "index"
self.userInfo = DnfWarriorsCallUserInfo()
self.zz = DnfWarriorsCallZZ()
self.boss = DnfWarriorsCallBoss()
self.isQQ = False
self.isIOS = False
self.isMobile = False
class DnfWarriorsCallUserInfo(ConfigInterface):
def __init__(self):
self.nick = "小号一号"
self.avatar = "//qlogo3.store.qq.com/qzone/3036079506/3036079506/100"
self.deluxe = 0
self.level = 0
self.now = 1606814238
self.star_level = 0
self.star_vip = 0
self.uin = 3036079506
self.vip = 0
self.year = 0
class DnfWarriorsCallZZ(ConfigInterface):
def __init__(self):
self.title = "QQ会员阿拉德勇士征集令"
self.desc = "阿拉德勇士征集令,瓜分大额Q币、现金大奖!"
self.shareImage = "https://sola.gtimg.cn/aoi/sola/20200527195101_54WJymQ7wi.jpg"
self.arkImage = ""
self.time = "第一期时间:2020年11月30日——12月26日"
self.tvImage = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/imgs/20201201115645_06f20b.jpg"
self.tvUrl = "https://dnf.qq.com/cp/a20201125dnf/index.html"
self.txVideoId = "u3206474sp4"
self.QRCode = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/imgs/20201130213733_7bfd35.png"
self.h5 = {}
self.zZConfigerUpdateTime = 1606805575
self.actid = 4117
self.noRuleQuals = []
self.gameid = "dnf"
self.report = "act4071"
self.aid = "act4071"
self.gameActName = "dnf_huoyue_30s_saishi"
self.actbossZige = DnfWarriorsCallZZBossZige()
self.actbossRule = DnfWarriorsCallZZBossRule()
class DnfWarriorsCallZZBossZige(ConfigInterface):
def __init__(self):
self.registerPackage = 117926
self.buyVip = 117928
self.buyVipPrize = 117929
self.lottery = 117925
self.pfPrize1 = 117950
self.pfPrize2 = 117951
self.pfPrize3 = 117952
self.pfPrize4 = 117953
self.jsPrize1 = 117938
self.jsPrize2 = 117939
self.jsPrize3 = 117940
self.online = 118003
self.wangba = 118001
self.box1 = 117957
self.box2 = 117958
self.box3 = 117970
self.box4 = 117971
self.box5 = 117972
self.share1 = 118066
self.share2 = 117927
self.onlyOneBox = 118067
self.score = 117942
class DnfWarriorsCallZZBossRule(ConfigInterface):
def __init__(self):
self.registerPackage = 28172
self.iosPay = "28158"
self.h5Pay = "28157_35300de17aee936b7593b1dcadedc52a4117"
self.buyVipPrize = 28174
self.lottery = 28208
self.pfPrize1 = 28258
self.pfPrize2 = 28260
self.pfPrize3 = 28259
self.pfPrize4 = 28262
self.jsPrize1 = 28177
self.jsPrize2 = 28178
self.jsPrize3 = 28179
self.wangba = 28207
self.getBox1 = 28167
self.getBox2 = 28168
self.getBox3 = 28169
self.getBox4 = 28170
self.getBox5 = 28171
self.box1 = 28182
self.box2 = 28180
self.box3 = 28183
self.box4 = 28184
self.box5 = 28185
self.share = 28156
self.share1 = 28156
self.share2 = 28173
class DnfWarriorsCallBoss(ConfigInterface):
def __init__(self):
self.left = {"117925": 0, "117926": 0, "undefined": 0}
self.used = {"117925": 0, "117926": 1, "undefined": 0}
class QzoneActivityResponse(ConfigInterface):
def __init__(self):
self.code = -10000
self.subcode = -1
self.message = "不符合领取条件"
self.notice = 0
self.time = 1606839612
self.tips = "6871-284"
class DnfHelperChronicleExchangeList(ConfigInterface):
def __init__(self):
self.code = 200
self.exp = 0
self.gifts: list[DnfHelperChronicleExchangeGiftInfo] = []
self.hasPartner = False
self.level = 1
self.msg = "success"
def fields_to_fill(self):
return [
("gifts", DnfHelperChronicleExchangeGiftInfo),
]
class DnfHelperChronicleExchangeGiftInfo(ConfigInterface):
def __init__(self):
self.sIdentifyId = ""
self.sName = "一次性材质转换器"
self.iCard = "20"
self.iNum = "5"
self.iLevel = "1"
self.sLbcode = "ex_0001"
self.sPic1 = "https://mcdn.gtimg.com/bbcdn/dnf/Scorelb/sPic1/icons/20201130165705.png?version=5705"
self.isLock = 0
self.usedNum = 0
self.iLbSel = "1"
self.sExpire = ""
self.SubGifts: list[DnfHelperChronicleExchangeSubGiftInfo] = []
self.iIsOpen = "2"
self.sAndroidUrl = ""
self.sIOSUrl = ""
self.sExperienceNum = "0"
def fields_to_fill(self):
return [
("SubGifts", DnfHelperChronicleExchangeSubGiftInfo),
]
class DnfHelperChronicleExchangeSubGiftInfo(ConfigInterface):
def __init__(self):
self.GiftName = "鬼剑士·女"
self.GiftId = " 62"
class DnfHelperChronicleBasicAwardList(ConfigInterface):
def __init__(self):
self.basic1List: list[DnfHelperChronicleBasicAwardInfo] = []
self.basic2List: list[DnfHelperChronicleBasicAwardInfo] = []
self.code = 200
self.hasPartner = False
self.msg = "success"
def fields_to_fill(self):
return [
("basic1List", DnfHelperChronicleBasicAwardInfo),
("basic2List", DnfHelperChronicleBasicAwardInfo),
]
class DnfHelperChronicleBasicAwardInfo(ConfigInterface):
def __init__(self):
self.sIdentifyId = ""
self.giftName = "时间的引导石10个礼盒"
self.giftNum = 1
self.isLock = 1
self.isUsed = 0
self.sPic = "https://mcdn.gtimg.com/bbcdn/dnf/Scorereward/sLbPic2/icons/202011262233175fbfbcad13bc7.png"
self.sName = "1"
self.iLbSel1 = 1
self.sLbCode = "basic_0001"
class DnfHelperChronicleLotteryList(ConfigInterface):
def __init__(self):
self.code = 200
self.gifts: list[DnfHelperChronicleLotteryGiftInfo] = []
self.msg = "success"
def fields_to_fill(self):
return [
("gifts", DnfHelperChronicleLotteryGiftInfo),
]
class DnfHelperChronicleLotteryGiftInfo(ConfigInterface):
def __init__(self):
self.sIdentifyId = ""
self.sName = "+8 装备增幅券*1"
self.fChance = "0.001"
self.iCard = "10"
self.sLbCode = "lottery_0007"
self.sLbPic = "https://mcdn.gtimg.com/bbcdn/dnf/Scorelottery/sLbPic/icons/20201127103006.png?version=3007"
self.iRank = "1"
self.iAction = "1"
class DnfHelperChronicleUserActivityTopInfo(ConfigInterface):
def __init__(self):
self.des = "十二月 · 卡恩"
self.bImage = "https://mcdn.gtimg.com/bbcdn/dnf/Scoretheme/sPic2/icons/20201130165539.png?version=5540"
self.startTime = "2021-01-01 02:00:00"
self.point = 0
self.level = 1
self.levelName = "初级"
self.levelIcon = "https://mcdn.gtimg.com/bbcdn/dnf/Scorelevelname/sPic1/icons/20201111145754.png?version=5754"
self.totalExp = 0
self.currentExp = 0
self.levelExp = 5
self.giftImage = "https://mcdn.gtimg.com/bbcdn/dnf/Scorereward/sLbPic2/icons/202011262233235fbfbcb30af65.png"
self.isClose = False
self.signCardNum = "3"
def get_level_info_and_points_to_show(self) -> tuple[str, int]:
levelInfo = f"LV{self.level}({self.currentExp}/{self.levelExp})"
chronicle_points = self.point
if self.totalExp == 0:
levelInfo = ""
chronicle_points = 0
return levelInfo, chronicle_points
def is_full_level(self) -> bool:
return self.level == 30
class DnfHelperChronicleUserTaskList(ConfigInterface):
def __init__(self):
self.pUserId = ""
self.pEncodeUserId = "ab1a9a478692"
self.pNickname = "风之凌殇(私聊这个号)"
self.mNickname = "风之凌殇"
self.mIcon = "http://q.qlogo.cn/qqapp/1104466820/8F5DF4AB0D1CBAC3281E8549D6334034/100"
self.pIcon = "https://q.qlogo.cn/qqapp/1105742785/FF795385EA973689A70CAD79514374D3/100"
self.hasPartner = False
self.hasRedDot = False
self.isTip = False
self.taskList: list[DnfHelperChronicleUserTaskInfo] = []
def get_partner_info(self, dnf_helper_info) -> str:
from config import DnfHelperInfoConfig
dnf_helper_info: DnfHelperInfoConfig # type: ignore
partner_name = ""
if dnf_helper_info.pNickName != "":
partner_name += f"{dnf_helper_info.pNickName}-本地匹配"
elif dnf_helper_info.enable_auto_match_dnf_chronicle:
partner_name += f"{self.pNickname}-自动匹配"
return partner_name
def fields_to_fill(self):
return [
("taskList", DnfHelperChronicleUserTaskInfo),
]
class DnfHelperChronicleUserTaskInfo(ConfigInterface):
def __init__(self):
self.mActionId = "001"
self.name = "DNF助手签到"
self.mExp = 11
self.mStatus = 0
self.jumpUrl = ""
self.pActionId = "013"
self.pExp = 5
self.pStatus = 0
class DnfHelperChronicleSignList(ConfigInterface):
def __init__(self):
self.code = 200
self.gifts: list[DnfHelperChronicleSignGiftInfo] = []
self.msg = "success"
def fields_to_fill(self):
return [
("gifts", DnfHelperChronicleSignGiftInfo),
]
class DnfHelperChronicleSignGiftInfo(ConfigInterface):
def __init__(self):
self.sIdentifyId = "20221121"
self.sName = "神秘契约礼包 (1天)"
self.sLbcode = ""
self.sDays = "20221121"
self.sPic1 = "https://mcdn.gtimg.com/bbcdn/dnf/Scoresign/sPic1/icons/20221101104652.png?version=4652"
self.iRank = ""
self.iNum = "1"
self.status = 1
self.iLbSel = "1"
self.sExpire = ""
self.iId = "0"
self.SubGifts = []
self.iIsOpen = "2"
self.sAndroidUrl = ""
self.sIOSUrl = ""
self.num = 1
self.date = "2022-11-21"
class HelloVoiceDnfRoleInfo(ConfigInterface):
def __init__(self):
self.area = "11"
self.areaName = "浙江一区"
self.roleId = "71672841"
self.roleName = "风之凌殇呀"
self.qq = "1054073896"
class XinyueFinancingInfo(ConfigInterface):
def __init__(self):
self.name = "体验版周卡"
self.buy = False
self.totalIncome = 0
self.leftTime = 0
self.endTime = ""
class MajieluoShareInfo(ConfigInterface):
def __init__(self):
self.iInvitee = "386596804"
self.iShareLottery = "0"
self.iLostLottery = "0"
self.iAssistLottery = "0"
class DnfSpringInfo(ConfigInterface):
def __init__(self):
# 1月21日9:00至2月20日23:59充值DNF的金额
self.recharge_money = 0
# 累计获取汤勺数目
self.total_spoon_count = 0
# 当前剩余汤勺数目
self.current_spoon_count = 0
# 捞饺子次数
self.laojiaozi_count = 0
# 整个活动专属附带激活的总数目
self.total_take_fudai = 0
class Dnf0121Info(ConfigInterface):
def __init__(self):
self.sItemIds = []
self.lottery_times = 0
self.hasTakeShare = False
self.hasTakeBind = False
self.hasTakeLogin = False
class SpringFuDaiInfo(ConfigInterface):
def __init__(self):
# 今日是否已打开过福袋
self.today_has_take_fudai = False
# 拥有的福袋数目
self.fudai_count = 0
# 是否已领取绑定区服赠送的福袋
self.has_take_bind_award = False
# 已经邀请成功的流失好友数
self.invited_ok_liushi_friends = 0
# 是否已经领取过分享奖励
self.has_take_share_award = False
# 累积抽奖数目
self.total_lottery_times = 0
# 当前抽奖数目
self.lottery_times = 0
# 请求时传参用的一个参数
self.date_info = 0
class AmesvrSigninInfo(ConfigInterface):
def __init__(self):
self.nick_name = "1054073896"
self.uin = "1054073896"
self.data = []
self.total = "0"
self.msg = "OK"
self.sMsg = "OK"
self.ret = "0"
self.iRet = "0"
class AmesvrQueryFriendsInfo(ConfigInterface):
def __init__(self):
self.sMsg = "ok"
self.iRet = 0
self.retcode = 0
self.page = 1
self.pageSize = 4
self.total = 90
self.list: list[AmesvrFriendInfo] = []
def fields_to_fill(self):
return [
("list", AmesvrFriendInfo),
]
class AmesvrFriendInfo(ConfigInterface):
def __init__(self):
self.uin = 56885028
self.nick = "追风"
self.label = ""
self.lost = 1
self.iProba = "0.8625"
class GuanhuaiActInfo(DaoObject):
def __init__(self, act_name, ruleid):
self.act_name = act_name
self.ruleid = ruleid
class BuyInfo(ConfigInterface):
def __init__(self):
self.qq = ""
self.game_qqs = []
self.expire_at = "2020-01-01 00:00:00"
self.total_buy_month = 0
self.buy_records: list[BuyRecord] = []
def fields_to_fill(self):
return [
("buy_records", BuyRecord),
]
def merge(self, other: BuyInfo):
from util import format_time, parse_time
if other.total_buy_month == 0:
return
if other.qq != self.qq and other.qq not in self.game_qqs:
self.game_qqs.append(other.qq)
for qq in other.game_qqs:
if qq not in self.game_qqs:
self.game_qqs.append(qq)
self.total_buy_month += other.total_buy_month
records: list[BuyRecord] = [*self.buy_records, *other.buy_records]
records.sort(key=lambda br: br.buy_at)
# 重新计算时长
expired_at = parse_time(records[0].buy_at)
for record in records:
now = parse_time(record.buy_at)
if now > expired_at:
# 已过期,从当前时间开始重新计算
start_time = now
else:
# 续期,从之前结束时间叠加
start_time = expired_at
expired_at = start_time + record.buy_month * timedelta(days=31)
self.expire_at = format_time(expired_at)
self.buy_records = records
def append_records_and_recompute(self, new_records: list[BuyRecord]):
other = BuyInfo()
other.qq = self.qq
other.buy_records = new_records
for record in other.buy_records:
if record.is_dlc_reward():
continue
other.total_buy_month += record.buy_month
# 复用merge函数
self.merge(other)
def is_active(self, bypass_run_from_src=True):
return not self.will_expire_in_days(0, bypass_run_from_src)
def will_expire_in_days(self, days: int, bypass_run_from_src=True) -> bool:
from util import parse_time, run_from_src
if run_from_src() and bypass_run_from_src: