Skip to main content

Overview

This guide covers the configuration options and settings for the ACHCE Client application, including project settings, runtime configuration, and customization options.

Project Configuration

Target Framework

ACHCE Client targets .NET Framework 4.7.2, which provides compatibility with Windows 7 SP1 and later operating systems.
ACHCE_Cliente.csproj:11
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
.NET Framework 4.7.2 includes improvements for cryptography, security, and high-DPI support for Windows Forms applications.

Application Configuration

The App.config file defines the supported runtime environment:
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>
</configuration>

Build Configurations

ACHCE Client includes two standard build configurations:

Debug Configuration

Used during development with full debugging symbols:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  <PlatformTarget>AnyCPU</PlatformTarget>
  <DebugSymbols>true</DebugSymbols>
  <DebugType>full</DebugType>
  <Optimize>false</Optimize>
  <OutputPath>bin\Debug\</OutputPath>
  <DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
DebugSymbols
boolean
default:"true"
Enables generation of debug symbols (.pdb files) for debugging
Optimize
boolean
default:"false"
Code optimization is disabled for easier debugging
DefineConstants
string
default:"DEBUG;TRACE"
Preprocessor symbols available during compilation

Release Configuration

Optimized build for production deployment:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  <PlatformTarget>AnyCPU</PlatformTarget>
  <DebugType>pdbonly</DebugType>
  <Optimize>true</Optimize>
  <OutputPath>bin\Release\</OutputPath>
  <DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
Optimize
boolean
default:"true"
Enables compiler optimizations for better performance
DebugType
string
default:"pdbonly"
Generates limited debug information for stack traces

Application Settings

Assembly Information

Configure the application metadata in Properties/AssemblyInfo.cs:
[assembly: AssemblyTitle("ACHCE Cliente")]
[assembly: AssemblyDescription("Client application for ACHCE")]
[assembly: AssemblyProduct("ACHCE Cliente")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyVersion("1.0.0.0")]

Output Settings

OutputType
string
default:"WinExe"
Creates a Windows Forms application (no console window)
AssemblyName
string
default:"ACHCE Cliente"
The name of the compiled executable file
RootNamespace
string
default:"ACHCE"
Default namespace for new classes (note: current code uses vbEngC)

Runtime Configuration

Timer Settings

The application uses two timers for managing the loading sequence and UI updates:
Form1.cs:19-21
timer1.Start();
timer2.Start();
timer2.Tick += Timer2_Tick;
1

Timer1 - Connection Monitor

Purpose: Monitors IP address retrieval and transitions to the next form
Form1.cs:70-83
private void timer1_Tick(object sender, EventArgs e)
{
    if (IpPlayer != null)
    {
        Form2 form2 = new Form2();
        this.Hide();
        timer2.Stop();
        form2.Show();
    }
}
This timer continuously checks if the player’s IP address has been retrieved, then transitions to Form2.
2

Timer2 - Loading Animation

Purpose: Displays a loading animation to the user
Form1.cs:85-98
private void Timer2_Tick(object sender, EventArgs e)
{
    string texto = "/"; // Texto inicial
    int indice = 0; // Índice de la letra que se agregará

    if (indice < texto.Length)
    {
        TextoCarga.Text += texto[indice];
        indice++;
    }
}
Adjust the timer intervals in the Form Designer to customize the animation speed.

Timer Configuration

To modify timer intervals, update them in the Form Designer or programmatically:
// Set timer intervals (in milliseconds)
timer1.Interval = 1000; // Check every 1 second
timer2.Interval = 500;  // Update animation every 0.5 seconds

Player Identification

The application generates random names for anonymous player tracking:
Form1.cs:44-49
// Clase para Generar nombres para el usuario
GenerateRandomNames names = new GenerateRandomNames();
Random rand = new Random();

// Genera un nombre aleatorio
randomName = names.GenerateRandomName(rand);

IP Address Detection

