You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
830 B
28 lines
830 B
using System; |
|
|
|
namespace ET.Gm.Handler |
|
{ |
|
public class M2C_GMAddItemHandler:AMActorLocationRpcHandler<Unit, C2M_GMAddItem, M2C_GMAddItem> |
|
{ |
|
protected override async ETTask Run(Unit unit, C2M_GMAddItem request, M2C_GMAddItem response, Action reply) |
|
{ |
|
try |
|
{ |
|
var storeNc = unit.GetComponent<StoreComponent>(); |
|
for (int i = 0; i < request.Ks.Count; i++) |
|
{ |
|
storeNc.Add(request.Ks[i], request.Vs[i]); |
|
} |
|
response.Error = ErrorCode.ERR_Success; |
|
reply(); |
|
} |
|
catch (Exception e) |
|
{ |
|
response.Message = e.ToString(); |
|
reply(); |
|
} |
|
|
|
await ETTask.CompletedTask; |
|
} |
|
} |
|
} |