-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,227 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...va/com/github/minecraft_ta/totaldebug/companionApp/messages/CompanionAppReadyMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.github.minecraft_ta.totaldebug.companionApp.messages; | ||
|
||
import com.github.tth05.scnet.message.AbstractMessageIncoming; | ||
import com.github.tth05.scnet.util.ByteBufferInputStream; | ||
|
||
public class CompanionAppReadyMessage extends AbstractMessageIncoming { | ||
|
||
@Override | ||
public void read(ByteBufferInputStream messageStream) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ava/com/github/minecraft_ta/totaldebug/companionApp/messages/script/ClassPathMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.github.minecraft_ta.totaldebug.companionApp.messages.script; | ||
|
||
import com.github.minecraft_ta.totaldebug.TotalDebug; | ||
import com.github.minecraft_ta.totaldebug.util.compiler.InMemoryJavaCompiler; | ||
import com.github.minecraft_ta.totaldebug.util.mappings.ClassUtil; | ||
import com.github.tth05.scnet.message.AbstractMessage; | ||
import com.github.tth05.scnet.util.ByteBufferInputStream; | ||
import com.github.tth05.scnet.util.ByteBufferOutputStream; | ||
import net.minecraft.launchwrapper.LaunchClassLoader; | ||
|
||
import java.net.URISyntaxException; | ||
import java.nio.file.FileSystemNotFoundException; | ||
import java.nio.file.Paths; | ||
import java.util.Objects; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
public class ClassPathMessage extends AbstractMessage { | ||
|
||
@Override | ||
public void read(ByteBufferInputStream messageStream) { | ||
//Acts as a request when received | ||
} | ||
|
||
@Override | ||
public void write(ByteBufferOutputStream messageStream) { | ||
messageStream.writeString(Stream.concat( | ||
((LaunchClassLoader) InMemoryJavaCompiler.class.getClassLoader()).getSources() | ||
.stream() | ||
.map(url -> { | ||
try { | ||
return Paths.get(url.toURI()).toAbsolutePath().normalize().toString(); | ||
} catch (URISyntaxException | FileSystemNotFoundException e) { | ||
return null; | ||
} | ||
}) | ||
.filter(Objects::nonNull) | ||
.filter(s -> !s.contains("akka") && !s.contains("jre\\lib") && !s.contains("jdk") && !s.contains("forge-")), | ||
Stream.of(TotalDebug.PROXY.getMinecraftClassDumpPath().toString()) | ||
).collect(Collectors.joining(";")) | ||
); | ||
} | ||
|
||
public static void handle(ClassPathMessage m) { | ||
CompletableFuture.runAsync(() -> { | ||
ClassUtil.dumpMinecraftClasses(); | ||
TotalDebug.PROXY.getCompanionApp().getClient().getMessageProcessor().enqueueMessage(new ClassPathMessage()); | ||
}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...com/github/minecraft_ta/totaldebug/companionApp/messages/script/ExecutionEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.minecraft_ta.totaldebug.companionApp.messages.script; | ||
|
||
public enum ExecutionEnvironment { | ||
THREAD, | ||
PRE_TICK, | ||
POST_TICK; | ||
} |
Oops, something went wrong.