-
Notifications
You must be signed in to change notification settings - Fork 2
/
Configuration.cs
113 lines (99 loc) · 4.12 KB
/
Configuration.cs
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
105
106
107
108
109
110
111
112
113
using Rocket.API;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace MOTDgd
{
public class MOTDgdConfiguration : IRocketPluginConfiguration
{
public int User_ID;
public int Reminder_delay;
public int Number_of_ads_before_cooldown;
public string Reward_mode;
public int CooldownTime;
public bool Global_messages;
public bool Ad_on_join;
public bool Reapply_join_command;
public bool Give_reward_when_video_unavailable;
public bool AdvancedLogging;
public string Executor_CSteamID;
public List<string> Join_Commands;
public sealed class Reward
{
[XmlAttribute("Command")]
public string Command;
[XmlAttribute("Probability")]
public int Probability;
public Reward(string command, int probability)
{
Command = command;
Probability = probability;
}
public Reward()
{
Command = "";
Probability = 1;
}
}
public sealed class Translation
{
[XmlAttribute("Identifier")]
public string Identifier;
[XmlAttribute("Text")]
public string Text;
[XmlAttribute("Color")]
public string Color;
public Translation(string identifier, string text, string color)
{
Identifier = identifier;
Text = text;
Color = color;
}
public Translation()
{
Identifier = "";
Text = "";
Color = "";
}
}
[XmlArrayItem("Reward")]
[XmlArray(ElementName = "Rewards")]
public Reward[] Rewards;
[XmlArrayItem("Translation")]
[XmlArray(ElementName = "Translations")]
public Translation[] Translations;
public void LoadDefaults()
{
User_ID = 0;
Rewards = new Reward[]{
new Reward("Reward",1)
};
Join_Commands = new List<string>() { "broadcast (player) connected to the server!" };
Reminder_delay = 5;
Number_of_ads_before_cooldown = 1;
Reward_mode = "ALL";
CooldownTime = 15;
Global_messages = true;
Ad_on_join = false;
Give_reward_when_video_unavailable = false;
Executor_CSteamID = "";
AdvancedLogging = false;
Translations = new Translation[]{
new Translation("EVENT_RECEIVED_REWARD_COOLDOWN", "You got your reward! Now you are on cooldown for {0} minutes", "default"),
new Translation("EVENT_RECEIVED_REWARD_ADS_REMAIN", "You got your reward! You can watch {0} more ads before receiving cooldown.", "default"),
new Translation("LINK_RESPONSE", "Here's your link!", "!not_required!"),
new Translation("EVENT_RECEIVED_REWARD_ADS_GLOBAL", "{0} received his reward by watching ad. Get your reward with /ad command", "default"),
new Translation("REMINDER_MESSAGE", "Get your reward by using /ad command!", "default"),
new Translation("REMINDER_MESSAGE_JOIN", "oin commands have been reapplied!. Get your reward by using /ad command!", "default"),
new Translation("COOLDOWN_EXPIRED", "Your cooldown has just expired!", "default"),
new Translation("COOLDOWN", "You already received reward and now are on cooldown!", "default"),
new Translation("COOLDOWN_REMAINING", "You can receive a new reward in {0} minutes!", "default"),
new Translation("NOT_ON_COOLDOWN", "You can watch ad right now!", "default"),
new Translation("REQUEST_LINK_MESSAGE", "Requesting your ad.", "default"),
new Translation("COMPLETED_WITHOUT_VIDEO", "Unfortunately we didn't have any video for you, so you can't receive your reward.", "default")
};
}
}
}