public static void Initialize() { AbstractFactory.Clear(); ForgeRegistration.Initialize(); RegisterFactoryInterfaces(); SetupExtraSerializers(); }
private static void Main(string[] args) { ForgeRegistration.Initialize(); var factory = AbstractFactory.Get <INetworkTypeFactory>(); factory.Register <IRegisterAsServerInterpreter, RegisterAsServerInterpreter>(); factory.Register <IGetServerRegistryInterpreter, GetServerRegistryInterpreter>(); factory.Replace <INetPlayer, NetworkPlayer>(); var networkMediator = factory.GetNew <INetworkMediator>(); networkMediator.ChangeEngineProxy(new ServerRegistryEngine()); networkMediator.StartServer(15940, 100); try { while (true) { networkMediator.SocketFacade.CancellationSource.Token.ThrowIfCancellationRequested(); string line = Console.ReadLine().Trim(); switch (line) { case "exit": case "quit": networkMediator.SocketFacade.CancellationSource.Cancel(); break; default: Console.WriteLine($"This command isn't supported yet"); break; } } } catch (OperationCanceledException) { } }
public virtual void Teardown() { ForgeRegistration.Teardown(); }
public virtual void Setup() { ForgeRegistration.Initialize(); }