public void Start(RemoteConnectionToken server, bool render = true) { DoRender = render; _node = new NetworkNode(); _node.Start(false); _connected = _node.Connect(server); if (render) { _win = new RenderWindow(new VideoMode(1024, 720), "SimpleGame"); _win.SetVerticalSyncEnabled(true); _win.Closed += RenderWindow_Closed; } EnvironmentAPI.Input = new SFMLInput() { _win = _win }; EnvironmentAPI.Draw = new SFMLDrawApi() { _win = _win }; EnvironmentAPI.Time = new SFMLTime(); EnvironmentAPI.Win = new SFMLWindowApi() { _win = _win }; _charView = new View(); _physicsWorld = new VoltWorld(); _node.CustomData = _physicsWorld; var map = DefsHolder.Instance.LoadDef <MapDef>("/TestMapDef"); _debugCreator = new LocationCreator(map.Locations[0].CreatorDef, 0); _debugCreator.Setup(map.Locations[0].RootSite, map.Locations[0].Pos, map.Locations[0].Rot); while (_debugCreator.Tick()) { ; } }
public void Connect() { NetworkNode.Connect(this); OnConnect?.Invoke(); }