using BepInEx;
using HarmonyLib;
using System;

namespace CustomServerMod
{
    [BepInPlugin("com.mod.customserver", "Custom Server Mod", "1.0.0")]
    public class CustomServerMod : BaseUnityPlugin
    {
        public static BepInEx.Logging.ManualLogSource Log;

        // Toggles for debugging and reverse engineering
        public static bool RedirectTraffic = true;
        public static bool LogPackets = true;

        void Awake()
        {
            Log = Logger;
            Log.LogInfo("Custom Server Mod Loading...");

            try
            {
                var harmony = new Harmony("com.mod.customserver");
                harmony.PatchAll();
                Log.LogInfo("Custom Server Mod Patched Successfully!");
            }
            catch (Exception e)
            {
                Log.LogError("Failed to patch Custom Server Mod: " + e.Message);
                Log.LogError(e.StackTrace);
            }
        }
    }
}
