|
18 | 18 | namespace Intersect.Editor.Networking |
19 | 19 | { |
20 | 20 |
|
| 21 | + internal sealed class VirtualApplicationContext : IApplicationContext |
| 22 | + { |
| 23 | + public VirtualApplicationContext(IPacketHelper packetHelper) |
| 24 | + { |
| 25 | + PacketHelper = packetHelper; |
| 26 | + } |
| 27 | + |
| 28 | + public bool HasErrors => throw new NotImplementedException(); |
| 29 | + |
| 30 | + public bool IsDisposed => throw new NotImplementedException(); |
| 31 | + |
| 32 | + public bool IsStarted => throw new NotImplementedException(); |
| 33 | + |
| 34 | + public bool IsRunning => throw new NotImplementedException(); |
| 35 | + |
| 36 | + public ICommandLineOptions StartupOptions => throw new NotImplementedException(); |
| 37 | + |
| 38 | + public Logger Logger => throw new NotImplementedException(); |
| 39 | + |
| 40 | + public IPacketHelper PacketHelper { get; } |
| 41 | + |
| 42 | + public List<IApplicationService> Services => throw new NotImplementedException(); |
| 43 | + |
| 44 | + public void Dispose() |
| 45 | + { |
| 46 | + throw new NotImplementedException(); |
| 47 | + } |
| 48 | + |
| 49 | + public TApplicationService GetService<TApplicationService>() where TApplicationService : IApplicationService |
| 50 | + { |
| 51 | + throw new NotImplementedException(); |
| 52 | + } |
| 53 | + |
| 54 | + public void Start(bool lockUntilShutdown = true) |
| 55 | + { |
| 56 | + throw new NotImplementedException(); |
| 57 | + } |
| 58 | + |
| 59 | + public LockingActionQueue StartWithActionQueue() |
| 60 | + { |
| 61 | + throw new NotImplementedException(); |
| 62 | + } |
| 63 | + } |
| 64 | + |
21 | 65 | internal static partial class Network |
22 | 66 | { |
23 | 67 |
|
@@ -52,12 +96,13 @@ public static void InitNetwork() |
52 | 96 | ClientConfiguration.Instance.Host, ClientConfiguration.Instance.Port |
53 | 97 | ); |
54 | 98 |
|
| 99 | + var virtualApplicationContext = new VirtualApplicationContext(packetHelper); |
55 | 100 | var assembly = Assembly.GetExecutingAssembly(); |
56 | 101 | using (var stream = assembly.GetManifestResourceStream("Intersect.Editor.network.handshake.bkey.pub")) |
57 | 102 | { |
58 | 103 | var rsaKey = new RsaKey(stream); |
59 | 104 | Debug.Assert(rsaKey != null, "rsaKey != null"); |
60 | | - EditorLidgrenNetwork = new ClientNetwork(packetHelper, config, rsaKey.Parameters); |
| 105 | + EditorLidgrenNetwork = new ClientNetwork(virtualApplicationContext, config, rsaKey.Parameters); |
61 | 106 | } |
62 | 107 |
|
63 | 108 | EditorLidgrenNetwork.Handler = PacketHandler.HandlePacket; |
|
0 commit comments