Exemple #1
0
        private static void RPC_ClientSetConfigValues(long sender, ZPackage zpkg)
        {
            if (ZNet.instance.IsDedicated() || ZNet.instance.IsServer())
            {
                return;
            }

            var configSettings = Settings.MapSettings.ServerConfigs;

            foreach (var configSetting in configSettings)
            {
                var config = Settings.MapSettings.ConfigEntries[configSetting.Key];
                config.BoxedValue = zpkg.ReadVariable(configSetting.Value);
                Utils.Log($"Server forced config: {configSetting.Key}: {config.BoxedValue}");
            }
        }
Exemple #2
0
        private static void RPC_ClientCheckModVersion(long sender, ZPackage zpkg)
        {
            if (ZNet.instance == null)
            {
                Utils.Log("No ZNet instance found.");
                return;
            }

            if (ZNet.instance.IsDedicated() || ZNet.instance.IsServer())
            {
                Utils.Log("This is server. Don't run Client CheckModVersion");
                return;
            }

            var serverVersion = (string)zpkg.ReadVariable(typeof(string));

            Utils.Log($"Checking Map Sharing Made Easy Version: Server: {serverVersion} client {MapSharingMadeEasy.instance.PluginVersion}");
            if (serverVersion != MapSharingMadeEasy.instance.PluginVersion)
            {
                Utils.Log($"Wrong mod version detected for Map Sharing Made Easy: Server: {serverVersion} client {MapSharingMadeEasy.instance.PluginVersion}");
                MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, $"You must be running {serverVersion} of Map Sharing Made Easy to connect to this server.");
                Game.instance.Logout();
            }
        }