File size: 3,237 Bytes
00cf365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using SilkroadBot.Domain.Enums;

namespace SilkroadBot.Profiles.Models;

/// <summary>
/// A character profile containing all settings for a bot session.
/// Stored as JSON locally.
/// </summary>
public class BotProfile
{
    public string Id { get; set; } = Guid.NewGuid().ToString("N")[..8];
    public string Name { get; set; } = "New Profile";
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public DateTime LastUsed { get; set; } = DateTime.UtcNow;
    
    // Account Data
    public AccountSettings Account { get; set; } = new();
    
    // Server/Region
    public ServerSettings Server { get; set; } = new();
    
    // Client Mode
    public ExecutionMode ExecutionMode { get; set; } = ExecutionMode.Clientless;
    
    // Plugin Configuration
    public PluginSettings Plugins { get; set; } = new();
    
    // Automation Settings
    public AutomationSettings Automation { get; set; } = new();
    
    // AI Settings
    public AIProfileSettings AI { get; set; } = new();
    
    // Status (runtime, not persisted)
    public ProfileStatus Status { get; set; } = ProfileStatus.Offline;
}

public class AccountSettings
{
    public string Username { get; set; } = string.Empty;
    public string Password { get; set; } = string.Empty; // Encrypted at rest
    public string CharacterName { get; set; } = string.Empty;
    public int CharacterSlot { get; set; } = 0;
}

public class ServerSettings
{
    public GameClientType ClientType { get; set; } = GameClientType.VSRO;
    public string GatewayHost { get; set; } = "localhost";
    public int GatewayPort { get; set; } = 15779;
    public string ServerName { get; set; } = string.Empty;
    public string Region { get; set; } = "Custom";
    public string CustomServerName { get; set; } = string.Empty;
}

public class PluginSettings
{
    public List<string> EnabledPlugins { get; set; } = new();
    public Dictionary<string, Dictionary<string, object>> PluginConfigs { get; set; } = new();
}

public class AutomationSettings
{
    public bool AutoLogin { get; set; } = false;
    public bool AutoSelectCharacter { get; set; } = false;
    public bool AutoReconnect { get; set; } = true;
    public int ReconnectDelaySeconds { get; set; } = 30;
    public int MaxReconnectAttempts { get; set; } = 5;
    public bool AutoStartPlugins { get; set; } = true;
    
    // Training area
    public TrainingAreaSettings TrainingArea { get; set; } = new();
}

public class TrainingAreaSettings
{
    public float CenterX { get; set; }
    public float CenterY { get; set; }
    public short RegionId { get; set; }
    public float Radius { get; set; } = 100;
    public List<uint> TargetMonsterIds { get; set; } = new();
}

public class AIProfileSettings
{
    public bool Enabled { get; set; } = false;
    public string ProviderName { get; set; } = "Gemini";
    public string ApiKey { get; set; } = string.Empty;
    public string Model { get; set; } = "gemini-pro";
    public double Temperature { get; set; } = 0.3;
    public int DecisionIntervalMs { get; set; } = 2000;
    public List<string> CustomConstraints { get; set; } = new();
}

public enum ProfileStatus
{
    Offline,
    Connecting,
    Online,
    Training,
    Error,
    Paused
}