mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-03-11 10:27:17 +08:00
Add co-op lyre support (#2105)
This commit is contained in:
parent
9dbca6dc1b
commit
c905d493af
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
package emu.grasscutter.server.packet.recv;
|
||||||
|
|
||||||
|
import javax.lang.model.type.TypeMirror;
|
||||||
|
|
||||||
|
import emu.grasscutter.net.packet.Opcodes;
|
||||||
|
import emu.grasscutter.net.packet.PacketHandler;
|
||||||
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
|
import emu.grasscutter.net.proto.SceneAudioNotifyOuterClass.SceneAudioNotify;
|
||||||
|
import emu.grasscutter.server.game.GameSession;
|
||||||
|
import emu.grasscutter.server.packet.send.PacketSceneAudioNotify;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Opcodes(PacketOpcodes.SceneAudioNotify)
|
||||||
|
public class HandlerSceneAudioNotify extends PacketHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
|
SceneAudioNotify notify = SceneAudioNotify.parseFrom(payload);
|
||||||
|
|
||||||
|
int sourceUid = notify.getSourceUid();
|
||||||
|
List<Float> param2 = notify.getParam2List();
|
||||||
|
List<String> param3 = notify.getParam3List();
|
||||||
|
int type = notify.getType();
|
||||||
|
List<Integer> param1 = notify.getParam1List();
|
||||||
|
|
||||||
|
session.getPlayer().getScene().broadcastPacket(new PacketSceneAudioNotify(sourceUid, param2, param3, type, param1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
package emu.grasscutter.server.packet.send;
|
||||||
|
|
||||||
|
import emu.grasscutter.net.packet.BasePacket;
|
||||||
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
|
import emu.grasscutter.net.proto.SceneAudioNotifyOuterClass;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PacketSceneAudioNotify extends BasePacket {
|
||||||
|
|
||||||
|
public PacketSceneAudioNotify(int sourceUid, List<Float> param2, List<String> param3, int type, List<Integer> param1) {
|
||||||
|
super(PacketOpcodes.SceneAudioNotify);
|
||||||
|
|
||||||
|
SceneAudioNotifyOuterClass.SceneAudioNotify proto = SceneAudioNotifyOuterClass.SceneAudioNotify.newBuilder()
|
||||||
|
.setSourceUid(sourceUid)
|
||||||
|
.addAllParam2(param2)
|
||||||
|
.addAllParam3(param3)
|
||||||
|
.setType(type)
|
||||||
|
.addAllParam1(param1)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
this.setData(proto);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user