92 lines
3.1 KiB
C#
92 lines
3.1 KiB
C#
|
//This code create by CodeEngine
|
|||
|
|
|||
|
using System;
|
|||
|
using Module.Log;
|
|||
|
using Google.ProtocolBuffers;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace SPacket.SocketInstance
|
|||
|
{
|
|||
|
public class GC_NOTICEHandler : Ipacket
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2ʱ<32><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾЧ<CABE><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٹ<EFBFBD><D9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
public List<PacketDistributed> tempBlockMsg = new List<PacketDistributed>(); // <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
private bool hasDel = false;
|
|||
|
private bool isReleaseing = false;
|
|||
|
public uint Execute(PacketDistributed ipacket)
|
|||
|
{
|
|||
|
GC_NOTICE packet = (GC_NOTICE)ipacket;
|
|||
|
if (null == packet) return (uint)PACKET_EXE.PACKET_EXE_ERROR;
|
|||
|
if(packet.HasShowmessagebox && packet.Showmessagebox == 1)
|
|||
|
{
|
|||
|
MessageBoxLogic.OpenOKBox(GCGame.Table.StrDictionary.GetServerDictionaryFormatString(packet.Notice), "", delegate() {
|
|||
|
UIManager.CloseUI(UIInfo.MessageBox);
|
|||
|
});
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_ERROR;
|
|||
|
}
|
|||
|
if (packet.HasNotice)
|
|||
|
{
|
|||
|
if(isReleaseing == false)
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
if (GiftBagRandomPanelCtr.Instance != null)
|
|||
|
{
|
|||
|
if (hasDel == false)
|
|||
|
{
|
|||
|
GiftBagRandomPanelCtr.Instance.OnDisableEvent += ReleaseBlockMsg;
|
|||
|
hasDel = true;
|
|||
|
}
|
|||
|
|
|||
|
if (GiftBagRandomPanelCtr.Instance.gameObject.activeInHierarchy == true)
|
|||
|
{
|
|||
|
tempBlockMsg.Add(ipacket);
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
bool IsFilterRepeat = false;
|
|||
|
if(packet.HasFilterRepeat)
|
|||
|
{
|
|||
|
IsFilterRepeat = packet.FilterRepeat == 1? true:false;
|
|||
|
}
|
|||
|
|
|||
|
if (packet.Notice.StartsWith("#{999999}"))
|
|||
|
{
|
|||
|
string[] noticeSplit = packet.Notice.Split('*');
|
|||
|
if(noticeSplit.Length != 3)
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
|
|||
|
|
|||
|
int type1 = int.Parse(noticeSplit[1]);
|
|||
|
int type2 = int.Parse(noticeSplit[2]);
|
|||
|
PlayerData.NoticeLack(type1, type2);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
GUIData.AddNotifyData(packet.Notice, IsFilterRepeat);
|
|||
|
if (packet.Notice == "#{2129}")
|
|||
|
{
|
|||
|
UIManager.CloseUI(UIInfo.RankRoot);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
|
|||
|
}
|
|||
|
|
|||
|
// <20>ͷű<CDB7><C5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
public void ReleaseBlockMsg()
|
|||
|
{
|
|||
|
isReleaseing = true;
|
|||
|
foreach (PacketDistributed p in tempBlockMsg)
|
|||
|
{
|
|||
|
Execute(p);
|
|||
|
}
|
|||
|
|
|||
|
tempBlockMsg.Clear();
|
|||
|
isReleaseing = false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|