Skip to content

Commit

Permalink
Add some future use fields to RequestPunchOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Oct 23, 2024
1 parent 5daf35a commit cdb7a4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,14 @@ public void requestDirectJoin(long connectionId) {
enqueue(new WorldHostC2SMessage.RequestDirectJoin(connectionId));
}

public void requestPunchOpen(long targetConnection, String purpose, UUID punchId, String myHost, int myPort) {
enqueue(new WorldHostC2SMessage.RequestPunchOpen(targetConnection, purpose, punchId, myHost, myPort));
public void requestPunchOpen(
long targetConnection, String purpose, UUID punchId,
String myHost, int myPort, String myLocalHost, int myLocalPort
) {
enqueue(new WorldHostC2SMessage.RequestPunchOpen(
targetConnection, purpose, punchId,
myHost, myPort, myLocalHost, myLocalPort
));
}

public void punchFailed(long targetConnection, UUID punchId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public void encode(DataOutputStream dos) throws IOException {
}

record RequestPunchOpen(
long targetConnection, String purpose, UUID punchId, String myHost, int myPort
long targetConnection, String purpose, UUID punchId,
String myHost, int myPort, String myLocalHost, int myLocalPort
) implements WorldHostC2SMessage {
@Override
public byte typeId() {
Expand All @@ -191,6 +192,8 @@ public void encode(DataOutputStream dos) throws IOException {
writeUuid(dos, punchId);
writeString(dos, myHost);
dos.writeShort(myPort);
writeString(dos, myLocalHost);
dos.writeShort(myLocalPort);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public static void punch(
PENDING_CLIENT_PUNCHES.put(punchId, new PendingClientPunch(successAction, cancelledAction));
if (WorldHost.protoClient != null) {
WorldHost.protoClient.requestPunchOpen(
connectionId, reason.id(), punchId, myHostAndPort.getHost(), myHostAndPort.getPort()
connectionId, reason.id(), punchId,
myHostAndPort.getHost(), myHostAndPort.getPort(),
"", 0
);
}
}, cancelledAction);
Expand Down

0 comments on commit cdb7a4c

Please sign in to comment.