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,
|
|
|
|
|
Birthday = 0,
|
|
|
|
|
Attributes =
|
|
|
|
|
{
|
|
|
|
|
new PlayerAttr
|
|
|
|
|
{
|
|
|
|
|
Key = (int)PlayerAttrKey.Name,
|
|
|
|
|
ValueType = (int)PlayerAttrType.String,
|
|
|
|
|
StringValue = player.Name
|
|
|
|
|
},
|
|
|
|
|
new PlayerAttr
|
|
|
|
|
{
|
|
|
|
|
Key = (int)PlayerAttrKey.Level,
|
|
|
|
|
ValueType = (int)PlayerAttrType.Int32,
|
|
|
|
|
Int32Value = 10
|
2024-02-10 23:39:36 +00:00
|
|
|
|
},
|
|
|
|
|
new PlayerAttr
|
|
|
|
|
{
|
|
|
|
|
Key = (int)PlayerAttrKey.HeadPhoto,
|
|
|
|
|
ValueType = (int)PlayerAttrType.Int32,
|
|
|
|
|
Int32Value = 1601
|
2024-02-09 22:15:05 +00:00
|
|
|
|
}
|
2024-02-10 22:28:35 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < player.Characters.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
basicInfo.RoleShowList.Add(new RoleShowEntry
|
2024-02-09 22:15:05 +00:00
|
|
|
|
{
|
2024-02-10 22:28:35 +00:00
|
|
|
|
Level = 1,
|
|
|
|
|
RoleId = player.Characters[i]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await Session.Push(MessageId.BasicInfoNotify, basicInfo);
|
2024-02-09 22:15:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|