| | |
| | | {
|
| | | _recentlyChat = chatCenter.SaveRecentlyChat(msg);
|
| | | }
|
| | | msg = CheckHasItem(msg, _recentlyChat);
|
| | | chatCenter.recentlyChat = null;
|
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | {
|
| | | C0201_tagCTalkGong chatPack = new C0201_tagCTalkGong();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Area:
|
| | | {
|
| | | C0207_tagCTalkArea chatPack = new C0207_tagCTalkArea();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Team:
|
| | | {
|
| | | C0205_tagCTalkDui chatPack = new C0205_tagCTalkDui();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Friend:
|
| | | {
|
| | | var _toPlayer = PteChatID;
|
| | | if (info.HasValue && info.Value.infoint1 == 0)
|
| | | {
|
| | | _toPlayer = info.Value.infoint1;
|
| | | }
|
| | | if (_toPlayer == 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NoChatTarget");
|
| | | return;
|
| | | }
|
| | | SendFriendChat(msg, _toPlayer);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Fairy:
|
| | | {
|
| | | C0203_tagCTalkBang chatPack = new C0203_tagCTalkBang();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Trumpet:
|
| | | {
|
| | | if (info.HasValue)
|
| | | {
|
| | | CA217_tagCMPYSpeaker _pak = new CA217_tagCMPYSpeaker();
|
| | | _pak.SpeakerType = 1;
|
| | | _pak.IsUseGold = 0;
|
| | | _pak.ItemIndex = (byte)info.Value.infoint1;
|
| | | _pak.TextLen = (ushort)GetUTF8InfoLen(msg);
|
| | | _pak.Text = msg;
|
| | | GameNetSystem.Instance.SendInfo(_pak);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Invite:
|
| | | {
|
| | | SendInvite(msg);
|
| | | }
|
| | | break;
|
| | | }
|
| | | LanguageVerify.toPlayer = (uint)PteChatID;
|
| | | LanguageVerify.toPlayerName = PteChatName;
|
| | | LanguageVerify.Instance.VerifyChat(msg, type, (bool ok, string result) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | | msg = CheckHasItem(result, _recentlyChat);
|
| | | chatCenter.recentlyChat = null;
|
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | {
|
| | | C0201_tagCTalkGong chatPack = new C0201_tagCTalkGong();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Area:
|
| | | {
|
| | | C0207_tagCTalkArea chatPack = new C0207_tagCTalkArea();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Team:
|
| | | {
|
| | | C0205_tagCTalkDui chatPack = new C0205_tagCTalkDui();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Friend:
|
| | | {
|
| | | var _toPlayer = PteChatID;
|
| | | if (info.HasValue && info.Value.infoint1 == 0)
|
| | | {
|
| | | _toPlayer = info.Value.infoint1;
|
| | | }
|
| | | if (_toPlayer == 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NoChatTarget");
|
| | | return;
|
| | | }
|
| | | SendFriendChat(msg, _toPlayer);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Fairy:
|
| | | {
|
| | | C0203_tagCTalkBang chatPack = new C0203_tagCTalkBang();
|
| | | chatPack.Len = (ushort)GetUTF8InfoLen(msg);
|
| | | chatPack.Content = msg;
|
| | | GameNetSystem.Instance.SendInfo(chatPack);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Trumpet:
|
| | | {
|
| | | if (info.HasValue)
|
| | | {
|
| | | CA217_tagCMPYSpeaker _pak = new CA217_tagCMPYSpeaker();
|
| | | _pak.SpeakerType = 1;
|
| | | _pak.IsUseGold = 0;
|
| | | _pak.ItemIndex = (byte)info.Value.infoint1;
|
| | | _pak.TextLen = (ushort)GetUTF8InfoLen(msg);
|
| | | _pak.Text = msg;
|
| | | GameNetSystem.Instance.SendInfo(_pak);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Invite:
|
| | | {
|
| | | SendInvite(msg);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | /// <summary>
|
| | | /// 世界频道
|