|
@@ -0,0 +1,37 @@
|
|
|
+using System;
|
|
|
+
|
|
|
+namespace ET.Server
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 玩家特殊效果(buff)
|
|
|
+ /// </summary>
|
|
|
+ [MessageHandler(SceneType.Game)]
|
|
|
+ public class C2G_TriggrBattleFunctionHandler: AMRpcHandler<C2G_TriggrBattleFunction, G2C_TriggrBattleFunction>
|
|
|
+ {
|
|
|
+ protected override async ETTask Run(Session session, C2G_TriggrBattleFunction request, G2C_TriggrBattleFunction 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.EffectID <= 0 || request.Value <= 0 || request.Time <= 0)
|
|
|
+ {
|
|
|
+ Log.Debug($"参数错误...EffectID={request.EffectID}, Value={request.Value}, Time={request.Time}");
|
|
|
+ response.Error = ErrorCode.ERR_ParameterError;
|
|
|
+ reply();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ player.GetXmdsManager().triggrBattleFunction(player.GetId().ToString().Trim(), request.EffectID, request.Value, request.Time, 0, 0, 0 ,0);
|
|
|
+
|
|
|
+ reply();
|
|
|
+
|
|
|
+ await ETTask.CompletedTask;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|