1
This commit is contained in:
17
Src/Player/Com.Project.B.Player.asmdef
Normal file
17
Src/Player/Com.Project.B.Player.asmdef
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "Com.Project.B.Player",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": true
|
||||
}
|
7
Src/Player/Com.Project.B.Player.asmdef.meta
Normal file
7
Src/Player/Com.Project.B.Player.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d0943973658ff5419a52132fdc2812c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Src/Player/IPlayerData.cs
Normal file
45
Src/Player/IPlayerData.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MemoryPack;
|
||||
|
||||
namespace Project.B.Player
|
||||
{
|
||||
public interface IPlayerData
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
Guid PlayerId { get; }
|
||||
/// <summary>
|
||||
/// 是否是机器人
|
||||
/// </summary>
|
||||
bool IsBot { get; }
|
||||
/// <summary>
|
||||
/// Steam64位ID
|
||||
/// </summary>
|
||||
long Steam64Id { get; }
|
||||
/// <summary>
|
||||
/// https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/xx/xx.jpg
|
||||
/// </summary>
|
||||
string AvatarUrl { get; }
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
string NickName { get; }
|
||||
/// <summary>
|
||||
/// 许可证状态
|
||||
/// </summary>
|
||||
int LicenseLevel { get; }
|
||||
}
|
||||
[MemoryPackable]
|
||||
public partial struct PlayerData:IPlayerData
|
||||
{
|
||||
public Guid PlayerId { get; set; }
|
||||
public bool IsBot { get; set; }
|
||||
public long Steam64Id { get; set; }
|
||||
public string AvatarUrl { get; set; }
|
||||
public string NickName { get; set; }
|
||||
public int LicenseLevel { get; set; }
|
||||
}
|
||||
}
|
11
Src/Player/IPlayerData.cs.meta
Normal file
11
Src/Player/IPlayerData.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5643896287a5a394799a8172a15485d6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Src/Player/IPlayerService.cs
Normal file
30
Src/Player/IPlayerService.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace Project.B.Player
|
||||
{
|
||||
public interface IPlayerService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取玩家信息
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
UniTask<IPlayerData> GetPlayerDataAsync(Guid id);
|
||||
/// <summary>
|
||||
/// 获取玩家信息
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
UniTask<IReadOnlyCollection<IPlayerData>> GetPlayersDataAsync(IReadOnlyCollection<Guid> ids);
|
||||
/// <summary>
|
||||
/// 创建或更新玩家信息
|
||||
/// </summary>
|
||||
/// <param name="playerData"></param>
|
||||
/// <returns></returns>
|
||||
UniTask<IPlayerData> CreateOrUpdatePlayerAsync(IPlayerData playerData);
|
||||
}
|
||||
}
|
||||
|
11
Src/Player/IPlayerService.cs.meta
Normal file
11
Src/Player/IPlayerService.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8de5d3a0ae5b33947ae38fe3e415dae3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user