Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
SteelSoul

Как привязать Server Uptime ко времени компа?

Как привязать Server Uptime ко времени компа?

Чтобы после запуска сервера, прошедшее время исчислялось от заданного на компе.

Edited by SteelSoul (see edit history)

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Как привязать Server Uptime ко времени компа?

Чтобы после запуска сервера, прошедшее время исчислялось от заданного на компе.

В папке Arma2\instance_11_Chernarus файл  HiveExt 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 13
 
поменять на 
[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Local
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 24 
 Если я правильно понял и ты про то спрашиваешь

Share this post


Link to post
Share on other sites



  • 0

Как привязать Server Uptime ко времени компа?

Чтобы после запуска сервера, прошедшее время исчислялось от заданного на компе.

В дебаг мониторе, обратный отсчет либо дергать постоянно SQL (где то тут было на форуме), и оттуда скриптом тянуть(скрипт самому писать), или > платный раздел.

Share this post


Link to post
Share on other sites
  • 0

 

В папке Arma2\instance_11_Chernarus файл  HiveExt 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 13
 
поменять на 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Local
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 24 
 Если я правильно понял и ты про то спрашиваешь

Мне надо чтобы отсчет времени после запуска сервера исчислялся от времени компа, а не от времени запуска сервера

 

В дебаг мониторе, обратный отсчет либо дергать постоянно SQL (где то тут было на форуме), и оттуда скриптом тянуть(скрипт самому писать), или > платный раздел.

что за платный раздел?

Share this post


Link to post
Share on other sites
  • 0

Мне надо чтобы отсчет времени после запуска сервера исчислялся от времени компа, а не от времени запуска сервера

 

что за платный раздел?

скрипт на заказ.

был топик в гайдах. там 3 или 4 разных способа получения реального времени было.

Share this post


Link to post
Share on other sites
  • 0

 

В папке Arma2\instance_11_Chernarus файл  HiveExt 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 13
 
поменять на 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Local
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 24 
 Если я правильно понял и ты про то спрашиваешь

У меня АРМА3, нет такого файла

 

скрипт на заказ.

был топик в гайдах. там 3 или 4 разных способа получения реального времени было.

Ссылку можно?

Share this post


Link to post
Share on other sites
  • 0

SteelSoul сказал(а) 07 Сен 2015 - 16:15:

У меня АРМА3, нет такого файла

 

 

Ссылку можно?

Ах, а3. Пардон, не заметил. Мой топик был, ищи по моим публикациям. Но он под а2, если есть голова и руки откуда надо растут, не проблема будет адаптировать,

Share this post


Link to post
Share on other sites
  • 0

 

В папке Arma2\instance_11_Chernarus файл  HiveExt 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 13
 
поменять на 

[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Local
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 24 
 Если я правильно понял и ты про то спрашиваешь

Нашел такую хрень, оно или нет?

    // Setting Server Date and Time

    _dateChanged = false;

    _date = date;

    

    _staticDateTime = [_serverSettingsConfig, "StaticDateTime", []] call EPOCH_fnc_returnConfigEntry;

    _timeDifference = [_serverSettingsConfig, "timeDifference", 0] call EPOCH_fnc_returnConfigEntry;

    

    if (_staticDateTime isEqualto []) then {

        _response = "epochserver" callExtension "510";

        if (_response != "") then {

            diag_log format ["Epoch: Set Real Time: %1", _response];

            _date = call compile _response;

            _date resize 5;

            _date set[0, (_date select 0) + 21];

            _date set[3, (_date select 3) + _timeDifference];

            _dateChanged = true;

        };

    } else {

        {

            if (_x != 0) then {

                _date set [_forEachIndex, _x];

                _dateChanged = true;

            };

        }forEach _staticDateTime;

    };

    if (_dateChanged) then {

        setDate _date;

    };

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By -Reks-
      Продам сервер по DayZ/ Есть 
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • By SemKa1407
      Ссылка на архив: https://disk.yandex.ru/d/WmYW5AcZozGSiA
      Инструкция, написанная на коленке, есть в архиве (для полных нулей).
    • By SemKa1407
      Будьте добры, помогите пожалуйста.
      Проблема в том, что не приходят сообщения в нужное время. Скорее всего неправильная логика.
      class FakeChatNotifier { ref Timer m_Timer; ref Timer m_MessageTimer; bool m_IsActive; // Списки диалогов ref array<ref array<string>> m_WelcomeDialogs; ref array<ref array<string>> m_RegularDialogs; ref array<ref array<string>> m_ThreatDialogs; void FakeChatNotifier() { m_Timer = new Timer(); m_MessageTimer = new Timer(); m_IsActive = false; // Инициализация диалогов InitializeDialogs(); Print("[FakeChatNotifier] Initialized"); // Лог для проверки инициализации } void InitializeDialogs() { // Приветственные диалоги m_WelcomeDialogs = new array<ref array<string>>; m_WelcomeDialogs.Insert({"Hello!", "How are you?"}); m_WelcomeDialogs.Insert({"Anyone alive?", "Yes, I am here. What's new?"}); m_WelcomeDialogs.Insert({"What's the situation?", "It seems quiet, but stay sharp."}); // Обычные диалоги m_RegularDialogs = new array<ref array<string>>; m_RegularDialogs.Insert({"Check radio frequency 98.7", "Got it, I'll stay alert."}); m_RegularDialogs.Insert({"Never trust strangers", "Right, it's every man for himself here."}); m_RegularDialogs.Insert({"I saw someone near the old factory", "Thanks for the info, I'll check it out."}); // Угрозы m_ThreatDialogs = new array<ref array<string>>; m_ThreatDialogs.Insert({"We will find you...", "Try, but I won't give up."}); m_ThreatDialogs.Insert({"You won't escape", "I'm ready for this."}); m_ThreatDialogs.Insert({"Your loot will be ours", "You wish."}); } void Start() { if (!m_IsActive) { m_IsActive = true; m_Timer.Run(60, this, "CheckTime", NULL, true); // Запуск таймера на проверку каждые 60 секунд Print("[FakeChatNotifier] Started main timer"); // Лог для проверки запуска } } void Stop() { m_IsActive = false; m_Timer.Stop(); m_MessageTimer.Stop(); Print("[FakeChatNotifier] Stopped timers"); // Лог для проверки остановки } // Функция для получения текущего времени void GetCurrentHour(out int hour) { int year, month, day, minute; GetGame().GetWorld().GetDate(year, month, day, hour, minute); // Получаем текущий час из даты Print("[FakeChatNotifier] Current hour: " + hour); // Лог для проверки текущего времени } void CheckTime() { int hour; GetCurrentHour(hour); // Используем нашу функцию для получения текущего часа if (hour >= 22 || hour < 6) { if (!m_IsActive) { Print("[FakeChatNotifier] Night time detected, starting dialog cycle"); // Лог для ночного времени StartDialogCycle(hour); } } else { Print("[FakeChatNotifier] Day time, stopping dialogs"); // Лог для дневного времени Stop(); } } void StartDialogCycle(int hour) { if (!m_IsActive) return; array<string> dialog; if (hour >= 22 && hour < 23) { dialog = m_WelcomeDialogs.GetRandomElement(); // Приветственные диалоги Print("[FakeChatNotifier] Sending welcome dialog"); // Лог для приветственных диалогов } else if (hour >= 23 && hour < 3) { dialog = m_RegularDialogs.GetRandomElement(); // Обычные диалоги Print("[FakeChatNotifier] Sending regular dialog"); // Лог для обычных диалогов } else if (hour >= 3 && hour < 6) { dialog = m_ThreatDialogs.GetRandomElement(); // Угрозы Print("[FakeChatNotifier] Sending threat dialog"); // Лог для угроз } SendDialog(dialog); ScheduleNextDialog(); // Планирование следующего диалога } void ScheduleNextDialog() { int interval = Math.RandomIntInclusive(900, 1500); // Интервал (15-25 минут в секундах) m_MessageTimer.Run(interval, this, "StartDialogCycle", NULL, false); Print("[FakeChatNotifier] Scheduled next dialog in " + interval + " seconds"); // Лог для планирования следующего диалога } void SendDialog(array<string> dialog) { for (int i = 0; i < dialog.Count(); i++) { float delay = i * Math.RandomIntInclusive(5, 9); // Задержка между сообщениями в диалоге (5-9 секунд) m_MessageTimer.Run(delay, this, "SendMessageToPlayers", new Param1<string>(dialog[i]), false); Print("[FakeChatNotifier] Scheduled message with delay " + delay + " seconds: " + dialog[i]); // Лог для отправки сообщения } } void SendMessageToPlayers(Param1<string> param) { string message = param.param1; array<Man> players = new array<Man>; GetGame().GetPlayers(players); if (players.Count() > 0) { foreach (Man player : players) { Param1<string> globalMessage = new Param1<string>(message); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, globalMessage, true, player.GetIdentity()); } Print("[FakeChatNotifier] Sent message to all players: " + message); // Лог для отправленного сообщения } else { Print("[FakeChatNotifier] No players online to send message: " + message); // Лог для случая, если нет игроков } } }  
    • By Troy1
      Всем привет. Помогите пожалуйста со скриптом.
      Суть. Я пытаюсь сделать синхранизацию сервера с клиентом передавая c конфига время разделки животного.
      В родных скриптах есть class UATimeSpent с константами и там есть константа SKIN.
      Мне нужно её перезаписать на своё значение и мне выдаёт ошибку: Trying to modify write protected variable 'SKIN' в переводе на Русский Попытка изменить защищенную от записи переменную «SKIN».
      Функция скрипта: Когда игрок запускает клиент, идёт запрос на серверную часть и получает в ответ время разделки.
      Задача: Нужно перезаписать константу SKIN на новое значение и всё.
      Сам скрипт.
      class timeToComplete extends UATimeSpent { protected ref UATimeSpent m_UATimeSpent; void timeToComplete() { GetDayZGame().Event_OnRPC.Insert(OnRPC); CheckUATimeSpent(); } void ~timeToComplete() { GetDayZGame().Event_OnRPC.Remove(OnRPC); } void CheckUATimeSpent() { GetGame().RPCSingleParam(NULL, SOC_TIME_RPCs.SOC_GT, NULL, true); } void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx) { if (rpc_type == SOC_TIME_RPCs.SOC_RT) { Param1<float> soc_srt; if (ctx.Read(soc_srt)) { if (soc_srt.param1!= 0) { m_UATimeSpent.SKIN = soc_srt.param1; Print("Пришёл ответ от сервера в m_UATimeSpent.SKIN - " + m_UATimeSpent.SKIN) } } } } };  
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. На сервере есть трейдер зоны и базы игроков. 
      Если в течение определённого времени, на пример 1 - 2 часа с машиной не кто не взаимодействует и машина не находится в зоне трейдера или на теретории базы, то машина отлетает в гараж или на штраф стоянку.
      На сервере используется TraderPlus.
       
      Есть такие решения у кого?
      За ранние благодарю.
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.