The client automatically retrieves the player’s public IP address:
Form1.cs:51-53
// Obtener la ip del cliente
PublicIPAddress IpAddressPlayer = new PublicIPAddress();
IpPlayer = IpAddressPlayer.GetPublicIPAddress();
Privacy ConsiderationThe application collects and stores public IP addresses. Ensure compliance with privacy regulations (GDPR, CCPA, etc.) in your jurisdiction.

Dependencies

Core Packages

ACHCE Client relies on the following NuGet packages:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="FireSharp" version="2.0.4" targetFramework="net472" />
  <package id="Microsoft.Bcl" version="1.1.9" targetFramework="net472" />
  <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net472" />
  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net472" />
  <package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net472" />
</packages>

Package Descriptions

FireSharp
NuGet Package
default:"2.0.4"
Firebase Realtime Database client library for .NET
Newtonsoft.Json
NuGet Package
default:"6.0.4"
High-performance JSON serialization and deserialization
Microsoft.Bcl.Async
NuGet Package
default:"1.0.168"
Async/await support for .NET Framework 4.0+
Microsoft.Net.Http
NuGet Package
default:"2.2.28"
HTTP client libraries for modern HTTP operations

System References

The project includes essential .NET Framework assemblies:
<Reference Include="System" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Data" />

Deployment Configuration

ClickOnce Settings

The project includes ClickOnce deployment configuration:
ACHCE_Cliente.csproj:15-29
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
1

Enable Auto-Updates

To enable automatic updates, modify the project file:
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
2

Configure Installation Source

Change the installation source for web or network deployment:
<InstallFrom>Web</InstallFrom>
<UpdateUrl>https://your-domain.com/updates/</UpdateUrl>
3

Publish Application

Use Visual Studio’s Publish Wizard:
  1. Right-click the project in Solution Explorer
  2. Select Publish
  3. Follow the wizard to configure deployment settings
  4. Click Publish to generate installation files

Advanced Configuration

Custom Application Settings

To add custom configuration settings, modify App.config:
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>
    
    <appSettings>
        <add key="FirebaseAuthSecret" value="your-secret-here" />
        <add key="FirebaseBasePath" value="https://your-project.firebaseio.com/" />
        <add key="ConnectionTimeout" value="30000" />
        <add key="EnableLogging" value="true" />
    </appSettings>
</configuration>

Reading Configuration Values

Access configuration values in your code:
using System.Configuration;

// Read configuration values
string authSecret = ConfigurationManager.AppSettings["FirebaseAuthSecret"];
string basePath = ConfigurationManager.AppSettings["FirebaseBasePath"];
int timeout = int.Parse(ConfigurationManager.AppSettings["ConnectionTimeout"]);
bool enableLogging = bool.Parse(ConfigurationManager.AppSettings["EnableLogging"]);
You’ll need to add a reference to System.Configuration assembly to use ConfigurationManager.

Environment-Specific Configuration

Development Environment

For local development, keep Firebase credentials in the source code or use a local config file that’s excluded from version control.

Production Environment

Security Best Practices
  • Never commit credentials to source control
  • Use environment variables or secure configuration management
  • Encrypt sensitive configuration sections
  • Implement proper access controls
Consider using app.config transformations for environment-specific settings:
  1. Add App.Debug.config and App.Release.config
  2. Use XML transformations to replace values per environment
  3. Configure transformations in your build pipeline

Troubleshooting

Common Configuration Issues

Symptom: Application fails to start with assembly load exceptionsSolution:
  • Clean and rebuild the solution
  • Verify all NuGet packages are restored
  • Check that binding redirects are correct in App.config
Symptom: Loading animation doesn’t work or form transition failsSolution:
  • Ensure timers are started in Form1_Load or constructor
  • Check timer Enabled property is true
  • Verify Interval property is set to a positive value
  • Confirm event handlers are properly attached
Symptom: Type not found or ambiguous reference errorsSolution:
  • The project uses vbEngC namespace but project setting shows ACHCE
  • Update RootNamespace in project properties to match code
  • Or refactor code to use consistent namespace

Next Steps

Firebase Setup

Configure Firebase Realtime Database connection

Architecture

Understand the application architecture

Build docs developers (and LLMs) love