Skip to content

Commit 68ee00c

Browse files
committed
Fix translations
1 parent 843a58d commit 68ee00c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Feli.RocketMod.JoinLeaveMessages/Feli.RocketMod.JoinLeaveMessages.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>net461</TargetFramework>
55
<LangVersion>latest</LangVersion>
6-
<Version>1.0.0</Version>
7-
<AssemblyVersion>1.0.0</AssemblyVersion>
6+
<Version>1.0.1</Version>
7+
<AssemblyVersion>1.0.1</AssemblyVersion>
88
</PropertyGroup>
99

1010
<ItemGroup>

Feli.RocketMod.JoinLeaveMessages/Helpers/IpGeolocationHelper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public static string GetCountryFromIp(string address)
1212

1313
var response = client.GetAsync($"http://ip-api.com/json/{address}?fields=status,message,country").GetAwaiter().GetResult();
1414

15+
client.Dispose();
16+
1517
if (!response.IsSuccessStatusCode)
1618
{
1719
Logger.LogError($"HTTP Error: {(int)response.StatusCode}, {response.StatusCode}");

Feli.RocketMod.JoinLeaveMessages/Plugin.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public class Plugin : RocketPlugin<Configuration>
1313
{
1414
public override TranslationList DefaultTranslations => new TranslationList
1515
{
16-
{"Join", "{color=yellow}{0} has connected to the server from {1}{/color}" },
17-
{"Leave", "{color=red}{0} disconnected from the server{/color}" }
16+
{"Join", "<color=yellow>{0} has connected to the server from {1}</color>" },
17+
{"Leave", "<color=red>{0} disconnected from the server</color>" }
1818
};
1919

2020
protected override void Load()
@@ -25,7 +25,7 @@ protected override void Load()
2525
if(Configuration.Instance.LeaveMessages)
2626
U.Events.OnPlayerDisconnected += OnPlayerDisconnected;
2727

28-
Logger.Log($"JoinLeaveMessages plugin v1.0.0 loaded !");
28+
Logger.Log($"JoinLeaveMessages plugin v1.0.1 loaded !");
2929
Logger.Log("Do you want more cool plugins? Join now: https://discord.gg/4FF2548 !");
3030
}
3131

@@ -35,20 +35,19 @@ private void OnPlayerConnected(UnturnedPlayer player)
3535

3636
if (Configuration.Instance.ShowCountry)
3737
country = IpGeolocationHelper.GetCountryFromIp(player.IP);
38-
38+
3939
var message = Translate("Join", player.DisplayName, country);
4040

4141
Logger.Log(message);
42-
ChatManager.serverSendMessage(message.Replace("{", "<").Replace("}", ">"), Color.green, mode: EChatMode.GLOBAL, iconURL: Configuration.Instance.CustomImageUrl, useRichTextFormatting: true);
43-
42+
ChatManager.serverSendMessage(message, Color.green, mode: EChatMode.GLOBAL, iconURL: Configuration.Instance.CustomImageUrl, useRichTextFormatting: true);
4443
}
4544

4645
private void OnPlayerDisconnected(UnturnedPlayer player)
4746
{
4847
var message = Translate("Leave", player.DisplayName);
4948

5049
Logger.Log(message);
51-
ChatManager.serverSendMessage(message.Replace("{", "<").Replace("}", ">"), Color.green, mode: EChatMode.GLOBAL, iconURL: Configuration.Instance.CustomImageUrl, useRichTextFormatting: true);
50+
ChatManager.serverSendMessage(message, Color.green, mode: EChatMode.GLOBAL, iconURL: Configuration.Instance.CustomImageUrl, useRichTextFormatting: true);
5251
}
5352

5453
protected override void Unload()

0 commit comments

Comments
 (0)