Skip to content

Commit 7099138

Browse files
authored
Merge with aspyr-debug
2 parents 5822877 + 094be5f commit 7099138

38 files changed

+783
-233
lines changed

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ DllLoader/bin
55
DllLoader/obj
66
SWBF2Admin/bin
77
SWBF2Admin/obj
8-
IngameControllerServer/bin
9-
IngameControllerServer/obj
10-
RconServer/Debug
11-
RconServer/Release
12-
RconServer/x64
13-
RconServer/x86
148
RconServer/out
9+
rconserver-aspyr/out
10+
rconserver-galaxy/out
1511
packages
1612
.vs
1713
.tmp

DebugFiles/SWBF2Admin.sqlite

0 Bytes
Binary file not shown.

DebugFiles/web/bans.htm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ <h2>Bans</h2>
1717
<td><input type="text" id="bans_input_reason" class="bans_autorf"><i class="material-icons">youtube_searched_for</i></td>
1818
<td><input type="date" id="bans_input_date" class="bans_autorf"></td>
1919
<td><input type="checkbox" id="bans_input_expired"></td>
20-
<td><select id="bans_select_type"><option value="-1">All</option><option value="0">Keyhash</option><option value="1">IP-Address</option></select></td>
20+
<td><select id="bans_select_type">
21+
<option value="-1">All</option>
22+
<option value="0">Keyhash</option>
23+
<option value="1">IP-Address</option>
24+
<option value="2">Alias</option>
25+
</select></td>
2126
</tr>
2227
</table>
2328
</div>

DebugFiles/web/players.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ <h2>Players</h2>
4444
<select id="players_select_ban_type">
4545
<option value="0" selected>Keyhash</option>
4646
<option value="1">IP Address</option>
47+
<option value="2">Alias</option>
4748
</select>
4849
</td>
4950
</tr>

DebugFiles/web/res/bans.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
var BansUrl = "/db/bans";
22
var BansFilterTimeout = 300;
33

4+
var BanTypes = [
5+
"Key",
6+
"IP",
7+
"Alias"
8+
]
9+
410
function Bans() {
511
var base = this;
612
this.quickAdminId = null;
@@ -73,7 +79,7 @@ function Bans() {
7379
"<td>" + (b.Duration < 0 ? "permanent" : b.Duration) + "</td>" +
7480
"<td>" + b.PlayerKeyhash + "</td>" +
7581
"<td>" + b.PlayerIPAddress + "</td>" +
76-
"<td>" + (b.TypeId == 0 ? "Key" : "IP") + "</td>" +
82+
"<td>" + BanTypes[b.TypeId] + "</td>" +
7783
"</tr>";
7884
i++;
7985
legend |= b.Expired;

DllLoader/DllLoader.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
44
<OutputType>Exe</OutputType>
5-
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<AssemblyTitle>DllLoader</AssemblyTitle>
7+
<Product>DllLoader</Product>
8+
<Copyright>Copyright © 2018</Copyright>
9+
<AssemblyVersion>1.3.0.0</AssemblyVersion>
10+
<FileVersion>1.0.0.0</FileVersion>
611
</PropertyGroup>
712
<ItemGroup>
813
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />

DllLoader/Program.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ static void Main(string[] args)
5151
Console.WriteLine("ERROR");
5252
Console.WriteLine(e.ToString());
5353
}
54-
55-
#if DEBUG
56-
Console.WriteLine("Press [return] to exit.");
57-
Console.ReadLine();
58-
#endif
5954
}
6055
}
6156
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
[assembly: AssemblyTrademark("")]
5+
[assembly: AssemblyCulture("")]
6+
7+
// Setting ComVisible to false makes the types in this assembly not visible
8+
// to COM components. If you need to access a type in this assembly from
9+
// COM, set the ComVisible attribute to true on that type.
10+
[assembly: ComVisible(false)]
11+
12+
// The following GUID is for the ID of the typelib if this project is exposed to COM
13+
[assembly: Guid("e6f07cf4-2b80-4134-8d0d-52562fa16b8f")]

DllLoader/Properties/PublishProfiles/Windows.pubxml

