Merge pull request #196 from Mateleo/community
Fix project not compiling
This commit is contained in:
commit
9bfeb96e4e
3
.gitignore
vendored
3
.gitignore
vendored
@ -375,3 +375,6 @@ db/pgadmin/*
|
|||||||
/src/DiIiS-NA/database.Worlds.config
|
/src/DiIiS-NA/database.Worlds.config
|
||||||
/src/DiIiS-NA/database.Account.Debug.config
|
/src/DiIiS-NA/database.Account.Debug.config
|
||||||
/src/DiIiS-NA/database.Worlds.Debug.config
|
/src/DiIiS-NA/database.Worlds.Debug.config
|
||||||
|
|
||||||
|
# Generated config.mods.json
|
||||||
|
config.mods.json
|
||||||
|
|||||||
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Use the official .NET SDK image to build the application
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the project file and restore dependencies
|
||||||
|
COPY ["src/DiIiS-NA/Blizzless.csproj", "src/DiIiS-NA/"]
|
||||||
|
RUN dotnet restore "src/DiIiS-NA/Blizzless.csproj"
|
||||||
|
|
||||||
|
# Copy the rest of the project files and build the application
|
||||||
|
COPY ["src/", "src/"]
|
||||||
|
WORKDIR "/app/src/DiIiS-NA"
|
||||||
|
RUN dotnet publish "Blizzless.csproj" -c Release --runtime linux-x64 --self-contained true -o /app/publish
|
||||||
|
|
||||||
|
# Use the official .NET runtime image to run the application
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the published application from the build stage
|
||||||
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
|
# Expose the port your application is running on (if needed)
|
||||||
|
EXPOSE 1345 1119 83 2001 9800 9100
|
||||||
|
# Start the application
|
||||||
|
ENTRYPOINT ["./Blizzless"]
|
||||||
2423
db_old/initdb/dump.sql
Normal file
2423
db_old/initdb/dump.sql
Normal file
File diff suppressed because it is too large
Load Diff
40
docker-compose.yml
Normal file
40
docker-compose.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
services:
|
||||||
|
diiis-na-server:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: diiis-na-server
|
||||||
|
volumes:
|
||||||
|
- ./src/DiIiS-NA/config.ini:/app/config.ini
|
||||||
|
ports:
|
||||||
|
- 83:83
|
||||||
|
- 1119:1119
|
||||||
|
- 1345:1345
|
||||||
|
- 2001:2001
|
||||||
|
- 9800:9800
|
||||||
|
- 9100:9100
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:17
|
||||||
|
container_name: diiis-na-db
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=postgres
|
||||||
|
- POSTGRES_PASSWORD=postgres
|
||||||
|
- POSTGRES_DB=diablo
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/postgresql/data
|
||||||
|
- ./db/initdb:/docker-entrypoint-initdb.d
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db-data:
|
||||||
@ -355,19 +355,12 @@ namespace DiIiS_NA.LoginServer.Base
|
|||||||
|
|
||||||
private static string GetWebSocketLocation(IChannelPipeline cp, IHttpRequest req, string path)
|
private static string GetWebSocketLocation(IChannelPipeline cp, IHttpRequest req, string path)
|
||||||
{
|
{
|
||||||
string str = "ws";
|
string protocol = cp.Get<TlsHandler>() != null ? "wss" : "ws";
|
||||||
if (cp.Get<TlsHandler>() != null)
|
|
||||||
{
|
|
||||||
str = "wss";
|
|
||||||
}
|
|
||||||
|
|
||||||
string str2 = null;
|
// Ignore the Host header and default to a placeholder or IP address
|
||||||
if (req.Headers.TryGet(HttpHeaderNames.Host, out ICharSequence value))
|
string host = "192.168.1.100"; // Replace with your desired default host, e.g., the server's IP or DNS.
|
||||||
{
|
|
||||||
str2 = value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return str + "://" + str2 + path;
|
return $"{protocol}://{host}{path}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,9 +73,11 @@ namespace DiIiS_NA.LoginServer.Battle
|
|||||||
switch (message[0])
|
switch (message[0])
|
||||||
{
|
{
|
||||||
case "rngsr":
|
case "rngsr":
|
||||||
|
Logger.Info("test");
|
||||||
if (GameServers.ContainsKey(ipPort)) GameServers.Remove(ipPort);
|
if (GameServers.ContainsKey(ipPort)) GameServers.Remove(ipPort);
|
||||||
string rgsIp = args[0];
|
string rgsIp = args[0];
|
||||||
int rgsPort = int.Parse(args[1].Trim());
|
int rgsPort = int.Parse(args[1].Trim());
|
||||||
|
Logger.Info("Range IP {0}:{1}", rgsIp, rgsPort);
|
||||||
GameServers.Add(ipPort, new ServerDescriptor { GameIp = rgsIp, GamePort = rgsPort });
|
GameServers.Add(ipPort, new ServerDescriptor { GameIp = rgsIp, GamePort = rgsPort });
|
||||||
Logger.Info("Game server was registered for Blizzless {0}:{1}.", rgsIp, rgsPort);
|
Logger.Info("Game server was registered for Blizzless {0}:{1}.", rgsIp, rgsPort);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -894,7 +894,7 @@ namespace DiIiS_NA.LoginServer.Toons
|
|||||||
.SetSnoQuest(273408))
|
.SetSnoQuest(273408))
|
||||||
;
|
;
|
||||||
#else
|
#else
|
||||||
foreach (var inv in _dbQuests)
|
foreach (var inv in dbQuests)
|
||||||
{
|
{
|
||||||
// load quests
|
// load quests
|
||||||
var quest = D3.Hero.QuestHistoryEntry.CreateBuilder()
|
var quest = D3.Hero.QuestHistoryEntry.CreateBuilder()
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
<StartupObject>DiIiS_NA.Program</StartupObject>
|
<StartupObject>DiIiS_NA.Program</StartupObject>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Configurations>Debug;Release;github</Configurations>
|
<Configurations>Debug;Release;github</Configurations>
|
||||||
|
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@ -74,8 +74,11 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
string backEndIp = GameServerConfig.Instance.BindIP;
|
string backEndIp = GameServerConfig.Instance.BindIP;
|
||||||
int backEndPort = GameServerConfig.Instance.Port;
|
int backEndPort = GameServerConfig.Instance.Port;
|
||||||
bool pvp = false;
|
bool pvp = false;
|
||||||
if (!pvp)
|
Logger.Info("We are here");
|
||||||
|
if (!pvp){
|
||||||
|
Logger.Info("Ip: {0}|{1}", backEndIp, backEndPort);
|
||||||
RegisterGameServer(backEndIp, backEndPort);
|
RegisterGameServer(backEndIp, backEndPort);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
RegisterPvPGameServer(backEndIp, backEndPort);
|
RegisterPvPGameServer(backEndIp, backEndPort);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -36,6 +36,7 @@ using DiIiS_NA.Core.Extensions;
|
|||||||
using DiIiS_NA.D3_GameServer;
|
using DiIiS_NA.D3_GameServer;
|
||||||
using Spectre.Console;
|
using Spectre.Console;
|
||||||
using Environment = System.Environment;
|
using Environment = System.Environment;
|
||||||
|
using FluentNHibernate.Utils;
|
||||||
|
|
||||||
namespace DiIiS_NA
|
namespace DiIiS_NA
|
||||||
{
|
{
|
||||||
@ -110,8 +111,8 @@ namespace DiIiS_NA
|
|||||||
_diabloCoreEnabled = true;
|
_diabloCoreEnabled = true;
|
||||||
Logger.Info("Forcing Diablo III Core to be $[green]$enabled$[/]$ on debug mode.");
|
Logger.Info("Forcing Diablo III Core to be $[green]$enabled$[/]$ on debug mode.");
|
||||||
#else
|
#else
|
||||||
if (!DiabloCoreEnabled)
|
if (!_diabloCoreEnabled)
|
||||||
Logger.Warning("Diablo III Core is $[red]$disabled$[/]$.");
|
Logger.Warn("Diablo III Core is $[red]$disabled$[/]$.");
|
||||||
#endif
|
#endif
|
||||||
var mod = GameModsConfig.Instance;
|
var mod = GameModsConfig.Instance;
|
||||||
#pragma warning disable CS4014
|
#pragma warning disable CS4014
|
||||||
@ -255,27 +256,35 @@ namespace DiIiS_NA
|
|||||||
IChannel boundChannel = await serverBootstrap.BindAsync(loginConfig.Port);
|
IChannel boundChannel = await serverBootstrap.BindAsync(loginConfig.Port);
|
||||||
|
|
||||||
Logger.Info("$[bold deeppink4]$Gracefully$[/]$ shutdown with $[red3_1]$CTRL+C$[/]$ or $[deeppink4]$!q[uit]$[/]$.");
|
Logger.Info("$[bold deeppink4]$Gracefully$[/]$ shutdown with $[red3_1]$CTRL+C$[/]$ or $[deeppink4]$!q[uit]$[/]$.");
|
||||||
|
Logger.Info("{0}", IsCancellationRequested());
|
||||||
while (!IsCancellationRequested())
|
while (!IsCancellationRequested())
|
||||||
{
|
{
|
||||||
var line = Console.ReadLine();
|
var line = Console.ReadLine();
|
||||||
if (line is null or "!q" or "!quit" or "!exit")
|
if(line == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (line == "!q" || line == "!quit" || line == "!exit")
|
||||||
{
|
{
|
||||||
|
Logger.Info("Break !quit");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line is "!cls" or "!clear" or "cls" or "clear")
|
if (line == "!cls" || line == "!clear" || line == "cls" || line == "clear")
|
||||||
{
|
{
|
||||||
AnsiConsole.Clear();
|
AnsiConsole.Clear();
|
||||||
AnsiConsole.Cursor.SetPosition(0, 0);
|
AnsiConsole.Cursor.SetPosition(0, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.ToLower().StartsWith("!sno"))
|
if (line.StartsWith("!sno", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
if (IsTargetEnabled("ansi"))
|
if (IsTargetEnabled("ansi"))
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
MPQStorage.Data.SnoBreakdown(line.ToLower().Equals("!sno 1") ||
|
|
||||||
line.ToLower().Equals("!sno true"));
|
MPQStorage.Data.SnoBreakdown(
|
||||||
|
line.Equals("!sno 1", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
line.Equals("!sno true", StringComparison.OrdinalIgnoreCase)
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,10 +305,12 @@ namespace DiIiS_NA
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
Logger.Info(e.ToString());
|
||||||
Shutdown(e);
|
Shutdown(e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Logger.Trace("Shutdown in progress !");
|
||||||
await Task.WhenAll(
|
await Task.WhenAll(
|
||||||
boss.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)),
|
boss.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)),
|
||||||
worker.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)));
|
worker.ShutdownGracefullyAsync(TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(1)));
|
||||||
@ -308,7 +319,10 @@ namespace DiIiS_NA
|
|||||||
|
|
||||||
private static bool _shuttingDown = false;
|
private static bool _shuttingDown = false;
|
||||||
public static void Shutdown(Exception exception = null)
|
public static void Shutdown(Exception exception = null)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Logger.Trace("Shutdown here");
|
||||||
|
Logger.Trace("Stack trace at shutdown: " + Environment.StackTrace); // Log the stack trace
|
||||||
if (_shuttingDown) return;
|
if (_shuttingDown) return;
|
||||||
_shuttingDown = true;
|
_shuttingDown = true;
|
||||||
if (!IsCancellationRequested())
|
if (!IsCancellationRequested())
|
||||||
@ -425,6 +439,7 @@ namespace DiIiS_NA
|
|||||||
Logger.Trace("Discord bot Disabled..");
|
Logger.Trace("Discord bot Disabled..");
|
||||||
}
|
}
|
||||||
DiIiS_NA.GameServer.GSSystem.GeneratorsSystem.SpawnGenerator.RegenerateDensity();
|
DiIiS_NA.GameServer.GSSystem.GeneratorsSystem.SpawnGenerator.RegenerateDensity();
|
||||||
|
Logger.Trace("We are here first");
|
||||||
DiIiS_NA.GameServer.ClientSystem.GameServer.GSBackend = new GsBackend(LoginServerConfig.Instance.BindIP, LoginServerConfig.Instance.WebPort);
|
DiIiS_NA.GameServer.ClientSystem.GameServer.GSBackend = new GsBackend(LoginServerConfig.Instance.BindIP, LoginServerConfig.Instance.WebPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ MotdRemoteUrl = https://your-site.local/yourmotd
|
|||||||
IP = 127.0.0.1
|
IP = 127.0.0.1
|
||||||
PublicIP = 127.0.0.1
|
PublicIP = 127.0.0.1
|
||||||
PORT = 83
|
PORT = 83
|
||||||
Public = true
|
Public = false
|
||||||
|
|
||||||
; Game Server Settings
|
; Game Server Settings
|
||||||
[Game-Server]
|
[Game-Server]
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<property name="use_proxy_validator">true</property>
|
<property name="use_proxy_validator">true</property>
|
||||||
<property name="command_timeout">0</property>
|
<property name="command_timeout">0</property>
|
||||||
<property name="connection.connection_string">
|
<property name="connection.connection_string">
|
||||||
Server=localhost;Database=diiis;User ID=postgres;Password=password
|
Server=diiis-na-db;Database=diiis;User ID=postgres;Password=postgres
|
||||||
</property>
|
</property>
|
||||||
<property name="connection.release_mode">on_close</property>
|
<property name="connection.release_mode">on_close</property>
|
||||||
<property name="adonet.batch_size">0</property>
|
<property name="adonet.batch_size">0</property>
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<property name="use_proxy_validator">true</property>
|
<property name="use_proxy_validator">true</property>
|
||||||
<property name="command_timeout">0</property>
|
<property name="command_timeout">0</property>
|
||||||
<property name="connection.connection_string">
|
<property name="connection.connection_string">
|
||||||
Server=localhost;Database=worlds;User ID=postgres;Password=password
|
Server=diiis-na-db;Database=worlds;User ID=postgres;Password=postgres
|
||||||
</property>
|
</property>
|
||||||
<property name="connection.release_mode">on_close</property>
|
<property name="connection.release_mode">on_close</property>
|
||||||
<property name="adonet.batch_size">0</property>
|
<property name="adonet.batch_size">0</property>
|
||||||
|
|||||||
Loading…
Reference in New Issue
user.block.title