Skip to content

Commit

Permalink
Renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Dec 6, 2020
1 parent ba88b21 commit 53248aa
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 42 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FiveM TimeSync
# Vina TimeSync

### FEATURES
- Perfect Client & Server time synchronization
Expand Down Expand Up @@ -29,9 +29,9 @@

### INSTRUCTIONS:

**1)** Place "fivemtimesync" directory inside your server Resources directory.
**1)** Place "vinatimesync" directory inside your server Resources directory.

**2)** Add "ensure fivemtimesync" to your server config.
**2)** Add "ensure vinatimesync" to your server config.

**3)** Start your FiveM server.

Expand All @@ -58,11 +58,11 @@ You can get the server time in your own resource using this export function:

```csharp
// Get the server time
long ticks = Exports["fivemtimesync"].GetCurrentDateTicks();
long ticks = Exports["vinatimesync"].GetCurrentDateTicks();
DateTime currentDate = new DateTime(ticks);

// Set the server time
Exports["fivemtimesync"].SetCurrentDateTicks(DateTime.Now.Ticks);
Exports["vinatimesync"].SetCurrentDateTicks(DateTime.Now.Ticks);
```

---
Expand All @@ -71,22 +71,22 @@ Exports["fivemtimesync"].SetCurrentDateTicks(DateTime.Now.Ticks);

You can change the settings using convar in your FiveM server config file:

- *set timesync_network_verbose 0*
- *set vina_timesync_network_verbose 0*
**Set to 1 to print event in the console**

- *set timesync_console_print_time 0*
- *set vina_timesync_console_print_time 0*
**Set to 1 to print the time periodically in the console**

- *set timesync_console_print_format "MMMM d yyyy, HH:mm:ss tt"*
- *set vina_timesync_console_print_format "MMMM d yyyy, HH:mm:ss tt"*
**Set the format to print the date/time**

- *set timesync_console_print_delay 60000*
- *set vina_timesync_console_print_delay 60000*
**Set the millisecond delay between the print of time in console**

- *set timesync_update_delay 60000*
- *set vina_timesync_update_delay 60000*
**Set the delay before server force resync with all players**

- *set timesync_timerate 1*
- *set vina_timesync_timerate 1*
**Set the timerate, 1 = 1 real second & 10 = 10 time faster than real time**


