public static void Handler(GC_RET_MARRAGE packet) { if (packet.Type == (int)MARRY_PACKET_TYPE.MARRY_PACKET_ASKMARRY && packet.Id != GlobeVar.INVALID_GUID) { string strTarget = ""; if (GameManager.gameManager.PlayerDataPool.TeamInfo.TeamID == GlobeVar.INVALID_ID) { return; } for (int i = 0; i < GlobeVar.MAX_TEAM_MEMBER; ++i) { TeamMember tm = GameManager.gameManager.PlayerDataPool.TeamInfo.GetTeamMember(i); if (null != tm && true == tm.IsValid() && tm.Guid == packet.Id) { strTarget = tm.MemberName; } } MarryRootLogic.m_SavedGUID = packet.Id; //MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{1415}", strTarget),"求婚", MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{1415}", strTarget), StrDictionary.GetClientDictionaryString("#{2864}"), ConfirmPromise, CancelNone); } else if (packet.Type == (int)MARRY_PACKET_TYPE.MARRY_PACKET_CONFIRM && packet.Id != GlobeVar.INVALID_GUID) { string strTarget = ""; if (GameManager.gameManager.PlayerDataPool.TeamInfo.TeamID == GlobeVar.INVALID_ID) { return; } for (int i = 0; i < GlobeVar.MAX_TEAM_MEMBER; ++i) { TeamMember tm = GameManager.gameManager.PlayerDataPool.TeamInfo.GetTeamMember(i); if (null != tm && true == tm.IsValid() && tm.Guid == packet.Id) { strTarget = tm.MemberName; } } MarryRootLogic.m_SavedGUID = packet.Id; MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{1416}", strTarget), StrDictionary.GetClientDictionaryString("#{2864}"), RetPromiseOK, RetPromiseCancel, GlobeVar.INVALID_ID, MessageBoxLogic.PASSWORD.MARRYROOT); } else if (packet.Type == (int)MARRY_PACKET_TYPE.MARRY_PACKET_CANCEL && packet.Id != GlobeVar.INVALID_GUID) { if (MarryRootLogic.m_SavedGUID == packet.Id) { MarryRootLogic.m_SavedGUID = GlobeVar.INVALID_GUID; if (MessageBoxLogic.Instance() != null && MessageBoxLogic.Instance().EPassword == MessageBoxLogic.PASSWORD.MARRYROOT) { MessageBoxLogic.CloseBox(); } } } }
public uint Execute(PacketDistributed ipacket) { GC_RET_MARRAGE packet = (GC_RET_MARRAGE )ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic // MarryRootLogic.Handler (packet); return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }