mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-06 11:49:21 +00:00
Archiving mods
This commit is contained in:
parent
1000da7100
commit
5d2bc0e6b8
20 changed files with 9 additions and 5 deletions
|
@ -1,31 +0,0 @@
|
|||
using ABI_RC.Core.UI;
|
||||
using DarkRift.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ml_sci
|
||||
{
|
||||
public class ServerConnectionInfo : MelonLoader.MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
HarmonyInstance.Patch(
|
||||
typeof(ABI_RC.Core.Networking.NetworkManager).GetMethod("OnGameNetworkConnectionClosed", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(ServerConnectionInfo).GetMethod(nameof(OnGameNetworkConnectionClosed), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
static void OnGameNetworkConnectionClosed(object __0, DisconnectedEventArgs __1)
|
||||
{
|
||||
try
|
||||
{
|
||||
if((CohtmlHud.Instance != null) && (__1 != null) && (!__1.LocalDisconnect))
|
||||
CohtmlHud.Instance.ViewDropTextImmediate("(Local) Client", "Connection lost", (__1.Error != System.Net.Sockets.SocketError.Success) ? ("Reason: " + __1.Error.ToString()) : "");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue