Skip to content

Commit 5dfd223

Browse files
authored
update 14.1beta
1 parent 4230a9d commit 5dfd223

File tree

10 files changed

+667
-0
lines changed

10 files changed

+667
-0
lines changed

ServerPlugin.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35527.113 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerPlugin", "ServerPlugin\ServerPlugin.csproj", "{3880D5B1-F467-4E2C-911E-91ED5DBD4F41}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3880D5B1-F467-4E2C-911E-91ED5DBD4F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3880D5B1-F467-4E2C-911E-91ED5DBD4F41}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3880D5B1-F467-4E2C-911E-91ED5DBD4F41}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3880D5B1-F467-4E2C-911E-91ED5DBD4F41}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

ServerPlugin/Command/AdminChat.cs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using RemoteAdmin;
4+
using System;
5+
using System.Linq;
6+
7+
namespace ServerPlugin.Command
8+
{
9+
[CommandHandler(typeof(ClientCommandHandler))]
10+
public class AdminChat : ICommand,IUsageProvider
11+
{
12+
public string Command { get; } = "ac";
13+
public string[] Aliases { get; } = new string[1] { "ac" };
14+
public string Description { get; } = "呼叫管理员(不要使用该指令骚扰管理员)";
15+
public string[] Usage { get; } = new string[] { "*文本" };
16+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
17+
{
18+
if (sender is PlayerCommandSender playerCommandSender)
19+
{
20+
int AdminCount = Player.List.Where(x => x.RemoteAdminAccess).ToList().Count;
21+
Player player = Player.Get(playerCommandSender.PlayerId);
22+
if (player.IsVerified && player != null)
23+
{
24+
if (arguments.Count > 0)
25+
{
26+
if (player.RemoteAdminAccess)
27+
{
28+
response = "<color=red>管理不能呼叫管理!</color>";
29+
return true;
30+
}
31+
if (AdminCount != 0)
32+
{
33+
foreach (Player AdminPlayer in Player.List.Where(x => x.RemoteAdminAccess))
34+
AdminPlayer.Broadcast(5, $"<size=55%><color=#00FFFF>[管理呼叫]</color> {player.Nickname} : {string.Join(" ", arguments)}</size>");
35+
Log.Info($"[Plugin-Call]-[呼叫][{player.Nickname}][{player.UserId}]:[{string.Join(" ", arguments)}]");
36+
}
37+
else
38+
{
39+
Log.Info($"[Plugin-Call]-[未响应呼叫][{player.Nickname}][{player.UserId}]:[{string.Join(" ", arguments)}]");
40+
response = "<color=red>服务器暂无管理员!</color>";
41+
return false;
42+
}
43+
}
44+
else
45+
{
46+
response = "<color=red>请输入文本!</color>";
47+
return false;
48+
}
49+
}
50+
else
51+
{
52+
response = "<color=red>你还没加入服务器!</color>";
53+
return false;
54+
}
55+
56+
}
57+
response = "<color=green>信息已发送!</color>";
58+
return true;
59+
}
60+
}
61+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using PlayerRoles;
4+
using RemoteAdmin;
5+
using System;
6+
7+
namespace ServerPlugin.Command
8+
{
9+
[CommandHandler(typeof(ClientCommandHandler))]
10+
public class BroadcastChat : ICommand, IUsageProvider
11+
{
12+
public string Command { get; } = "bc";
13+
public string[] Aliases { get; } = new string[1] { "bc" };
14+
public string Description { get; } = "全局聊天";
15+
public string[] Usage { get; } = new string[] { "*文本" };
16+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
17+
{
18+
if (sender is PlayerCommandSender playerCommandSender)
19+
{
20+
Player player = Player.Get(playerCommandSender.PlayerId);
21+
if (player.IsVerified && player != null)
22+
{
23+
if (arguments.Count > 0)
24+
{
25+
if ((player.IsMuted || player.IsGlobalMuted || player.IsIntercomMuted))
26+
{
27+
if (Plugin.Instance.Config.MuteChat)
28+
{
29+
response = "<color=red>你已被禁言 无法聊天!</color>";
30+
return false;
31+
}
32+
}
33+
if (player.Role.Team == Team.Dead && !Plugin.Instance.Config.SpecatorChat)
34+
{
35+
response = "<color=red>你现在不能说话!</color>";
36+
return false;
37+
}
38+
else
39+
{
40+
Map.Broadcast(4, $"<size=65%>{player.PlayerRole()} {player.Nickname} : {string.Join(" ", arguments)}</size>");
41+
Log.Info($"[Plugin-Global-Chat]-[全局聊天][{player.Nickname}][{player.UserId}]:[{string.Join(" ", arguments)}]");
42+
response = "<color=green>信息已发送!</color>";
43+
return true;
44+
}
45+
}
46+
else
47+
{
48+
response = "<color=red>请输入文本!</color>";
49+
return false;
50+
}
51+
}
52+
else
53+
{
54+
response = "<color=red>你还没加入服务器!</color>";
55+
return false;
56+
}
57+
}
58+
59+
response = "<color=green>信息已发送!</color>";
60+
return true;
61+
}
62+
}
63+
}

ServerPlugin/Command/TeamChat.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using RemoteAdmin;
4+
using System;
5+
using System.Linq;
6+
7+
namespace ServerPlugin.Command
8+
{
9+
[CommandHandler(typeof(ClientCommandHandler))]
10+
public class TeamChat : ICommand,IUsageProvider
11+
{
12+
public string Command { get; } = "cc";
13+
public string[] Aliases { get; } = new string[1] { "cc" };
14+
public string Description { get; } = "阵营聊天";
15+
public string[] Usage { get; } = new string[] { "*文本" };
16+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
17+
{
18+
if (sender is PlayerCommandSender playerCommandSender)
19+
{
20+
Player player = Player.Get(playerCommandSender.PlayerId);
21+
if (player != null && player.IsVerified)
22+
{
23+
if (arguments.Count > 0)
24+
{
25+
if ((player.IsMuted || player.IsGlobalMuted || player.IsIntercomMuted) && Plugin.Instance.Config.MuteChat)
26+
{
27+
response = "<color=red>你已被禁言 无法聊天!</color>";
28+
return false;
29+
}
30+
Log.Info($"[Plugin-Team-Chat]-[{player.Nickname}][{player.UserId}]:[{string.Join(" ", arguments)}]");
31+
foreach (Player target in Player.List.Where(x => x.GetTeam(player)))
32+
target.Broadcast(4,$"<size=65%>[阵营聊天] {player.PlayerRole()} {player.Nickname} : {string.Join(" ", arguments)}</size>");
33+
}
34+
else
35+
{
36+
response = "<color=red>请输入文本!</color>";
37+
return false;
38+
}
39+
}
40+
else
41+
{
42+
response = "<color=red>你还没加入服务器!</color>";
43+
return false;
44+
}
45+
}
46+
response = "<color=green>信息已发送!</color>";
47+
return true;
48+
}
49+
}
50+
}

ServerPlugin/Config.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Exiled.API.Interfaces;
2+
using System.ComponentModel;
3+
4+
namespace ServerPlugin
5+
{
6+
public class Config : IConfig
7+
{
8+
[Description("Enabled Plugin / 启动插件")]
9+
public bool IsEnabled { get; set; } = true;
10+
[Description("Enabled Debug / 启动DeBug")]
11+
public bool Debug { get; set; } = false;
12+
[Description("SCP-207 & SCP-1853 no hurt /SCP-1853不中毒")]
13+
public bool DisablePoison { get; set; } = true;
14+
[Description("SCP-207 no hurt / SCP-207不中毒")]
15+
public bool DisableSCP207Hurt { get; set; } = true;
16+
[Description("Inf Ammo / 无限子弹")]
17+
public bool InfAmmo { get; set; } = true;
18+
[Description("No Fog / 无迷雾")]
19+
public bool NoFog { get; set; } = true;
20+
[Description("Max count to take SCP330 / 拿糖最大数量")]
21+
public ushort Candys { get; set; } = 2;
22+
[Description("RemoteKeycard / 免手持卡")]
23+
public bool RemoteKeycard { get; set; } = true;
24+
[Description("SCP Can RemoteKeycard / 免手持卡作用于SCP")]
25+
public bool RemoteKeycard_Scp { get; set; } = false;
26+
[Description("Specator can use .bc / 旁观者可使用.bc")]
27+
public bool SpecatorChat { get; set; } = false;
28+
[Description("Mute player can use .bc / 旁观者可使用.bc")]
29+
public bool MuteChat { get; set; } = false;
30+
}
31+
}

0 commit comments

Comments
 (0)