少年修仙传客户端代码仓库
client_linchunjie
2018-09-19 aecb6a5a62d8a4cfc7b924ce957a9c7ea90c235d
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
using System.Text;
using System.Collections;
using System.Text.RegularExpressions;
using UnityEngine;
using Snxxz.UI;
 
public class ChatData
{
    public ChatData(string content)
    {
        _content = content;
        if (ChatCenter.s_VoiceRegex.IsMatch(_content))
        {
            _content = ChatCenter.s_VoiceRegex.Replace(_content, string.Empty);
        }
        richText = new StringBuilder();
        richText.Length = 0;
    }
 
    private string _content = string.Empty;
 
    public string content
    {
        get
        {
            if (richText.Length > 0)
            {
                return richText.ToString();
            }
            return _content;
        }
        protected set
        {
            _content = value;
        }
    }
 
    public ChatInfoType type { get; protected set; }
 
    private ChatInfoType m_DetailType = ChatInfoType.World;
    public ChatInfoType detailType
    {
        get
        {
            return m_DetailType;
        }
        set
        {
            m_DetailType = value;
        }
    }
 
    public StringBuilder richText;
 
    public ArrayList infoList = new ArrayList();
}
 
public class ChatUeseData : ChatData
{
    public ChatUeseData(string _content, int player, string name, string extra) : base(_content)
    {
        this.player = player;
        this.name = name;
        this.extra = extra;
        this.job = 1;
        IsSound = false;
        if (extra.Length > 1)
        {
            vipLv = int.Parse(extra.Substring(0, 2));
        }
        if (extra.Length > 2)
        {
            isGm = byte.Parse(extra.Substring(2, 1)) == 1;
        }
        if (extra.Length > 3)
        {
            job = byte.Parse(extra.Substring(3, 1));
        }
        if (ChatCenter.s_VoiceRegex.IsMatch(_content))
        {
            var _match = ChatCenter.s_VoiceRegex.Match(_content);
            soundTick = long.Parse(_match.Groups[1].Value);
            soundLength = byte.Parse(_match.Groups[2].Value)/10.0f;
            IsSound = true;
        }
    }
    public int player { get; protected set; }
    public string name { get; protected set; }
    public string extra { get; protected set; }
    public int vipLv { get; protected set; }
    public bool isGm { get; protected set; }
    public int job { get; protected set; }
    public long soundTick { get; private set; }
    public bool IsSound { get; private set; }
    public float soundLength { get; private set; }
}
 
public class ChatSystemData : ChatData
{
    public ChatSystemData(string content) : base(content)
    {
        type = ChatInfoType.System;
    }
}
 
public class ChatTrumpetData : ChatUeseData
{
    public ChatTrumpetData(string content, int player, string name, string extra, byte speakType, string accId) : base(content, player, name, extra)
    {
        this.speakType = speakType;
        this.accId = accId;
        type = ChatInfoType.Trumpet;
    }
 
    public byte speakType { get; protected set; }
 
    public string accId { get; protected set; }
}
 
public class ChatWorldData : ChatUeseData
{
    public ChatWorldData(string content, int player, string name, string extra) : base(content, player, name, extra)
    {
        type = ChatInfoType.World;
    }
}
 
public class ChatAreaData : ChatUeseData
{
    public ChatAreaData(string content, int player, string name, string extra) : base(content, player, name, extra)
    {
        type = ChatInfoType.Area;
    }
}
 
public class ChatTeamData : ChatUeseData
{
    public ChatTeamData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.World) : base(content, player, name, extra)
    {
        type = ChatInfoType.Team;
        this.detailType = detailType;
    }
}
 
public class ChatFamilyData : ChatUeseData
{
    public ChatFamilyData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.Fairy) : base(content, player, name, extra)
    {
        type = ChatInfoType.Fairy;
        this.detailType = detailType;
    }
}
 
public class ChatInviteData : ChatUeseData
{
    public ChatInviteData(string content, int player, string name, string extra) : base(content, player, name, extra)
    {
        type = ChatInfoType.Invite;
    }
}
 
public class ChatFriendData : ChatUeseData
{
    public ChatFriendData(string content, int player, string name, string extra, string toName, byte talkType, uint toPlayer) : base(content, player, name, extra)
    {
        type = ChatInfoType.Friend;
        this.toName = toName;
        this.talkType = talkType;
        this.toPlayer = (int)toPlayer;
    }
 
    public string toName { get; protected set; }
 
    public byte talkType { get; protected set; }
 
    public int toPlayer { get; protected set; }
}