public override void DoAction(IEventArgs args) { PlayerEntity player = GetPlayerEntity(args); if (player == null) { return; } if (args.Rule.ServerTime - player.statisticsData.Statistics.LastDeadTime <= 2900L) { return; } int oldObserveId = player.gamePlay.CameraEntityId; bool success = ObservePlayer(args, player, args.GetBool(observeEnemy), args.GetBool(wise)); if (!success) { if (noOneAction != null) { noOneAction.Act(args); } } if (oldObserveId != player.gamePlay.CameraEntityId) { SimpleProto sp = FreePool.Allocate(); sp.Key = FreeMessageConstant.PlayerObserveTrigger; sp.Bs.Add(true); FreeMessageSender.SendMessage(player, sp); } }
public override void DoAction(IEventArgs args) { FreeData fd = GetPlayer(args); bool success = ObservePlayer(args, fd, args.GetBool(observeEnemy), args.GetBool(wise)); if (!success) { if (noOneAction != null) { noOneAction.Act(args); } } }
public override void DoAction(IEventArgs args) { PlayerEntity p = GetPlayerEntity(args); if (p != null) { PlayerEntityUtility.SetActive(p, args.GetBool(enable), EActiveMask.DisableAction); } }
public override void DoAction(IEventArgs args) { PlayerEntity player = GetPlayerEntity(args); SimpleProto msg = FreePool.Allocate(); msg.Key = FreeMessageConstant.PlayerPressKey; msg.Bs.Add(args.GetBool(press)); msg.Ss.Add(key); msg.Ins.Add(args.GetInt(time)); FreeMessageSender.SendMessage(player, msg); }
protected override void BuildMessage(IEventArgs args) { builder.Key = args.GetInt(key); if (fields != null) { for (int i = 0; i < fields.Count; i++) { switch (fields[i].type) { case KeyField: builder.Ks.Add(args.GetInt(fields[i].value)); break; case IntField: builder.Ins.Add(args.GetInt(fields[i].value)); break; case BoolField: builder.Bs.Add(args.GetBool(fields[i].value)); break; case StringField: builder.Ss.Add(args.GetString(fields[i].value)); break; case FloatField: builder.Fs.Add(args.GetFloat(fields[i].value)); break; case DoubleField: builder.Ds.Add(args.getDouble(fields[i].value)); break; case LongField: builder.Ls.Add(args.GetLong(fields[i].value)); break; } } } }