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.
34 lines
965 B
34 lines
965 B
using System; |
|
using System.Collections.Generic; |
|
|
|
namespace ET |
|
{ |
|
[ActorMessageHandler] |
|
public class C2M_EmbattleHandler: AMActorLocationRpcHandler<Unit, C2M_Embattle, M2C_Embattle> |
|
{ |
|
protected async override ETTask Run(Unit unit, C2M_Embattle request, M2C_Embattle response, Action reply) |
|
{ |
|
|
|
try |
|
{ |
|
var fighterDic = new Dictionary<int, long>(); |
|
for (int i = 0; i < request.Ks.Count; i++) |
|
{ |
|
fighterDic[request.Ks[i]] = request.Vs[i]; |
|
} |
|
|
|
unit.SetEmbattle(fighterDic); |
|
response.Error = ErrorCode.ERR_Success; |
|
reply(); |
|
} |
|
catch (Exception e) |
|
{ |
|
response.Error = ErrorCode.ERR_BuildError; |
|
response.Message = e.ToString(); |
|
reply(); |
|
} |
|
|
|
await ETTask.CompletedTask; |
|
} |
|
} |
|
} |