聊天频道相关
This commit is contained in:
@@ -8,6 +8,8 @@ namespace NB.Game;
|
||||
|
||||
public static class PlayerHelper
|
||||
{
|
||||
#region MyRegion
|
||||
|
||||
public static void InitializeChildEntity(this Player self)
|
||||
{
|
||||
if (self.Basic == null)
|
||||
@@ -141,6 +143,11 @@ public static class PlayerHelper
|
||||
account.SetTimeout(timeOut, account.Disconnect);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 结构转换
|
||||
|
||||
/// <summary>
|
||||
/// 获得GameAccountInfo
|
||||
/// </summary>
|
||||
@@ -158,4 +165,37 @@ public static class PlayerHelper
|
||||
LoginTime = self.Statistics.LoginTime
|
||||
};
|
||||
}
|
||||
|
||||
public static RoleSimpleInfo GetRoleSimpleInfo(this Player self)
|
||||
{
|
||||
return new RoleSimpleInfo()
|
||||
{
|
||||
RoleId = self.Id,
|
||||
NickName = self.Basic.NickName,
|
||||
Head = self.Basic.Head,
|
||||
Country = self.Basic.Country,
|
||||
Level = self.Basic.Level
|
||||
};
|
||||
}
|
||||
|
||||
public static RoleInfo GetRoleInfo(this Player self)
|
||||
{
|
||||
var info = new RoleInfo();
|
||||
info.BaseInfo = GetRoleBaseInfo(self);
|
||||
return info;
|
||||
}
|
||||
|
||||
public static RoleBaseInfo GetRoleBaseInfo(this Player self)
|
||||
{
|
||||
return new RoleBaseInfo()
|
||||
{
|
||||
NickName = self.Basic.NickName,
|
||||
Head = self.Basic.Head,
|
||||
Country = self.Basic.Country,
|
||||
Level = self.Basic.Level,
|
||||
Exp = self.Basic.Exp,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user