static void Main(string[] args) { ServerConnectionManager server = new ServerConnectionManager(); server.StartServer(); Console.ReadLine(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services .AddTokenAuthentication(Configuration) .AddAuthorization() .AddControllers() .AddJsonOptions(o => { o.JsonSerializerOptions.WriteIndented = true; }); services.AddRouting(r => r.LowercaseUrls = true); #if DEBUG // Register the Swagger generator, defining 1 or more Swagger documents // https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-3.1&tabs=visual-studio services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "CertifyServer - Certificate Server API", Version = "v1", Description = "CertifyServer provides a certificate services API for use in devops, CI/CD, middleware etc. Certificates are managed by Certify The Web on the primary server using ACME, with API access controlled using API tokens." }); // declare authorization method c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"", Name = "Authorization", Scheme = "bearer", BearerFormat = "JWT", In = ParameterLocation.Header, Type = SecuritySchemeType.Http }); // set security requirement c.AddSecurityRequirement(new OpenApiSecurityRequirement { { new OpenApiSecurityScheme { Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" } }, new List <string>() } }); }); #endif // connect to certify service var configManager = new ServiceConfigManager(); var defaultConnectionConfig = new Shared.ServerConnection(configManager.GetServiceConfig()); var connections = ServerConnectionManager.GetServerConnections(null, defaultConnectionConfig); var serverConnection = connections.FirstOrDefault(c => c.IsDefault = true); services.AddSingleton(typeof(Certify.Client.ICertifyInternalApiClient), new Client.CertifyApiClient(configManager, serverConnection)); }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; /* * string file = @"D:\Dev\Korsak\resp.html"; * string sDocument = File.ReadAllText(file); * * var doc = new HtmlDocument(); * doc.Load(new StringReader(sDocument)); * * string hosts = doc.DocumentNode.SelectSingleNode(@"//body/div").InnerText.Trim(); * * string[] parts = hosts.Split(new string[] { "Total Visits" }, 2, StringSplitOptions.RemoveEmptyEntries); * string totalVisits = parts.Length >= 2 ? (parts[1] ?? string.Empty) : string.Empty; * * totalVisits = totalVisits.Trim(); * * parts = totalVisits.Split(new string[] { "\n" }, 2, StringSplitOptions.RemoveEmptyEntries); * * totalVisits = parts.Length >= 2 ? (parts[0] ?? string.Empty) : string.Empty; */ ServerConnectionManager server = new ServerConnectionManager(); server.StartServer(); Console.ReadLine(); }
internal RepositoryTreeModel(ServerConnectionManager connManager, TreeViewAdv tree, OpenResourceManager openResMgr, ClipboardService clip) { _connManager = connManager; _tree = tree; _openResMgr = openResMgr; _clip = clip; }
/// <summary> /// Get list of known server connection /// </summary> /// <returns></returns> public List <ServerConnection> GetServerConnections() { var defaultConfig = new ServerConnection(GetAppServiceConfig()); var connections = ServerConnectionManager.GetServerConnections(Log, defaultConfig); return(connections); }
private void Awake() { if (Instance == null) { Instance = this; server = new Server(sendToChannel); } else { Destroy(this); } }
public CardGameManager(ServerConnectionManager connection) { m_connection = connection; CGPlayerLogic player1 = new CGPlayerLogic(this, 0); CGPlayerLogic player2 = new CGPlayerLogic(this, 1); m_players = new List <CGPlayerLogic> { player1, player2 }; m_activePlayer = player1; }
public void GetIndicators() { try { ServerConnectionManager.GetIndicatorsFromServer(IndicatorList); CreateIndicatorsText(); UpdateMap(); } catch (ServerConnectionManager.FlightSimulatorConnectionException) { Disconnected = true; } }
/// <summary> /// Get the default connection for backend service /// </summary> /// <param name="configProvider"></param> /// <returns></returns> public ServerConnection GetDefaultServerConnection(IServiceConfigProvider configProvider) { var defaultConfig = new ServerConnection(GetAppServiceConfig()); var connections = ServerConnectionManager.GetServerConnections(Log, defaultConfig); if (connections.Any() && connections.Count() == 1) { ServerConnectionManager.Save(Log, connections); } return(connections.FirstOrDefault(c => c.IsDefault == true)); }
public OpenResourceIdDialog(ServerConnectionManager connMgr) : this() { var items = new List <KeyValuePair <string, IServerConnection> >(); foreach (var name in connMgr.GetConnectionNames()) { items.Add(new KeyValuePair <string, IServerConnection>(name, connMgr.GetConnection(name))); } cmbConnection.DisplayMember = "Key"; //NOXLATE cmbConnection.DataSource = items; cmbConnection.SelectedIndex = 0; }
private bool ShowLoginWindow() { var loginWindow = new LoginWindow(); loginWindow.ShowDialog(); if (loginWindow.ResultConnectionManager == null) { return(false); } ConnectionManager = loginWindow.ResultConnectionManager; return(true); }
private bool logiInRequest(string sLogIn, string sPassword) { ServerConnectionManager SCM = new ServerConnectionManager(); WebClient client = new WebClient(); Uri uri = new Uri("http://www.offroadresque.eu/login.php"); NameValueCollection parameters = new NameValueCollection(); parameters.Add("loguj", "loguj"); parameters.Add("login", sLogIn); parameters.Add("haslo", sPassword); client.UploadValuesCompleted += client_UploadValuesCompleted2; client.UploadValuesAsync(uri, "POST", parameters); return(true); }
static void Main(string[] args) { var connection = new ServerConnectionManager("http://localhost"); var dispatcher = new ServerEventDispatcher(connection); var screen = new VirtualScreenManager(); var hook = new HookManager(dispatcher, screen); ClientState.Logger = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Warning)).CreateLogger("OTB"); hook.Start(); hook.Hook.SendKeyDown(Core.Hook.Key.WinLeft); hook.Hook.SendKeyUp(Core.Hook.Key.WinLeft); hook.Stop(); Console.ReadKey(); Console.Read(); }
private void OnServerInitialized() { if (serverInitialized) { return; } Analytics.Collect(); HoldfastExtension.ServerConsole(); SteamGameServer.SetGameTags("modded,oxide"); messageManager = ServerComponentReferenceManager.ServerInstance.serverAdminBroadcastMessageManager; banManager = ServerComponentReferenceManager.ServerInstance.serverBannedPlayersManager; serverConfig = ServerConfigurationFileManager.CurrentConfigurationFile; connectionManager = ServerComponentReferenceManager.ServerInstance.serverConnectionManager; gameDetails = ServerComponentReferenceManager.ServerInstance.serverGameManager.CreateGameDetailsFromConfigFile(0); gameManager = ServerComponentReferenceManager.ServerInstance.serverGameManager; serverInitialized = true; }
public MainWindow() { // connect to database if autoconnect is active if (Settings.Contains(Property.AutoConnect) && Settings.Contains(Property.LastServer) && Settings.Contains(Property.LastUser)) { ConnectionManager = new ServerConnectionManager(); ConnectionManager.Connect(Settings.GetValue(Property.LastServer), Settings.GetValue(Property.LastUser), LoginWindow.GetDecryptedPassword(), "my_sound_lib"); } else { if (!ShowLoginWindow()) { Close(); return; } } InitializeComponent(); InitialiseFirstView(); }
private void ButtonConnect_Click(object sender, RoutedEventArgs e) { var connectionManager = new ServerConnectionManager(); var connectionSuccess = connectionManager.Connect(TextBoxServer.Text, TextBoxUser.Text, TextBoxPassword.Password, "my_sound_lib"); if (!connectionSuccess) { return; } ResultConnectionManager = connectionManager; Settings.SetProperty(Property.LastServer, TextBoxServer.Text); Settings.SetProperty(Property.LastUser, TextBoxUser.Text); if (CheckBoxSavePassword.IsChecked != null && (bool)CheckBoxSavePassword.IsChecked) { var passwordPlain = Encoding.UTF8.GetBytes(TextBoxPassword.Password); var ciphertext = ProtectedData.Protect(passwordPlain, Entropy, DataProtectionScope.CurrentUser); Settings.SetProperty(Property.LastPassword, ByteArrayToString(ciphertext)); } if (CheckBoxAutoConnect.IsChecked != null && CheckBoxAutoConnect.IsChecked.Value) { Settings.SetProperty(Property.AutoConnect, "true"); } else { if (Settings.Contains(Property.AutoConnect)) { Settings.RemoveProperty(Property.AutoConnect); } } Settings.SaveConfig(); Close(); }
public TestWindow(ServerConnectionManager connectionManager) { InitializeComponent(); _connectionManager = connectionManager; LabelAmountBytesForLocalSongs.Content = Settings.GetSizeOfLocalSongs(); }
private Maestro.Editors.RepositoryHandle[] CollectDependentResources(RepositoryItem[] items, ServerConnectionManager connMgr) { var ids = new List <Maestro.Editors.RepositoryHandle>(); foreach (var it in items) { var conn = connMgr.GetConnection(it.ConnectionName); if (it.IsFolder) { ids.Add(new Editors.RepositoryHandle(new ResourceIdentifier(it.ResourceId), conn)); break; } try { var references = conn.ResourceService.EnumerateResourceReferences(it.ResourceId); ids.AddRange(references.ResourceId.Select(x => new Maestro.Editors.RepositoryHandle(new ResourceIdentifier(x), conn))); } catch //Back-referencing may not be supported { } } return(ids.ToArray()); }
public void Prepare() { _server = new ServerConnectionManager(); }
protected static void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr) { //Reset state of clipboarded items if (clip.HasContent()) { object o = clip.Get(); var r = o as RepositoryItem; var rs = o as RepositoryItem[]; if (r != null) { var conn = connMgr.GetConnection(r.ConnectionName); ResetItem(omgr, r, conn); } else if (rs != null) { ResetItems(omgr, rs, connMgr); } } }
public AboutWindow(ServerConnectionManager connectionManager) { InitializeComponent(); _connectionManager = connectionManager; }
private bool ShowLoginWindow() { var loginWindow = new LoginWindow(); loginWindow.ShowDialog(); if (loginWindow.ResultConnectionManager == null) return false; ConnectionManager = loginWindow.ResultConnectionManager; return true; }
/// <summary> /// Initializes a new instance of the <see cref="T:FluToDo.ViewModel.CreateNewItemViewModel"/> class. /// </summary> public CreateNewItemViewModel() { this.serverConnectionManager = new ServerConnectionManager(); this.serverConnectionManager.OnCreateTaskCompleted += OnCreateNewItemCompleted; }
private void ButtonConnect_Click(object sender, RoutedEventArgs e) { var connectionManager = new ServerConnectionManager(); var connectionSuccess = connectionManager.Connect(TextBoxServer.Text, TextBoxUser.Text, TextBoxPassword.Password, "my_sound_lib"); if (!connectionSuccess) return; ResultConnectionManager = connectionManager; Settings.SetProperty(Property.LastServer, TextBoxServer.Text); Settings.SetProperty(Property.LastUser, TextBoxUser.Text); if (CheckBoxSavePassword.IsChecked != null && (bool) CheckBoxSavePassword.IsChecked) { var passwordPlain = Encoding.UTF8.GetBytes(TextBoxPassword.Password); var ciphertext = ProtectedData.Protect(passwordPlain, Entropy, DataProtectionScope.CurrentUser); Settings.SetProperty(Property.LastPassword, ByteArrayToString(ciphertext)); } if (CheckBoxAutoConnect.IsChecked != null && CheckBoxAutoConnect.IsChecked.Value) { Settings.SetProperty(Property.AutoConnect, "true"); } else { if (Settings.Contains(Property.AutoConnect)) { Settings.RemoveProperty(Property.AutoConnect); } } Settings.SaveConfig(); Close(); }
protected override void OnStart(string[] args) { server = new ServerConnectionManager(); server.StartServer(); }
public CardGameServer() { m_connection = new ServerConnectionManager(); m_playerTimeouts[0] = CONNECTION_TIMEOUT_LOOPS; m_playerTimeouts[1] = CONNECTION_TIMEOUT_LOOPS; }
/// <summary> /// Initializes a new instance of the <see cref="T:FluToDo.ViewModel.TodoListItemViewModel"/> class. /// </summary> public TodoListItemViewModel() { this.serverConnectionManager = new ServerConnectionManager(); }
protected static void ResetItems(OpenResourceManager omgr, IEnumerable <RepositoryItem> rs, ServerConnectionManager connMgr) { foreach (var ri in rs) { var conn = connMgr.GetConnection(ri.ConnectionName); ResetItem(omgr, ri, conn); } }
public ResourceIdNavigator(ServerConnectionManager connMgr, OpenResourceManager omgr, ViewContentManager viewMgr, ISiteExplorer siteExp, Workbench wb) { _connMgr = connMgr; _connMgr.ConnectionAdded += WeakEventHandler.Wrap <ServerConnectionEventHandler>(OnConnectionAdded, (eh) => _connMgr.ConnectionAdded -= eh); _connMgr.ConnectionRemoved += WeakEventHandler.Wrap <ServerConnectionEventHandler>(OnConnectionRemoved, (eh) => _connMgr.ConnectionRemoved -= eh); _omgr = omgr; _viewMgr = viewMgr; _viewMgr.ViewActivated += WeakEventHandler.Wrap <ViewEventHandler>(OnViewActivated, (eh) => _viewMgr.ViewActivated -= eh); _siteExp = siteExp; _siteExp.ItemsSelected += WeakEventHandler.Wrap <RepositoryItemEventHandler>(OnSiteExplorerItemsSelected, (eh) => _siteExp.ItemsSelected -= eh); _strip = new ToolStrip(); _strip.Layout += WeakEventHandler.Wrap <LayoutEventHandler>(OnToolStripLayout, (eh) => _strip.Layout -= eh); _strip.Stretch = true; _resIdLabel = new ToolStripLabel(Strings.Label_ResourceID); _cmbResourceId = new ToolStripComboBox(); _cmbResourceId.AutoSize = false; _cmbResourceId.Width = 250; _cmbResourceId.TextChanged += WeakEventHandler.Wrap(OnResourceIdChanged, (eh) => _cmbResourceId.TextChanged -= eh); _cmbResourceId.KeyUp += WeakEventHandler.Wrap <KeyEventHandler>(OnResourceIdKeyUp, (eh) => _cmbResourceId.KeyUp -= eh); _atLabel = new ToolStripLabel("@"); //NOXLATE _cmbActiveConnections = new ToolStripComboBox(); _cmbActiveConnections.AutoSize = false; _cmbActiveConnections.Width = 250; _cmbActiveConnections.ComboBox.SelectedIndexChanged += WeakEventHandler.Wrap(OnActiveConnectionChanged, (eh) => _cmbActiveConnections.ComboBox.SelectedIndexChanged -= eh); _cmbActiveConnections.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; _btnGo = new ToolStripButton(Strings.Label_Open); _btnGo.Image = Properties.Resources.arrow; _btnGo.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; _btnGo.TextImageRelation = TextImageRelation.TextBeforeImage; _btnGo.ToolTipText = Strings.Label_OpenResource; _btnGo.Click += WeakEventHandler.Wrap(btnGo_Click, (eh) => _btnGo.Click -= eh); _btnOpenAsXml = new ToolStripButton(Strings.Label_OpenAsXml); _btnOpenAsXml.Image = Properties.Resources.arrow; _btnOpenAsXml.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; _btnOpenAsXml.TextImageRelation = TextImageRelation.TextBeforeImage; _btnOpenAsXml.ToolTipText = Strings.Label_OpenResourceAsXml; _btnOpenAsXml.Click += WeakEventHandler.Wrap(btnOpenAsXml_Click, (eh) => _btnOpenAsXml.Click -= eh); UpdateConnectionList(); UpdateNavigationState(); _strip.Items.AddRange(new ToolStripItem[] { _resIdLabel, _cmbResourceId, _atLabel, _cmbActiveConnections, _btnGo, _btnOpenAsXml }); wb.Theme?.ApplyTo(_strip); }
private new static void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr) { //Reset state of clipboarded items if (clip.HasContent()) { object o = clip.Get(); var r = o as RepositoryItem; var rs = o as RepositoryItem[]; if (r != null) { var conn = connMgr.GetConnection(r.ConnectionName); r.Reset(); if (omgr.IsOpen(r.ResourceId, conn)) { r.IsOpen = true; var ed = omgr.GetOpenEditor(r.ResourceId, conn); if (ed.IsDirty) { r.IsDirty = true; } } } else if (rs != null) { foreach (var ri in rs) { var conn = connMgr.GetConnection(ri.ConnectionName); ri.Reset(); if (omgr.IsOpen(ri.ResourceId, conn)) { ri.IsOpen = true; var ed = omgr.GetOpenEditor(ri.ResourceId, conn); if (ed.IsDirty) { ri.IsDirty = true; } } } } } }