Skip to content

Commit

Permalink
switch to using new protoweaver function
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNavaStar committed Dec 16, 2024
1 parent c8af4d0 commit 871bf8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ velocity_version=3.4.0-SNAPSHOT
sqlib_version=3.2.4

# Dependencies
protoweaver_version=1.3.15
protoweaver_version=1.3.16
r_version=1.0.8
# https://projectlombok.org/setup/maven
lombok_version=1.18.36
12 changes: 2 additions & 10 deletions proxy/src/main/java/me/mrnavastar/singularity/loader/Velocity.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onServerPreConnect(ServerPreConnectEvent event) {

@Override
public void onReady(ProtoConnection connection) {
ProtoProxy.getConnectedServer(WORMHOLE, connection.getRemoteAddress())
ProtoProxy.getConnectedServer(connection)
.flatMap(SingularityConfig::getSyncGroup)
.ifPresent(group -> {
connection.send(group.getSettings());
Expand All @@ -100,15 +100,7 @@ public void onReady(ProtoConnection connection) {
public void handlePacket(ProtoConnection connection, Object packet) {
System.out.println("Got packet from: " + connection + " of type: " + packet);

System.out.println();
ProtoProxy.getRegisteredServers().forEach(server -> {
System.out.println(server);
System.out.println(connection.getRemoteAddress());
System.out.println(server.getAddress().equals(connection.getRemoteAddress()));
});
System.out.println();

ProtoProxy.getConnectedServer(WORMHOLE, connection.getRemoteAddress()).ifPresent(server -> {
ProtoProxy.getConnectedServer(connection).ifPresent(server -> {
System.out.println("Server " + server + " is connected, able to handle packet");

switch (packet) {
Expand Down

0 comments on commit 871bf8d

Please sign in to comment.