Skip to main content

Overview

The Player class is a simple data model that represents a player’s information in the ACHCE Client system. It’s primarily used to store and transmit player data to the Firebase database.

Class Definition

namespace vbEngC
{
    class Player
    {
        public string IP { get; set; }
    }
}

Properties

IP
string
The public IP address of the player. This property is used to uniquely identify and track players in the Firebase database.

Usage

The Player class is instantiated when a player connects to the system. It stores the player’s IP address retrieved from the PublicIPAddress class.

Creating a Player Instance

Player ply = new Player()
{
    IP = IpPlayer,
};

Storing Player Data in Firebase

The player object is serialized and stored in Firebase under a randomly generated name:
var setter = client.Set("PlayerIpList/" + randomName, ply);

Integration

The Player class works in conjunction with other ACHCE Client components:
  • PublicIPAddress: Retrieves the player’s public IP address (see IP Address)
  • GenerateRandomNames: Creates a unique identifier for database storage (see Random Names)
  • Form1: Manages the player lifecycle and database operations (see Forms)

Database Structure

When stored in Firebase, the player data follows this structure:
{
  "PlayerIpList": {
    "randomname123": {
      "IP": "192.168.1.100"
    }
  }
}
The IP property is the only data currently stored per player, but the class structure allows for easy extension to include additional player information such as username, connection time, or game statistics.

Build docs developers (and LLMs) love