1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-12 19:33:00 +00:00

Fix handling of CC: T's version

We never added back replacing of ${version} strings, which means that CC
was reporting incorrect version numbers in _HOST, the user agent and
network versions. This meant we would allow connections even on
mismatched versions (#464).

We shift all version handling into ComputerCraftAPI(Impl) - this now
relies on Forge code, so we don't want to run it in emulators.
This commit is contained in:
SquidDev
2020-06-19 18:49:19 +01:00
parent 58a2995bbc
commit 48edcde4ef
10 changed files with 66 additions and 43 deletions

View File

@@ -12,6 +12,7 @@ import dan200.computercraft.core.filesystem.FileMount;
import dan200.computercraft.core.filesystem.JarMount;
import dan200.computercraft.core.filesystem.MemoryMount;
import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -73,10 +74,18 @@ public class BasicEnvironment implements IComputerEnvironment
return ComputerCraft.computerSpaceLimit;
}
@Nonnull
@Override
public String getHostString()
{
return "ComputerCraft ${version} (Test environment)";
return "ComputerCraft 1.0 (Test environment)";
}
@Nonnull
@Override
public String getUserAgent()
{
return "ComputerCraft/1.0";
}
@Override