예제 #1
0
        public Session(ILeaderboardService leaderboardService, string gameId)
        {
            // also noted int MachineInfo - this might be the most difficult thing to port. See MachineInfo for details
            SessionBeginTime   = DateTime.Now;
            LeaderboardService = leaderboardService;
            UserId             = MachineInfo.GetMacAddress();
            var leaderboard = leaderboardService.GetLeaderboardByGameId(gameId);

            Player = leaderboard.GetPlayerByUniqueId(UserId);
            if (null == Player)
            {
                Player = new LeaderboardPlayer()
                {
                    UniqueId = UserId
                }
            }
            ;
            leaderboard.AddPlayer(Player);
        }
예제 #2
0
        private void frmAbout_Load(object sender, EventArgs e)
        {
            DateTime buildDate = File.GetLastWriteTime(Assembly.GetExecutingAssembly().Location);

            lblAppVersion.Text  = $"Version: {Application.ProductVersion}";
            lblBuildDate.Text   = $"Build Date: {buildDate:MM-dd-yyyy}";
            lblMachineName.Text = $"Machine Name: {MachineInfo.MachineName}";
            lblIPAddress.Text   = $"IP Address: {MachineInfo.IPAddress}";
            lblMacAddress.Text  = $"Mac Address: {MachineInfo.GetMacAddress()}";

            if (EnvironmentSettings.GetEnvironmentVariable() == null)
            {
                lblServer.Text = "Server: Agent environment variable not found";
            }

            string agentSettingsPath = Path.Combine(EnvironmentSettings.GetEnvironmentVariable(), EnvironmentSettings.SettingsFileName);

            if (agentSettingsPath == null || !File.Exists(agentSettingsPath))
            {
                lblServer.Text = "Server: Agent settings file not found";
            }

            else
            {
                string agentSettingsText = File.ReadAllText(agentSettingsPath);
                var    settings          = JsonConvert.DeserializeObject <Dictionary <string, string> >(agentSettingsText);

                string agentId   = settings["AgentId"];
                string serverURL = settings["OpenBotsServerUrl"];

                if (string.IsNullOrEmpty(agentId))
                {
                    lblServer.Text = "Server: Agent is not connected";
                }
                else
                {
                    lblServer.Text = $"Server: {serverURL}";
                }
            }
        }
예제 #3
0
 private void GetIp()
 {
     this.txtIP.Text         = MachineInfo.GetIPAddress();
     this.txtMacAddress.Text = MachineInfo.GetMacAddress();
 }
예제 #4
0
 public async Task StartConsumerAsync()
 {
     Debug.WriteLine("Starting Jira Consumer...");
     _bus = ServiceBusProvider.GetRabbitMqConsumerBus(this, _configSettings.RabbitMqUri, _configSettings.SystemName, MachineInfo.GetMacAddress());
     await _bus.StartAsync();
 }
예제 #5
0
 private string GetMessageOrigin()
 {
     return(_config.SystemName + "_" + MachineInfo.GetMacAddress());
 }
 public async Task StartConsumerAsync()
 {
     Debug.WriteLine("Starting EasyAccessConsumer...");
     _bus = ServiceBusProvider.GetRabbitMqConsumerBus(this, "rabbitmq://localhost", "EasyAccess", MachineInfo.GetMacAddress());
     await _bus.StartAsync();
 }