接口 StatActionInOut.StatActionChangeListener

封闭类:
StatActionInOut

public static interface StatActionInOut.StatActionChangeListener
action 调用统计插件 - StatAction 更新监听
  • 方法详细资料

    • changed

      void changed(StatActionInOut.StatAction statAction, long time, FlowContext flowContext)
      StatAction 统计记录更新后调用
      参数:
      statAction - action 统计记录
      time - action 执行耗时
      flowContext - flowContext
    • createTimeRangeList

      default List<StatActionInOut.TimeRange> createTimeRangeList()
      创建时间范围;如果想将统计分得更细,只需要创建更多的时间范围。

      参考示例

      
            List.of(
                TimeRange.create(500, 1000),
                TimeRange.create(1000, 1500),
                TimeRange.create(1500, 2000),
                TimeRange.create(2000, Long.MAX_VALUE, "> 2000"))
       
       
      返回:
      时间范围,List 必须非空
    • triggerUpdateTimeRange

      default boolean triggerUpdateTimeRange(StatActionInOut.StatAction statAction, long time, FlowContext flowContext)
      触发条件,触发 updateTimeRange 方法的前置条件
           开发者可以通常此方法来决定是否触发 updateTimeRange 方法。
      
           比如可以在该方法内判断,只对某个或某些玩家来做监控。
       
      参数:
      statAction - action 统计记录
      time - action 执行耗时
      flowContext - flowContext
      返回:
      true 表示满足条件;当为 true 时,会调用 updateTimeRange 方法
    • updateTimeRange

      default void updateTimeRange(StatActionInOut.StatAction statAction, long time, FlowContext flowContext)
      StatAction 统计记录更新中调用,当 trigger 方法为 true 时会调用
      参数:
      statAction - action 统计记录
      time - action 执行耗时
      flowContext - flowContext
    • flow

      default void flow(StatActionInOut.StatAction statAction, long time, FlowContext flowContext)
      StatAction 更新监听流程
           默认实现的流程为
           1 先判断 triggerUpdateTimeRange 是否满足条件
           2 当 triggerUpdateTimeRange 为 true 时,会执行 updateTimeRange
           3 无论如何 changed 总是会被执行的
       
      参数:
      statAction - action 统计记录
      time - action 执行耗时
      flowContext - flowContext