少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
using System.Collections.Generic;
using System;
using LitJson;
 
namespace vnxbqy.UI
{
 
    public class WorshipInfoListModel : Model, IBeforePlayerDataInitialize
    {
        //上线只通知需要膜拜的玩家,已膜拜不通知,关闭不膜拜则等下次登录通知
        public List<WorshipPlayer> players = new List<WorshipPlayer>();
        public bool notShowTip = false; //默认推界面
 
        public int playerIDResult;
        public int worshipTypeResult;
        public event Action WorshipResultEvent;
 
        public override void Init()
        {
 
        }
 
 
        public override void UnInit()
        {
 
        }
 
        public void OnBeforePlayerDataInitialize()
        {
            players.Clear();
            notShowTip = false;
            playerIDResult = 0;
            worshipTypeResult = 0;
        }
 
        public void UpdateWorshipResult(HB021_tagGCWorshipResult pack)
        {
            playerIDResult = (int)pack.PlayerID;
            worshipTypeResult = pack.WorshipType;
            WorshipResultEvent?.Invoke();
 
        }
 
 
        public void UpdateWorshipInfoList(HB020_tagGCWorshipInfoList pack)
        {
            for (int i = 0; i < pack.WorshipCount; i++)
            {
                WorshipPlayer player = new WorshipPlayer();
                player.playerID = pack.WorshipInfoList[i].PlayerID;
                player.worshipType = pack.WorshipInfoList[i].WorshipType;
                player.worshipValue = pack.WorshipInfoList[i].WorshipValue;
 
                player.playerInfo = JsonMapper.ToObject<PlayerInfo>(pack.WorshipInfoList[i].PlayerInfo);
                players.Add(player);
            }
 
 
            if (!notShowTip && PlayerDatas.Instance.baseData.LV > 10)
                PopupWindowsProcessor.Instance.Add("WorshipInfoListWin");
        }
 
 
        public struct WorshipPlayer
        {
            public uint playerID;
            public byte worshipType; //膜拜类型 如排位赛
            public uint worshipValue; //膜拜二级定义,如排位赛的名次
            public PlayerInfo playerInfo;
        }
 
        public struct PlayerInfo
        {
            public int LV;
            public string AccID;
            public int Job;
            public int[] EquipShowID;
            public string Name;
            public int RealmLV;
            public int TitleID;
            public int VIPLV;
            public long FightPower;
            public int EquipShowSwitch;
        }
 
        public int GetItemId(RoleEquipType type, int[] equipShowID)
        {
            if (equipShowID != null)
            {
                foreach (var id in equipShowID)
                {
                    var itemConfig = ItemConfig.Get(id);
                    if (itemConfig != null && itemConfig.EquipPlace == (int)type)
                    {
                        return id;
                    }
                }
            }
            return 0;
        }
    }
}