Skip to content

Commit da8bb44

Browse files
committed
Beta 8
1 parent e89414d commit da8bb44

6 files changed

Lines changed: 35 additions & 34 deletions

File tree

Modules/CustomRpcSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public static void RpcSetCustomRole(this CustomRpcSender sender, byte playerId,
346346

347347
public static void RpcSetName(this CustomRpcSender sender, PlayerControl player, string name, PlayerControl seer = null)
348348
{
349-
bool seerIsNull = seer;
349+
bool seerIsNull = seer == null;
350350
int targetClientId = seerIsNull ? -1 : seer.OwnerId;
351351

352352
name = name.Replace("color=", string.Empty);

Modules/Utils.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ CustomRpcSender SendTempTitleMessage(string tempTitle)
16721672
}
16731673
catch { Logger.Info(" Message sent", "SendMessage"); }
16741674

1675-
if (noSplit)
1675+
if (multiple)
16761676
{
16771677
text = text.TrimStart('\n');
16781678
if (!text.EndsWith('\n')) text += "\n";
@@ -1705,7 +1705,7 @@ CustomRpcSender SendTempTitleMessage(string tempTitle)
17051705
Logger.Info($"Set sender name to {sender.GetRealName()}; Final", "SendMessage");
17061706
writer.AutoStartRpc(sender.NetId, RpcCalls.SetName, targetClientId)
17071707
.Write(sender.Data.NetId)
1708-
.Write(Main.AllPlayerNames.GetValueOrDefault(sender.PlayerId, string.Empty))
1708+
.Write(sender.GetRealName())
17091709
.EndRpc();
17101710

17111711
if (!multiple) writer.SendMessage();
@@ -3458,7 +3458,6 @@ public static string PadRightV2(this object text, int num)
34583458
return t?.PadRight(Mathf.Max(num - (bc - t.Length), 0));
34593459
}
34603460

3461-
private static int previousDumpEnd = 0;
34623461
public static void DumpLog(bool open = true)
34633462
{
34643463
var f = $"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}/TOHE-logs/";

Patches/ChatCommandPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public static bool Prefix(ChatController __instance)
416416
{
417417
string name = PlayerControl.LocalPlayer.GetRealName();
418418

419-
Utils.SendMessage(text.Insert(0, new('\n', name.Count(x => x == '\n'))), title: name, addToHistory: false, noSplit: true, importance: MessageImportance.High);
419+
Utils.SendMessage(text.Insert(0, new('\n', name.Count(x => x == '\n'))), title: name, addToHistory: false, noSplit: true, final: true, importance: MessageImportance.High);
420420

421421
canceled = true;
422422
__instance.freeChatField.textArea.Clear();

Patches/ClientPatch.cs

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,34 @@
55

66
namespace TOHE;
77

8-
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.MakePublic))]
9-
internal class MakePublicPatch
10-
{
11-
public static bool Prefix(/*GameStartManager __instance*/)
12-
{
13-
// 定数設定による公開ルームブロック
14-
if (!Main.AllowPublicRoom)
15-
{
16-
var message = GetString("DisabledByProgram");
17-
Logger.Info(message, "MakePublicPatch");
18-
Logger.SendInGame(message);
19-
return false;
20-
}
21-
if (ModUpdater.isBroken || (ModUpdater.hasUpdate && ModUpdater.forceUpdate) || !VersionChecker.IsSupported)
22-
{
23-
var message = "";
24-
if (!VersionChecker.IsSupported) message = GetString("UnsupportedVersion");
25-
if (ModUpdater.isBroken) message = GetString("ModBrokenMessage");
26-
if (ModUpdater.hasUpdate) message = GetString("CanNotJoinPublicRoomNoLatest");
27-
Logger.Info(message, "MakePublicPatch");
28-
Logger.SendInGame(message);
29-
return false;
30-
}
31-
return true;
32-
}
33-
}
8+
// [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.MakePublic))]
9+
// internal class MakePublicPatch
10+
// {
11+
// public static bool Prefix(/*GameStartManager __instance*/)
12+
// {
13+
// // 定数設定による公開ルームブロック
14+
// if (!Main.AllowPublicRoom)
15+
// {
16+
// var message = GetString("DisabledByProgram");
17+
// Logger.Info(message, "MakePublicPatch");
18+
// Logger.SendInGame(message);
19+
// return false;
20+
// }
21+
// if (ModUpdater.isBroken || (ModUpdater.hasUpdate && ModUpdater.forceUpdate) || !VersionChecker.IsSupported)
22+
// {
23+
// var message = "";
24+
// if (!VersionChecker.IsSupported) message = GetString("UnsupportedVersion");
25+
// if (ModUpdater.isBroken) message = GetString("ModBrokenMessage");
26+
// if (ModUpdater.hasUpdate) message = GetString("CanNotJoinPublicRoomNoLatest");
27+
// Logger.Info(message, "MakePublicPatch");
28+
// Logger.SendInGame(message);
29+
// return false;
30+
// }
31+
// return true;
32+
// }
33+
// }
34+
35+
3436
[HarmonyPatch(typeof(MMOnlineManager), nameof(MMOnlineManager.Start))]
3537
internal class MMOnlineManagerStartPatch
3638
{

Roles/Crewmate/CopyCat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public override void Remove(byte playerId) //only to be used when copycat's role
5656
// playerIdList.Remove(playerId);
5757
}
5858
public static bool CanCopyTeamChangingAddon() => CopyTeamChangingAddon.GetBool();
59-
public static bool NoHaveTask(byte playerId, bool ForRecompute) => playerIdList.Contains(playerId) && (playerId.GetPlayer().GetCustomRole().IsDesyncRole() || ForRecompute);
59+
public static bool NoHaveTask(byte playerId, bool ForRecompute) => playerIdList.Contains(playerId) && playerId.GetPlayer() && (playerId.GetPlayer().GetCustomRole().IsDesyncRole() || ForRecompute);
6060
public override bool CanUseKillButton(PlayerControl pc) => true;
6161
public override bool CanUseImpostorVentButton(PlayerControl pc) => playerIdList.Contains(pc.PlayerId);
6262
public override void SetKillCooldown(byte id) => Main.AllPlayerKillCooldown[id] = Utils.GetPlayerById(id).IsAlive() ? CurrentKillCooldown : 300f;

main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public class Main : BasePlugin
5757

5858
public const string PluginGuid = "com.0xdrmoe.townofhostenhanced";
5959
public const string PluginGuid4 = "90759289-1d0d-494b-b36c-839f93ae0df1"; // for matchmaking token
60-
public const string PluginVersion = "2026.0220.242.07100"; // YEAR.MMDD.VERSION.CANARYDEV
61-
public const string PluginDisplayVersion = "2.4.2 Beta 7.1";
60+
public const string PluginVersion = "2026.0220.242.08100"; // YEAR.MMDD.VERSION.CANARYDEV
61+
public const string PluginDisplayVersion = "2.4.2 Beta 8";
6262
public static readonly List<(int year, int month, int day, int revision)> SupportedVersionAU =
6363
[
6464
(2025, 11, 18, 0), // 2025.11.18 & 17.1

0 commit comments

Comments
 (0)