mirror of
https://github.com/Empostor/Empostor.git
synced 2026-10-19 15:51:39 +00:00
丨 & Plugin Update
This commit is contained in:
1 parent
0e70cafd23
commit
354bc1757d
10 files changed
+40
-20
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -9,6 +9,11 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"empostor_version": "2.0.0",
|
"empostor_version": "2.0.0",
|
||||||
"download_url": "https://raw.githubusercontent.com/Empostor/Empostor/master/marketplace/Empostor.Plugin.Chat.dll"
|
"download_url": "https://raw.githubusercontent.com/Empostor/Empostor/master/marketplace/Empostor.Plugin.Chat.dll"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "1.1.0",
|
||||||
|
"empostor_version": "2.0.0",
|
||||||
|
"download_url": "https://raw.githubusercontent.com/Empostor/Empostor/master/marketplace/Empostor.Plugin.Chat1.1.0.dll"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
|
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
".NETStandard,Version=v2.0/win-x64": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,12 @@
|
|||||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Microsoft.NET.ILLink.Tasks": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[8.0.28, )",
|
||||||
|
"resolved": "8.0.28",
|
||||||
|
"contentHash": "XMqgVjlLxLqWmEh3c49haXLQwsMNtvo6YscUaqfvEGfg1iA8hnYgkUVq3i9Zu9gKeNKMWiiZKVwZExc/qyEAsQ=="
|
||||||
|
},
|
||||||
"StyleCop.Analyzers": {
|
"StyleCop.Analyzers": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.2.0-beta.556, )",
|
"requested": "[1.2.0-beta.556, )",
|
||||||
@@ -139,6 +145,7 @@
|
|||||||
"NextFast.Hazel.Abstractions": {
|
"NextFast.Hazel.Abstractions": {
|
||||||
"type": "Project"
|
"type": "Project"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"net8.0/win-x64": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1008,7 +1008,7 @@ namespace Empostor.Server.Net.Inner.Objects
|
|||||||
{
|
{
|
||||||
if (PlayerInfo.PlayerLevel != level)
|
if (PlayerInfo.PlayerLevel != level)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("★ {Name} ({Id}) | Level {Old} → {New}",
|
_logger.LogInformation("★ {Name} ({Id}) │ Level {Old} → {New}",
|
||||||
sender.Client.Name, sender.Client.Id, PlayerInfo.PlayerLevel, level);
|
sender.Client.Name, sender.Client.Id, PlayerInfo.PlayerLevel, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ namespace Empostor.Server.Net.Manager
|
|||||||
if (versionCompare == ICompatibilityManager.VersionCompareResult.ServerTooOld
|
if (versionCompare == ICompatibilityManager.VersionCompareResult.ServerTooOld
|
||||||
&& _compatibilityConfig.AllowFutureGameVersions && platformSpecificData != null)
|
&& _compatibilityConfig.AllowFutureGameVersions && platformSpecificData != null)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("#{Id} {Name} | using future version {Version}", id, name, clientVersion);
|
_logger.LogWarning("#{Id} {Name} │ using future version {Version}", id, name, clientVersion);
|
||||||
}
|
}
|
||||||
else if (versionCompare != ICompatibilityManager.VersionCompareResult.Compatible
|
else if (versionCompare != ICompatibilityManager.VersionCompareResult.Compatible
|
||||||
|| platformSpecificData == null)
|
|| platformSpecificData == null)
|
||||||
@@ -134,7 +134,7 @@ namespace Empostor.Server.Net.Manager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("#{Id} {Name} | host authority enabled", id, name);
|
_logger.LogInformation("#{Id} {Name} │ host authority enabled", id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.Length > 10) { await connection.CustomDisconnectAsync(DisconnectReason.Custom, DisconnectMessages.UsernameLength); return; }
|
if (name.Length > 10) { await connection.CustomDisconnectAsync(DisconnectReason.Custom, DisconnectMessages.UsernameLength); return; }
|
||||||
@@ -144,11 +144,12 @@ namespace Empostor.Server.Net.Manager
|
|||||||
UserAuthInfo? authInfo = null;
|
UserAuthInfo? authInfo = null;
|
||||||
var clientIp = connection.EndPoint?.Address;
|
var clientIp = connection.EndPoint?.Address;
|
||||||
var location = await _ipGeo.GetLocationAsync(clientIp);
|
var location = await _ipGeo.GetLocationAsync(clientIp);
|
||||||
|
var locationStr = string.IsNullOrEmpty(location) ? "—" : location;
|
||||||
var lang = LanguageHelper.GetDisplayName(language);
|
var lang = LanguageHelper.GetDisplayName(language);
|
||||||
var platformStr = platformSpecificData?.Platform.ToString() ?? "Unknown";
|
var platformStr = platformSpecificData?.Platform.ToString() ?? "Unknown";
|
||||||
var reactorMods = connection.GetReactorMods();
|
var reactorMods = connection.GetReactorMods();
|
||||||
var reactorStr = reactorMods?.Mods is { Count: > 0 } mods
|
var reactorStr = reactorMods?.Mods is { Count: > 0 } mods
|
||||||
? $" | Reactor: {string.Join(", ", System.Linq.Enumerable.Select(mods, m => $"{m.Id} {m.Version}"))}"
|
? $" │ Reactor: {string.Join(", ", System.Linq.Enumerable.Select(mods, m => $"{m.Id} {m.Version}"))}"
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
||||||
// Primary: match by delta port (nonce)
|
// Primary: match by delta port (nonce)
|
||||||
@@ -184,13 +185,13 @@ namespace Empostor.Server.Net.Manager
|
|||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"#{Id} {Name} | port {Port} | {Location} | {Lang} | {Platform} | FC {FriendCode} | {HashPuid}{Reactor}",
|
"#{Id} {Name} │ port {Port} │ {Location} │ {Lang} │ {Platform} │ FC {FriendCode} │ {HashPuid}{Reactor}",
|
||||||
id, name, deltaPort, location, lang, platformStr, friendCode ?? "unknown", HashPuid(authInfo.ProductUserId), reactorStr);
|
id, name, deltaPort, locationStr, lang, platformStr, friendCode ?? "unknown", HashPuid(authInfo.ProductUserId), reactorStr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogWarning(
|
_logger.LogWarning(
|
||||||
"#{Id} {Name} | port {Port} has no auth info, falling back to IP",
|
"#{Id} {Name} │ port {Port} has no auth info, falling back to IP",
|
||||||
id, name, deltaPort);
|
id, name, deltaPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,14 +204,14 @@ namespace Empostor.Server.Net.Manager
|
|||||||
{
|
{
|
||||||
friendCode = authInfo.FriendCode;
|
friendCode = authInfo.FriendCode;
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"#{Id} {Name} | {Ip} | {Location} | {Lang} | {Platform} | FC {FriendCode} | {HashPuid}{Reactor}",
|
"#{Id} {Name} │ {Ip} │ {Location} │ {Lang} │ {Platform} │ FC {FriendCode} │ {HashPuid}{Reactor}",
|
||||||
id, name, NormalizeIp(clientIp), location, lang, platformStr, friendCode ?? "unknown", HashPuid(authInfo.ProductUserId), reactorStr);
|
id, name, NormalizeIp(clientIp), locationStr, lang, platformStr, friendCode ?? "unknown", HashPuid(authInfo.ProductUserId), reactorStr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogWarning(
|
_logger.LogWarning(
|
||||||
"#{Id} {Name} | no auth | port {Port} | {Ip} | {Location} | {Lang} | {Platform}{Reactor}",
|
"#{Id} {Name} │ no auth │ port {Port} │ {Ip} │ {Location} │ {Lang} │ {Platform}{Reactor}",
|
||||||
id, name, deltaPort, NormalizeIp(clientIp), location, lang, platformStr, reactorStr);
|
id, name, deltaPort, NormalizeIp(clientIp), locationStr, lang, platformStr, reactorStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +221,7 @@ namespace Empostor.Server.Net.Manager
|
|||||||
client.DeltaPort = deltaPort;
|
client.DeltaPort = deltaPort;
|
||||||
|
|
||||||
client.Id = id;
|
client.Id = id;
|
||||||
_logger.LogDebug("#{Id} {Name} | connected | FC={FC} | port {DP}", id, name, client.FriendCode ?? "(none)", deltaPort);
|
_logger.LogDebug("#{Id} {Name} │ connected │ FC={FC} │ port {DP}", id, name, client.FriendCode ?? "(none)", deltaPort);
|
||||||
_clients.TryAdd(id, client);
|
_clients.TryAdd(id, client);
|
||||||
await _eventManager.CallAsync(new ClientConnectedEvent(connection, client));
|
await _eventManager.CallAsync(new ClientConnectedEvent(connection, client));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace Empostor.Server.Net.State
|
|||||||
|
|
||||||
public async ValueTask HandleKickPlayer(int playerId, bool isBan)
|
public async ValueTask HandleKickPlayer(int playerId, bool isBan)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("✂ Player {PlayerId} | Ban={IsBan}", playerId, isBan);
|
_logger.LogInformation("✂ Player {PlayerId} │ Ban={IsBan}", playerId, isBan);
|
||||||
using (var kickMsg = MessageWriter.Get(MessageType.Reliable))
|
using (var kickMsg = MessageWriter.Get(MessageType.Reliable))
|
||||||
{
|
{
|
||||||
WriteKickPlayerMessage(kickMsg, false, playerId, isBan);
|
WriteKickPlayerMessage(kickMsg, false, playerId, isBan);
|
||||||
@@ -130,10 +130,10 @@ namespace Empostor.Server.Net.State
|
|||||||
var platformStr = string.IsNullOrEmpty(platformName) ? platform : $"{platform}/{platformName}";
|
var platformStr = string.IsNullOrEmpty(platformName) ? platform : $"{platform}/{platformName}";
|
||||||
var reactorMods = client.GetReactorMods();
|
var reactorMods = client.GetReactorMods();
|
||||||
var reactorStr = reactorMods?.Mods is { Count: > 0 } mods
|
var reactorStr = reactorMods?.Mods is { Count: > 0 } mods
|
||||||
? $" | Reactor: {string.Join(", ", System.Linq.Enumerable.Select(mods, m => $"{m.Id} {m.Version}"))}"
|
? $" │ Reactor: {string.Join(", ", System.Linq.Enumerable.Select(mods, m => $"{m.Id} {m.Version}"))}"
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
||||||
_logger.LogInformation("▶ {Name} ({Id}) joined | {Lang} | {Platform} | v{Version} | Authority:{Authority} | port {DeltaPort}{Reactor}",
|
_logger.LogInformation("▶ {Name} ({Id}) joined │ {Lang} │ {Platform} │ v{Version} │ Authority:{Authority} │ port {DeltaPort}{Reactor}",
|
||||||
sender.Client.Name, sender.Client.Id, lang, platformStr, version, authority, deltaPort, reactorStr);
|
sender.Client.Name, sender.Client.Id, lang, platformStr, version, authority, deltaPort, reactorStr);
|
||||||
|
|
||||||
if (isNew)
|
if (isNew)
|
||||||
@@ -224,7 +224,7 @@ namespace Empostor.Server.Net.State
|
|||||||
private async ValueTask HandleJoinGameNext(ClientPlayer sender, bool isNew)
|
private async ValueTask HandleJoinGameNext(ClientPlayer sender, bool isNew)
|
||||||
{
|
{
|
||||||
var authority = sender.Client.GameVersion.HasDisableServerAuthorityFlag ? "true" : "false";
|
var authority = sender.Client.GameVersion.HasDisableServerAuthorityFlag ? "true" : "false";
|
||||||
_logger.LogInformation("↻ {Name} ({Id}) rejoined | Authority:{Authority} | port {DeltaPort}",
|
_logger.LogInformation("↻ {Name} ({Id}) rejoined │ Authority:{Authority} │ port {DeltaPort}",
|
||||||
sender.Client.Name, sender.Client.Id, authority, sender.Client.DeltaPort);
|
sender.Client.Name, sender.Client.Id, authority, sender.Client.DeltaPort);
|
||||||
|
|
||||||
if (isNew)
|
if (isNew)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Empostor.Server.Net.State
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("◀ {Name} ({Id}) left | {Reason} | {HashPuid}",
|
_logger.LogInformation("◀ {Name} ({Id}) left │ {Reason} │ {HashPuid}",
|
||||||
player.Client.Name, playerId, reason,
|
player.Client.Name, playerId, reason,
|
||||||
player.Client.ProductUserId?.Length >= 9 ? player.Client.ProductUserId[..9] : player.Client.ProductUserId ?? "0");
|
player.Client.ProductUserId?.Length >= 9 ? player.Client.ProductUserId[..9] : player.Client.ProductUserId ?? "0");
|
||||||
if (GameState == GameStates.Starting || GameState == GameStates.Started || GameState == GameStates.NotStarted)
|
if (GameState == GameStates.Starting || GameState == GameStates.Started || GameState == GameStates.NotStarted)
|
||||||
@@ -71,7 +71,7 @@ namespace Empostor.Server.Net.State
|
|||||||
await Task.Delay(_timeoutConfig.ConnectionTimeout);
|
await Task.Delay(_timeoutConfig.ConnectionTimeout);
|
||||||
if (player.Client.Connection.IsConnected && player.Client.Connection is HazelConnection hazel)
|
if (player.Client.Connection.IsConnected && player.Client.Connection is HazelConnection hazel)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("◀ {Name} ({Id}) left | kept connection, disposing", player.Client.Name, playerId);
|
_logger.LogInformation("◀ {Name} ({Id}) left │ kept connection, disposing", player.Client.Name, playerId);
|
||||||
await player.Client.DisconnectAsync(isBan ? DisconnectReason.Banned : DisconnectReason.Kicked);
|
await player.Client.DisconnectAsync(isBan ? DisconnectReason.Banned : DisconnectReason.Kicked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -58,6 +58,12 @@
|
|||||||
"resolved": "8.0.1",
|
"resolved": "8.0.1",
|
||||||
"contentHash": "X21b8D6z58EG34OMLH955750mFaEaGs5xLGe9Vyi3059Cgb3sk+p2k/JlQXaieEBRrk+SVlFzDei3Q6PdVzJOA=="
|
"contentHash": "X21b8D6z58EG34OMLH955750mFaEaGs5xLGe9Vyi3059Cgb3sk+p2k/JlQXaieEBRrk+SVlFzDei3Q6PdVzJOA=="
|
||||||
},
|
},
|
||||||
|
"Microsoft.NET.ILLink.Tasks": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[8.0.28, )",
|
||||||
|
"resolved": "8.0.28",
|
||||||
|
"contentHash": "XMqgVjlLxLqWmEh3c49haXLQwsMNtvo6YscUaqfvEGfg1iA8hnYgkUVq3i9Zu9gKeNKMWiiZKVwZExc/qyEAsQ=="
|
||||||
|
},
|
||||||
"Serilog.Extensions.Hosting": {
|
"Serilog.Extensions.Hosting": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[8.0.0, )",
|
"requested": "[8.0.0, )",
|
||||||
|
|||||||
Reference in new issue
Block a user