fix voice, pvp

This commit is contained in:
ayunami2000 2022-08-21 22:47:23 -04:00
parent 37c9b4888d
commit a74abf3d4b
7 changed files with 30750 additions and 30746 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -254,7 +254,7 @@ window.initializeVoiceClient = (() => {
}
signalConnect(peerId, offer) {
if (!this.hasInit) initializeDevices();
if (!this.hasInit) this.initializeDevices();
try {
const peerConnection = new RTCPeerConnection({ iceServers: this.ICEServers, optional: [ { DtlsSrtpKeyAgreement: true } ] });
const peerInstance = new EaglercraftVoicePeer(this, peerId, peerConnection, offer);

View file

@ -31,6 +31,7 @@ public class EAGMinecraftServer extends MinecraftServer {
this.gamemode = gamemode;
this.setCanSpawnAnimals(true);
this.setCanSpawnNPCs(true);
this.setAllowPvp(true);
}
public void mainLoop() {

View file

@ -144,7 +144,7 @@ public class VoiceChatPlugin {
dos2.write(sig);
dos2.writeUTF(user);
dos2.writeUTF(data);
player.playerNetServerHandler.sendPacket(new Packet250CustomPayload("EAG|Voice", baos2.toByteArray()));
voicePlayers.get(targetUser2).playerNetServerHandler.sendPacket(new Packet250CustomPayload("EAG|Voice", baos2.toByteArray()));
}
break;
default:
@ -163,7 +163,6 @@ public class VoiceChatPlugin {
public static void activate(List<String> ice) {
if(iceServers.size() == 0) {
iceServers.clear();
iceServers.addAll(ice);
for(Object o : MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
handleConnect((EntityPlayerMP) o);