29 lines
836 B
Java
29 lines
836 B
Java
package im.rosetta.executors;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import im.rosetta.packet.Packet28IceServers;
|
|
import im.rosetta.service.services.ForwardUnitService;
|
|
import io.orprotocol.ProtocolException;
|
|
import io.orprotocol.client.Client;
|
|
import io.orprotocol.packet.PacketExecutor;
|
|
|
|
public class Executor28IceServers extends PacketExecutor<Packet28IceServers> {
|
|
|
|
private ForwardUnitService fus;
|
|
|
|
public Executor28IceServers(ForwardUnitService fus) {
|
|
this.fus = fus;
|
|
}
|
|
|
|
@Override
|
|
public void onPacketReceived(Packet28IceServers packet, Client client) throws Exception, ProtocolException {
|
|
/**
|
|
* Берем TURN сервера и отправляем их клиенту
|
|
*/
|
|
packet.setIceServers(new ArrayList<>(this.fus.getTurnServers()));
|
|
client.send(packet);
|
|
}
|
|
|
|
}
|