27 lines
868 B
C#
27 lines
868 B
C#
|
using System;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
[ActorMessageHandler]
|
|||
|
public class C2M_GetUIDByNameHandler: AMActorLocationRpcHandler<Unit, C2M_GetUIDByName, M2C_GetUIDByName>
|
|||
|
{
|
|||
|
protected override async ETTask Run(Unit unit, C2M_GetUIDByName request, M2C_GetUIDByName respones, Action reply)
|
|||
|
{
|
|||
|
if (!AppConfig.inst.whiteIds.Contains(unit.Id))
|
|||
|
{
|
|||
|
respones.Message = "对不起,您没有权限!";
|
|||
|
reply();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
var list = await DBComponent.Instance.Query<User>(t => t.NickName.Contains(request.name));
|
|||
|
foreach (User user in list)
|
|||
|
{
|
|||
|
respones.map.Add(new KV_string_int32() { key = user.NickName, value = (int) user.Id });
|
|||
|
}
|
|||
|
|
|||
|
reply();
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|