2024-02-09 22:15:05 +00:00
|
|
|
|
using GameServer.Controllers.Attributes;
|
|
|
|
|
using GameServer.Models;
|
|
|
|
|
using GameServer.Network;
|
2024-02-10 16:04:03 +00:00
|
|
|
|
using GameServer.Systems.Event;
|
2024-02-09 22:15:05 +00:00
|
|
|
|
using Protocol;
|
|
|
|
|
|
|
|
|
|
namespace GameServer.Controllers;
|
|
|
|
|
internal class PlayerInfoController : Controller
|
|
|
|
|
{
|
|
|
|
|
public PlayerInfoController(PlayerSession session) : base(session)
|
|
|
|
|
{
|
|
|
|
|
// PlayerInfoController.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[GameEvent(GameEventType.EnterGame)]
|
|
|
|
|
public async Task OnEnterGame(ModelManager modelManager)
|
|
|
|
|
{
|
|
|
|
|
PlayerModel player = modelManager.Player;
|
|
|
|
|
|
2024-02-10 22:28:35 +00:00
|
|
|
|
BasicInfoNotify basicInfo = new()
|
2024-02-09 22:15:05 +00:00
|
|
|
|
{
|
|
|
|
|
RandomSeed = 1337,
|
|
|
|
|
Id = player.Id,
|
2024-02-22 20:09:07 +00:00
|
|
|
|
Birthday = player.BirthDay,
|
|
|
|
|
Attributes = { player.Attributes },
|
2024-02-20 18:55:17 +00:00
|
|
|
|
RoleShowList =
|
|
|
|
|
{
|
|
|
|
|
new RoleShowEntry
|
|
|
|
|
{
|
|
|
|
|
Level = 1,
|
|
|
|
|
RoleId = 1501 // Rover
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
CurCardId = 80060000,
|
|
|
|
|
CardUnlockList =
|
|
|
|
|
{
|
|
|
|
|
new CardShowEntry
|
|
|
|
|
{
|
|
|
|
|
CardId = 80060000,
|
|
|
|
|
IsRead = true
|
2024-02-09 22:15:05 +00:00
|
|
|
|
}
|
2024-02-10 22:28:35 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await Session.Push(MessageId.BasicInfoNotify, basicInfo);
|
2024-02-09 22:15:05 +00:00
|
|
|
|
}
|
2024-02-14 21:22:21 +00:00
|
|
|
|
|
2024-02-22 20:09:07 +00:00
|
|
|
|
[NetEvent(MessageId.ChangeHeadPhotoRequest)]
|
|
|
|
|
public RpcResult OnChangeHeadPhotoRequest(ChangeHeadPhotoRequest request, ModelManager modelManager)
|
|
|
|
|
{
|
|
|
|
|
modelManager.Player.SetAttribute(PlayerAttrKey.HeadPhoto, request.HeadPhotoId);
|
|
|
|
|
|
|
|
|
|
return Response(MessageId.ChangeHeadPhotoResponse, new ChangeHeadPhotoResponse
|
|
|
|
|
{
|
|
|
|
|
HeadPhotoId = request.HeadPhotoId
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NetEvent(MessageId.BirthdayInitRequest)]
|
|
|
|
|
public RpcResult OnBirthdayInitRequest(BirthdayInitRequest request, ModelManager modelManager)
|
|
|
|
|
{
|
|
|
|
|
modelManager.Player.BirthDay = request.Birthday;
|
|
|
|
|
|
|
|
|
|
return Response(MessageId.BirthdayInitResponse, new BirthdayInitResponse());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NetEvent(MessageId.ModifySignatureRequest)]
|
|
|
|
|
public RpcResult OnModifySignatureRequest(ModifySignatureRequest request, ModelManager modelManager)
|
|
|
|
|
{
|
|
|
|
|
modelManager.Player.SetAttribute(PlayerAttrKey.Sign, request.Signature);
|
|
|
|
|
|
|
|
|
|
return Response(MessageId.ModifySignatureResponse, new ModifySignatureResponse
|
|
|
|
|
{
|
|
|
|
|
Signature = request.Signature
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NetEvent(MessageId.ModifyNameRequest)]
|
|
|
|
|
public RpcResult OnModifyNameRequest(ModifyNameRequest request, ModelManager modelManager)
|
|
|
|
|
{
|
|
|
|
|
modelManager.Player.SetAttribute(PlayerAttrKey.Name, request.Name);
|
|
|
|
|
|
|
|
|
|
return Response(MessageId.ModifyNameResponse, new ModifyNameResponse
|
|
|
|
|
{
|
|
|
|
|
Name = request.Name
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-14 21:22:21 +00:00
|
|
|
|
[NetEvent(MessageId.PlayerBasicInfoGetRequest)]
|
2024-02-20 19:39:08 +00:00
|
|
|
|
public RpcResult OnPlayerBasicInfoGetRequest()
|
2024-02-14 21:22:21 +00:00
|
|
|
|
{
|
|
|
|
|
return Response(MessageId.PlayerBasicInfoGetResponse, new PlayerBasicInfoGetResponse
|
|
|
|
|
{
|
|
|
|
|
Info = new PlayerDetails
|
|
|
|
|
{
|
2024-02-20 18:55:17 +00:00
|
|
|
|
Name = "Yangyang",
|
2024-02-14 21:22:21 +00:00
|
|
|
|
Signature = "discord.gg/reversedrooms",
|
2024-02-20 18:55:17 +00:00
|
|
|
|
HeadId = 1402,
|
2024-02-14 21:22:21 +00:00
|
|
|
|
PlayerId = 1338,
|
|
|
|
|
IsOnline = true,
|
|
|
|
|
LastOfflineTime = -1,
|
|
|
|
|
Level = 5
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-02-09 22:15:05 +00:00
|
|
|
|
}
|