1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- namespace ET.Server
- {
-
-
-
- [MessageHandler(SceneType.Game)]
- public class C2G_RemoveUnitHandler: AMRpcHandler<C2G_RemoveUnit, G2C_RemoveUnit>
- {
- protected override async ETTask Run(Session session, C2G_RemoveUnit request, G2C_RemoveUnit response, Action reply)
- {
- WNPlayer player = session.GetComponent<SessionPlayerComponent>().GetMyPlayer();
- if (player == null)
- {
- Log.Debug($"操作错误, player is null");
- response.Error = ErrorCode.ERR_OperationError;
- reply();
- return;
- }
-
- if (request.UnitId <= 0)
- {
- Log.Debug($"参数错误...unitId={request.UnitId}");
- response.Error = ErrorCode.ERR_ParameterError;
- reply();
- return;
- }
- await player.Map.RemovePointUnit(request.UnitId);
- reply();
- }
- }
- }
|