protected void PlayerReportTrigger(GameOverPlayer gameOverPlayer, IPlayerInfo playerInfo, IFreeArgs freeArgs) { SimpleParable unit = new SimpleParable(); SimpleParaList list = new SimpleParaList(); unit.SetList(list); list.AddFields(new ObjectFields(gameOverPlayer)); list.AddFields(new ObjectFields(_dictGoPlayers)); list.AddFields(new ObjectFields(_dictPlayers)); list.AddFields(new ObjectFields(_dictLeavedPlayers)); IEventArgs args = freeArgs as IEventArgs; if (null != args) { var playerEntity = playerInfo.PlayerEntity as PlayerEntity; args.Trigger(FreeTriggerConstant.PLAYER_REPORT, new TempUnit("report", unit), new TempUnit("current", (FreeData)playerEntity.freeData.FreeData)); } }
public override void DoAction(IEventArgs args) { var msg = GameOverMessage.Allocate(); msg.HallRoomId = args.GameContext.session.commonSession.RoomInfo.HallRoomId; FreeGameRule rule = (FreeGameRule)args.Rule; foreach (PlayerEntity player in args.GameContext.player.GetInitializedPlayerEntities()) { SimpleParable sp = new SimpleParable(); SimpleParaList paras = new SimpleParaList(); sp.SetList(paras); var gameOverPlayer = GameOverPlayer.Allocate(); paras.AddFields(new ObjectFields(gameOverPlayer)); gameOverPlayer.Id = player.playerInfo.PlayerId; args.Act(action, new TempUnit[] { new TempUnit("basic", sp) }); } }