Lines changed: 0 additions & 18 deletions
This file was deleted.

SWBF2Admin/AdminCore.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* This file is part of SWBF2Admin (https://github.com/jweigelt/swbf2admin).
2+
* This file is part of SWBF2Admin (https://github.com/jweigelt/swbf2admin).
33
* Copyright(C) 2017, 2018 Jan Weigelt <[email protected]>
44
*
55
* SWBF2Admin is free software: you can redistribute it and/or modify
@@ -15,25 +15,23 @@
1515
* You should have received a copy of the GNU General Public License
1616
* along with SWBF2Admin. If not, see<http://www.gnu.org/licenses/>.
1717
*/
18+
1819
using System;
1920
using System.Collections.Generic;
20-
2121
using SWBF2Admin.Utility;
2222
using SWBF2Admin.Config;
2323
using SWBF2Admin.Web;
2424
using SWBF2Admin.Database;
2525
using SWBF2Admin.Gameserver;
2626
using SWBF2Admin.Scheduler;
2727
using SWBF2Admin.Structures;
28-
2928
using SWBF2Admin.Runtime.Players;
3029
using SWBF2Admin.Runtime.Rcon;
3130
using SWBF2Admin.Runtime.Game;
3231
using SWBF2Admin.Runtime.Announce;
3332
using SWBF2Admin.Runtime.Commands;
3433
using SWBF2Admin.Runtime.ApplyMods;
3534
using SWBF2Admin.Runtime.Watchdog;
36-
3735
using SWBF2Admin.Plugins;
3836

3937
namespace SWBF2Admin
@@ -43,7 +41,12 @@ public class AdminCore
4341
private const string ARG_RESET_WEBUSER = "--reset-webcredentials";
4442

4543
private CoreConfiguration config;
46-
public CoreConfiguration Config { get { return config; } }
44+
45+
public CoreConfiguration Config
46+
{
47+
get { return config; }
48+
}
49+
4750
public FileHandler Files { get; } = new FileHandler();
4851
public TaskScheduler Scheduler { get; } = new TaskScheduler();
4952

@@ -168,6 +171,11 @@ public void Run(string[] args)
168171

169172
while ((cmd = Console.ReadLine()) != "quit")
170173
{
174+
if (string.IsNullOrEmpty(cmd))
175+
{
176+
continue;
177+
}
178+
171179
if (cmd == "import maps")
172180
{
173181
Database.ImportMaps(ServerMap.ReadServerMapConfig(this));
@@ -185,9 +193,9 @@ public void Run(string[] args)
185193

186194

187195
#region "Events"
196+
188197
private void Server_Started(object sender, EventArgs e)
189198
{
190-
191199
Logger.Log(LogLevel.Verbose, "Starting runtime management...");
192200
Scheduler.PushDelayedTask(() =>
193201
{
@@ -214,7 +222,7 @@ private void Server_Stopped(object sender, EventArgs e)
214222
Logger.Log(LogLevel.Verbose, "Restarting server...");
215223
Server.Start();
216224
}
217-
}
225+
}
218226
}
219227

220228
private void Server_Crashed(object sender, EventArgs e)
@@ -223,24 +231,23 @@ private void Server_Crashed(object sender, EventArgs e)
223231
if (Config.AutoRestartServer)
224232
{
225233
Logger.Log(LogLevel.Info, "Automatic restart is enabled. Restarting server...");
226-
Scheduler.PushDelayedTask(() => Server.Start(), 90000);
234+
Scheduler.PushDelayedTask(() => Server.Start(), Config.AutoRestartDelay);
227235
}
228236
}
229237

230238
private void Rcon_Disconnected(object sender, EventArgs e)
231239
{
232-
233240
}
234241

235242
private void Rcon_Chat(object sender, EventArgs e)
236243
{
237-
238244
}
239245

240246
private void Announce_Broadcast(object sender, EventArgs e)
241247
{
242248
Rcon.Say(((AnnounceEventArgs)e).Announce.ParseMessage(this));
243249
}
250+
244251
#endregion
245252
}
246253
}

0 commit comments

Comments
 (0)