-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMessageAnnouncerConfiguration.cs
71 lines (63 loc) · 2.33 KB
/
MessageAnnouncerConfiguration.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
using Rocket.API;
using System.Collections.Generic;
using System.Xml.Serialization;
using System;
namespace fr34kyn01535.MessageAnnouncer
{
public sealed class TextCommand
{
public string Name;
public string Help;
[XmlArrayItem("Line")]
public List<string> Text;
}
public sealed class Message
{
[XmlAttribute("Text")]
public string Text;
[XmlAttribute("Color")]
public string Color;
public Message(string text, string color)
{
Text = text;
Color = color;
}
public Message()
{
Text = "";
Color = "";
}
}
public class MessageAnnouncerConfiguration : IRocketPluginConfiguration
{
public int Interval;
[XmlArrayItem("Message")]
[XmlArray(ElementName = "Messages")]
public Message[] Messages;
[XmlArrayItem("TextCommand")]
[XmlArray(ElementName = "TextCommands")]
public List<TextCommand> TextCommands;
public void LoadDefaults()
{
Interval = 180;
Messages = new Message[]{
new Message("Welcome to unturned.ROCKS, we hope you enjoy your stay!","Green"),
new Message("Join our TeamSpeak 3 server at unturned.ROCKS!","Green"),
new Message("Please chat in english. Be polite.","Green"),
new Message("We are searchin staff, Apply on our forum!","Green"),
new Message("Check out our forum at https://unturned.ROCKS","Green"),
new Message("If you have any questions ask an admin on our TeamSpeak 3 server!","Green"),
new Message("Please chat in english. Be polite.","Green"),
new Message("We are searchin staff, Apply on our forum!","Green")
};
TextCommands = new List<TextCommand>(){
new TextCommand(){Name="rules",Help="Shows the server rules",Text = new List<string>(){
"#1 No offensive content in the chat, respect other players",
"#2 No bug using, exploiting or abuse of powers",
"#3 Don't ask admins for items, teleports, loot respawn, ect.",
"#4 Please speak english in the public chat"}
}
};
}
}
}