/// <summary> /// Sends duel response. /// </summary> private void SendDuelResponse(IWorldClient client, DuelResponse response, int characterId) { using var packet = new Packet(PacketType.DUEL_RESPONSE); packet.Write((byte)response); packet.Write(characterId); client.SendPacket(packet); }
private bool HandleClientEventDuelRequestAccepted( NetworkCommunicator peer, DuelResponse message) { if (peer == null || peer.GetComponent <MissionPeer>() == null || (peer.GetComponent <MissionPeer>().ControlledAgent == null || message.Peer == null) || (message.Peer.GetComponent <MissionPeer>() == null || message.Peer.GetComponent <MissionPeer>().ControlledAgent == null)) { return(false); } this.DuelRequestAccepted(message.Peer.GetComponent <DuelMissionRepresentative>().ControlledAgent, peer.GetComponent <DuelMissionRepresentative>().ControlledAgent); return(true); }
void HandleDuelResponse(DuelResponse duelResponse) { if (duelResponse.Accepted && !duelResponse.Forfeited) { HandleDuelAccepted(); } else { HandleDuelCancelled(); } }
private void SendDuelResponse(int senderId, DuelResponse response) => _packetFactory.SendDuelResponse(GameSession.Client, response, senderId);