summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Chat/ChatInfo.cs
blob: fb3d20ff9fe302acdc56f9f8ad01cd21c3e3368f (plain)
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
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	public class ChatInfo : LoopItemData
	{
		public bool isAudioChat
		{
			get
			{
				return this.mAudioId > 0UL;
			}
		}

		public string AudioUrl
		{
			get
			{
				bool flag = this.url == "";
				if (flag)
				{
					string[] array = this.mContent.Split(new char[]
					{
						'#'
					});
					bool flag2 = array.Length >= 5;
					if (flag2)
					{
						this.url = array[2];
						this.time = array[3];
						this.tag = int.Parse(array[4]);
					}
					else
					{
						this.url = "";
						this.time = "0";
						this.tag = 0;
					}
				}
				return this.url;
			}
		}

		public int AudioIntTime
		{
			get
			{
				return (int)this.mAudioTime;
			}
		}

		private int tag
		{
			get
			{
				return this._tag;
			}
			set
			{
				bool flag = value > 0;
				if (flag)
				{
					this._tag = value;
				}
			}
		}

		public bool isAutoPlaying = false;

		public float autoStartPlayTime = 0f;

		public int id;

		public ChatChannelType mChannelId;

		public ulong mSenderId;

		public int mSenderTeamId = 0;

		public bool isFriend = false;

		public bool isSelfSender;

		public string mSenderName;

		public string mContent;

		public ulong mReceiverId = 0UL;

		public string mReceiverName = "test";

		public bool mRegression = false;

		public uint CampDuelID = 0u;

		public ChatType mChatType;

		public GameObject mUIObject;

		public uint mSenderVip;

		public uint mSenderPaymemberid;

		public uint mReceiverVip = 1u;

		public uint mServerProfession;

		public uint mRecieverProfession = 1u;

		public uint mSenderPowerPoint;

		public uint mReciverPowerPoint = 100u;

		public bool isAudioPlayed = false;

		public bool isUIShowed = false;

		public DateTime mTime = DateTime.Now;

		public ulong mAudioId = 0UL;

		public uint mAudioTime = 0u;

		public uint mHeroID = 0u;

		public GroupChatTeamInfo group;

		public uint mCoverDesignationID;

		public string mSpecialDesignation;

		public uint militaryRank;

		public PayConsume payConsume;

		public ChatVoiceInfo voice = null;

		private string url = "";

		private string time = "";

		private int _tag = 0;

		public byte[] AudioData;

		public bool isPlayOver()
		{
			bool flag = this.autoStartPlayTime == 0f;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = Time.realtimeSinceStartup - this.autoStartPlayTime > (float)this.AudioIntTime;
				result = flag2;
			}
			return result;
		}

		public ChatVoiceInfo GetVoice(ulong audid, uint aulen)
		{
			bool flag = audid <= 0UL;
			ChatVoiceInfo result;
			if (flag)
			{
				result = null;
			}
			else
			{
				result = new ChatVoiceInfo
				{
					voiceTime = (int)aulen,
					txt = this.mContent
				};
			}
			return result;
		}

		public string GetChannelName()
		{
			return "";
		}

		public void SetAudioText(string text)
		{
			this.mContent = text;
			bool flag = DlgBase<XChatView, XChatBehaviour>.singleton.activeChannelType != this.mChannelId;
			if (!flag)
			{
				IXUILabelSymbol ixuilabelSymbol = this.mUIObject.transform.Find("voice/content").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
				ixuilabelSymbol.InputText = text;
			}
		}
	}
}