public void Add(ulong ulluid, uint worldId, COM_INTIMACY_STATE state, COM_INTIMACY_RELATION_CHG_TYPE op, uint timeStamp, bool bReceiveNtf = false) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null && masterRoleInfo.playerUllUID == ulluid && (long)masterRoleInfo.logicWorldID == (long)((ulong)worldId)) { return; } CFR cfr = this.GetCfr(ulluid, worldId); if (cfr == null) { this.m_cfrList.Add(new CFR(ulluid, worldId, state, op, timeStamp, bReceiveNtf)); } else { cfr.SetData(ulluid, worldId, state, op, timeStamp, bReceiveNtf); } if (IntimacyRelationViewUT.IsRelaState(state)) { COM_INTIMACY_STATE confirmState = IntimacyRelationViewUT.GetConfirmState(state); this.FindSetState(confirmState, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL); } Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange"); }
public static void On_NTF_INTIMACY_RELATION_REQUEST(CSPkg msg) { SCPKG_CMD_NTF_INTIMACY_RELATION_REQUEST stNtfIntimacyRelationRequest = msg.stPkgData.stNtfIntimacyRelationRequest; if (stNtfIntimacyRelationRequest == null) { return; } COM_INTIMACY_STATE cOM_INTIMACY_STATE = COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL; if (stNtfIntimacyRelationRequest.bRelationChgType == 1) { if (IntimacyRelationViewUT.IsRelaState(stNtfIntimacyRelationRequest.bIntimacyState)) { cOM_INTIMACY_STATE = IntimacyRelationViewUT.GetConfirmState(stNtfIntimacyRelationRequest.bIntimacyState); } } else if (stNtfIntimacyRelationRequest.bRelationChgType == 2 && IntimacyRelationViewUT.IsRelaState(stNtfIntimacyRelationRequest.bIntimacyState)) { cOM_INTIMACY_STATE = IntimacyRelationViewUT.GetDenyState(stNtfIntimacyRelationRequest.bIntimacyState); } if (cOM_INTIMACY_STATE != COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL) { CFriendRelationship.FRData.Add(stNtfIntimacyRelationRequest.stUin.ullUid, stNtfIntimacyRelationRequest.stUin.dwLogicWorldId, cOM_INTIMACY_STATE, (COM_INTIMACY_RELATION_CHG_TYPE)stNtfIntimacyRelationRequest.bRelationChgType, 0u, true); } }
public static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_CMD_INTIMACY_RELATION_REQUEST stIntimacyRelationRequestRsp = msg.stPkgData.stIntimacyRelationRequestRsp; if (stIntimacyRelationRequestRsp.dwResult == 0u) { string strContent = string.Empty; COM_INTIMACY_STATE state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL; if (stIntimacyRelationRequestRsp.bRelationChgType == 1) { if (IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState)) { state = IntimacyRelationViewUT.GetConfirmState(stIntimacyRelationRequestRsp.bIntimacyState); RelationConfig relaTextCfg = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState); strContent = relaTextCfg.IntimRela_Tips_SendRequestSuccess; } } else if (stIntimacyRelationRequestRsp.bRelationChgType == 2 && IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState)) { state = IntimacyRelationViewUT.GetDenyState(stIntimacyRelationRequestRsp.bIntimacyState); RelationConfig relaTextCfg2 = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState); strContent = relaTextCfg2.IntimRela_Tips_SendDelSuccess; } Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]); CFriendRelationship.FRData.Add(stIntimacyRelationRequestRsp.stUin.ullUid, stIntimacyRelationRequestRsp.stUin.dwLogicWorldId, state, (COM_INTIMACY_RELATION_CHG_TYPE)stIntimacyRelationRequestRsp.bRelationChgType, 0u, false); } else { Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stIntimacyRelationRequestRsp.dwResult), false, 1.5f, null, new object[0]); } }
public static COM_INTIMACY_STATE GetConfirmState(byte state) { return IntimacyRelationViewUT.GetConfirmState((COM_INTIMACY_STATE)state); }