generated from AriasCreations/vsmodtemplate
Begin adding cooldowns to specific commands
This commit is contained in:
parent
107f502736
commit
85f728babf
7 changed files with 204 additions and 3 deletions
|
@ -19,11 +19,53 @@ namespace AriasServerUtils
|
|||
public int MaxBackCache { get; set; } = 10;
|
||||
public int PlayerSleepingPercentage { get; set; } = 50;
|
||||
public int MaxRTPBlockDistance { get; set; } = 5000;
|
||||
public Dictionary<CooldownType, string> Cooldowns { get; set; } = new Dictionary<CooldownType, string>
|
||||
{
|
||||
{ CooldownType.Home, "5s" },
|
||||
{ CooldownType.Warp, "10s" },
|
||||
{ CooldownType.Spawn, "5s" },
|
||||
{ CooldownType.RTP, "30s" },
|
||||
{ CooldownType.Back, "5s" }
|
||||
};
|
||||
|
||||
public Dictionary<CooldownType, string> GetDefaultCooldowns()
|
||||
{
|
||||
return new Dictionary<CooldownType, string>{
|
||||
|
||||
{ CooldownType.Home, "5s" },
|
||||
{ CooldownType.Warp, "10s" },
|
||||
{ CooldownType.Spawn, "5s" },
|
||||
{ CooldownType.RTP, "30s" },
|
||||
{ CooldownType.Back, "5s" }
|
||||
};
|
||||
}
|
||||
|
||||
public void SanityCheckCooldowns()
|
||||
{
|
||||
foreach (var cd in GetDefaultCooldowns())
|
||||
{
|
||||
if (!Cooldowns.ContainsKey(cd.Key))
|
||||
{
|
||||
Cooldowns.Add(cd.Key, cd.Value);
|
||||
ServerUtilities.MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public PlayerPosition Spawn { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public enum CooldownType
|
||||
{
|
||||
Home, // Default: 5s
|
||||
Warp, // Default 10s
|
||||
Spawn, // Default 5s
|
||||
RTP, // Default 30s
|
||||
Back // Default 5s
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Warp
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue