50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using Google.Protobuf;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
using ServerCommon;
|
|
using ServerCommon.BusinessLogDomain;
|
|
using MetaAssets;
|
|
|
|
|
|
|
|
using USER_GUID = System.String;
|
|
|
|
|
|
namespace GameServer;
|
|
|
|
public class NotifyChangePartyLeaderGuidHandler
|
|
{
|
|
public async Task recvChangePartyLeaderGuid(ServerMessage.Types.ChangePartyLeaderNoti notify)
|
|
{
|
|
// 1. party 정보 조회
|
|
var global_party = GameServerApp.getServerLogic().findGlobalEntity<GlobalParty>();
|
|
ArgumentNullException.ThrowIfNull(global_party);
|
|
|
|
var party = global_party.getParty(notify.PartyGuid);
|
|
if (null == party) return;
|
|
|
|
// 2. 파티 리더 정보 수정
|
|
var party_detail_info_action = party.getEntityAction<GlobalPartyDetailInfoAction>();
|
|
ArgumentNullException.ThrowIfNull(party_detail_info_action);
|
|
|
|
var result = await party_detail_info_action.changePartyLeader(notify.NewPartyLeaderGuid, false);
|
|
if (result.isFail()) return;
|
|
|
|
// 3. client 통보
|
|
var message = new ClientToGame
|
|
{
|
|
Message = new()
|
|
{
|
|
ChangePartyLeaderNoti = new()
|
|
{
|
|
NewPartyLeaderGuid = notify.NewPartyLeaderGuid
|
|
}
|
|
}
|
|
};
|
|
|
|
PartyHelper.BroadcastToClients(party, message, new List<USER_GUID>());
|
|
}
|
|
} |