增加相关协议

This commit is contained in:
2025-07-31 23:57:32 +08:00
parent 6b113cf32b
commit 96f22a3e48
27 changed files with 770 additions and 63 deletions

View File

@@ -33,19 +33,18 @@ public class G2Game_EnterRequestHandler : RouteRPC<Scene, G2Game_EnterRequest, G
// 如果不存在,表示这是一个新的账号,需要创建一下这个账号。
account = await PlayerFactory.Create(scene, accountId);
account.Basic.Level = 99;
account.Basic.NickName = "王麻子";
account.Basic.Country = "cn";
account.Basic.Exp = 999;
account.Basic.Head = "xxx.png";
account.Level = 99;
account.NickName = "王麻子";
account.Country = "cn";
account.Exp = 999;
account.Head = "xxx.png";
for (int i = 0; i < 500; i++)
{
var item = Entity.Create<Item>(scene, true, true);
account.Items.Add(item.Id, item);
}
for (int i = 0; i < 500; i++)
{
var item = Entity.Create<Fish>(scene, true, true);
@@ -86,6 +85,19 @@ public class G2Game_EnterRequestHandler : RouteRPC<Scene, G2Game_EnterRequest, G
account.LoginTime = TimeHelper.Now;
response.RoleRouteId = account.RuntimeId;
if (account.GetComponent<MailComponent>() == null)
{
var mailComponent = await scene.World.DataBase.Query<MailComponent>(account.Id, true);
if (mailComponent == null)
{
//如果没有邮件组件
account.AddComponent<MailComponent>();
}
else
{
account.AddComponent(mailComponent);
}
}
await FTask.CompletedTask;
}