public async UniTaskVoid HandleRequestAcceptPartyInvitation(RequestHandlerData requestHandler, RequestAcceptPartyInvitationMessage request, RequestProceedResultDelegate <ResponseAcceptPartyInvitationMessage> result) { #if UNITY_STANDALONE && !CLIENT_BUILD await UniTask.Yield(); BasePlayerCharacterEntity playerCharacter; if (!GameInstance.ServerUserHandlers.TryGetPlayerCharacter(requestHandler.ConnectionId, out playerCharacter)) { result.InvokeError(new ResponseAcceptPartyInvitationMessage() { message = UITextKeys.UI_ERROR_NOT_LOGGED_IN, }); return; } ValidatePartyRequestResult validateResult = GameInstance.ServerPartyHandlers.CanAcceptPartyInvitation(request.partyId, playerCharacter); if (!validateResult.IsSuccess) { result.InvokeError(new ResponseAcceptPartyInvitationMessage() { message = validateResult.GameMessage, }); return; } playerCharacter.PartyId = request.partyId; validateResult.Party.AddMember(playerCharacter); GameInstance.ServerPartyHandlers.SetParty(request.partyId, validateResult.Party); GameInstance.ServerPartyHandlers.RemovePartyInvitation(request.partyId, playerCharacter.Id); // Save to database AsyncResponseData <PartyResp> updateResp = await DbServiceClient.UpdateCharacterPartyAsync(new UpdateCharacterPartyReq() { SocialCharacterData = SocialCharacterData.Create(playerCharacter), PartyId = request.partyId }); if (!updateResp.IsSuccess) { result.InvokeError(new ResponseAcceptPartyInvitationMessage() { message = UITextKeys.UI_ERROR_INTERNAL_SERVER_ERROR, }); return; } // Broadcast via chat server if (ClusterClient.IsNetworkActive) { ClusterClient.SendAddSocialMember(MMOMessageTypes.UpdatePartyMember, request.partyId, playerCharacter.Id, playerCharacter.CharacterName, playerCharacter.DataId, playerCharacter.Level); } GameInstance.ServerGameMessageHandlers.SendSetPartyData(requestHandler.ConnectionId, validateResult.Party); GameInstance.ServerGameMessageHandlers.SendAddPartyMembersToOne(requestHandler.ConnectionId, validateResult.Party); GameInstance.ServerGameMessageHandlers.SendAddPartyMemberToMembers(validateResult.Party, playerCharacter.Id, playerCharacter.CharacterName, playerCharacter.DataId, playerCharacter.Level); // Send message to inviter GameInstance.ServerGameMessageHandlers.SendGameMessageByCharacterId(request.inviterId, UITextKeys.UI_PARTY_INVITATION_ACCEPTED); // Response to invitee result.InvokeSuccess(new ResponseAcceptPartyInvitationMessage() { message = UITextKeys.UI_PARTY_INVITATION_ACCEPTED, }); #endif }