forked from CubeCoders/SampleAMPModule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebMethods.cs
39 lines (35 loc) · 896 Bytes
/
WebMethods.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
using ModuleShared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RustModule
{
class WebMethods : WebMethodsBase
{
private ModuleMain module;
public WebMethods(ModuleMain module)
{
this.module = module;
}
public enum InGameActionPermissions
{
KickPlayer,
BanPlayer
}
[UserAction("Kick")]
[JSONMethod]
[RequiresPermissions(InGameActionPermissions.KickPlayer)]
private void Kick(string ID)
{
module.app.KickPlayer(module.app.GetPlayer(ID));
}
[UserAction("Ban")]
[JSONMethod]
[RequiresPermissions(InGameActionPermissions.BanPlayer)]
private void Ban(string ID)
{
module.app.BanPlayer(module.app.GetPlayer(ID));
}
}
}