4 changes: 2 additions & 2 deletions FiveM_TimeSync.sln → Vina-TimeSync.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveM_TimeSync", "FiveM_TimeSync\FiveM_TimeSync.csproj", "{E43819C4-7F54-408A-B097-794CBD245BAD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vina_TimeSyncClient", "Vina_TimeSyncClient\Vina_TimeSyncClient.csproj", "{E43819C4-7F54-408A-B097-794CBD245BAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveM_TimeSyncServer", "FiveM_TimeSyncServer\FiveM_TimeSyncServer.csproj", "{A4E0CA53-9DCD-453F-83CD-3F7AB0F25807}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vina_TimeSyncServer", "Vina_TimeSyncServer\Vina_TimeSyncServer.csproj", "{A4E0CA53-9DCD-453F-83CD-3F7AB0F25807}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions FiveM_TimeSync/Client.cs → Vina_TimeSyncClient/Client.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using VinaFrameworkClient.Core;
using FiveM_TimeSync.Modules;
using Vina_TimeSyncClient.Modules;

namespace FiveM_TimeSync
namespace Vina_TimeSyncClient
{
public class Client : BaseClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using VinaFrameworkClient.Core;

namespace FiveM_TimeSync.Modules
namespace Vina_TimeSyncClient.Modules
{
public class TimeSyncModule : Module
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FiveM_TimeSync")]
[assembly: AssemblyTitle("Vina_TimeSync")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FiveM_TimeSync")]
[assembly: AssemblyProduct("Vina_TimeSyncClient")]
[assembly: AssemblyCopyright("Copyright © VinaStar 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{E43819C4-7F54-408A-B097-794CBD245BAD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FiveM_TimeSync</RootNamespace>
<AssemblyName>FiveM_TimeSync.net</AssemblyName>
<RootNamespace>Vina_TimeSyncClient</RootNamespace>
<AssemblyName>Vina_TimeSyncClient.net</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand All @@ -17,7 +17,7 @@
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\_resources\fivemtimesync\</OutputPath>
<OutputPath>..\..\_resources\vinatimesync\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using VinaFrameworkServer.Core;

namespace FiveM_TimeSyncServer.Modules
namespace Vina_TimeSyncServer.Modules
{
public class TimeSyncModule : Module
{
Expand Down Expand Up @@ -91,32 +91,33 @@ private double timeElapsed
protected override void OnModuleInitialized()
{
// Print more informations
verbose = API.GetConvarInt("timesync_network_verbose", 0) == 1;
verbose = API.GetConvarInt("vina_timesync_network_verbose", 0) == 1;

// Peridically print current time
printEnabled = API.GetConvarInt("timesync_console_print_time", 1) == 1;
printEnabled = API.GetConvarInt("vina_timesync_console_print_time", 1) == 1;

// Console Print Time Format
printFormat = API.GetConvar("timesync_console_print_format", "MMMM d yyyy, HH:mm:ss tt");
printFormat = API.GetConvar("vina_timesync_console_print_format", "MMMM d yyyy, HH:mm:ss tt");

// Console Print Time Delay
printDelay = API.GetConvarInt("timesync_console_print_delay", 1000 * 60 * 5);
printDelay = API.GetConvarInt("vina_timesync_console_print_delay", 1000 * 60 * 5);

// Sync players every 10 secs
clientUpdateDelay = API.GetConvarInt("timesync_update_delay", 60000);
clientUpdateDelay = API.GetConvarInt("vina_timesync_update_delay", 60000);

// 10 x realtime
timeRate = API.GetConvarInt("timesync_timerate", 1);
timeRate = API.GetConvarInt("vina_timesync_timerate", 1);

Debug.WriteLine($@"
=====================================
FIVEM TIME SYNC SETTINGS:
=====================================
timesync_console_print = {printEnabled}
timesync_console_print_format = {printFormat}
timesync_console_print_delay (ms) = {printDelay}
timesync_update_delay (ms) = {clientUpdateDelay}
timesync_timerate (1sec * timerate) = {timeRate}
vina_timesync_network_verbose = {verbose}
vina_timesync_console_print = {printEnabled}
vina_timesync_console_print_format = {printFormat}
vina_timesync_console_print_delay (ms) = {printDelay}
vina_timesync_update_delay (ms) = {clientUpdateDelay}
vina_timesync_timerate (1sec * timerate) = {timeRate}
Current Date = {CurrentDate.ToString(printFormat)}
=====================================");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FiveM_TimeSyncServer")]
[assembly: AssemblyTitle("Vina_TimeSync")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FiveM_TimeSyncServer")]
[assembly: AssemblyProduct("Vina_TimeSyncServer")]
[assembly: AssemblyCopyright("Copyright © VinaStar 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using VinaFrameworkServer.Core;
using FiveM_TimeSyncServer.Modules;
using Vina_TimeSyncServer.Modules;

namespace FiveM_TimeSyncServer
namespace Vina_TimeSyncServer
{
public class Server : BaseServer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{A4E0CA53-9DCD-453F-83CD-3F7AB0F25807}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FiveM_TimeSyncServer</RootNamespace>
<AssemblyName>FiveM_TimeSyncServer.net</AssemblyName>
<RootNamespace>Vina_TimeSyncServer</RootNamespace>
<AssemblyName>Vina_TimeSyncServer.net</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand All @@ -17,7 +17,7 @@
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\_resources\fivemtimesync\</OutputPath>
<OutputPath>..\..\_resources\vinatimesync\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
4 changes: 2 additions & 2 deletions __resource.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
game 'gta5'
client_script 'FiveM_TimeSync.net.dll'
server_script 'FiveM_TimeSyncServer.net.dll'
client_script 'Vina_TimeSyncClient.net.dll'
server_script 'Vina_TimeSyncServer.net.dll'

files {
"Newtonsoft.Json.dll",
Expand Down

0 comments on commit 53248aa

Please sign in to comment.