public void NotifyPing(ClientInfo client, Vector2 pos, int targetNetId, Pings type) { var ping = new AttentionPingRequest(pos.X, pos.Y, targetNetId, type); var response = new AttentionPingResponse(client, ping); _packetHandlerManager.BroadcastPacketTeam(client.Team, response, Channel.CHL_S2C); }
public override void Execute(Peer peer, bool hasReceivedArguments, string arguments = "") { var split = arguments.ToLower().Split(' '); if (split.Length < 2) { ChatCommandManager.SendDebugMsgFormatted(DebugMsgType.SYNTAXERROR); ShowSyntax(); return; } int team; if (!int.TryParse(split[1], out team)) { return; } var units = _game.ObjectManager.GetObjects() .Where(xx => xx.Value.Team == CustomConvert.ToTeamId(team)) .Where(xx => xx.Value is Minion || xx.Value is Monster); foreach (var unit in units) { var ping = new AttentionPingRequest(unit.Value.X, unit.Value.Y, 0, Pings.Ping_Danger); var client = _playerManager.GetPeerInfo(peer); var response = new AttentionPingResponse(client, ping); _game.PacketHandlerManager.broadcastPacketTeam(client.Team, response, Channel.CHL_S2C); } }
public override bool HandlePacket(Peer peer, byte[] data) { var ping = new AttentionPingRequest(data); var response = new AttentionPingResponse(_playerManager.GetPeerInfo(peer), ping); var team = _playerManager.GetPeerInfo(peer).Team; return(_game.PacketHandlerManager.broadcastPacketTeam(team, response, Channel.CHL_S2C)); }
public AttentionPingResponse(ClientInfo player, AttentionPingRequest ping) : base(PacketCmd.PKT_S2C_AttentionPing) { buffer.Write((float)ping.x); buffer.Write((float)ping.y); buffer.Write((int)ping.targetNetId); buffer.Write((int)player.Champion.NetId); buffer.Write((byte)ping.type); buffer.Write((byte)0xFB); // 4.18 }
public AttentionPingResponse(ClientInfo player, AttentionPingRequest ping) : base(PacketCmd.PKT_S2C_ATTENTION_PING) { Write((float)ping.X); Write((float)ping.Y); Write((int)ping.TargetNetId); WriteNetId(player.Champion); Write((byte)ping.Type); Write((byte)0xFB); // 4.18 }