Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #8 from blockba5her/v2.1
Browse files Browse the repository at this point in the history
v2.1 Update
  • Loading branch information
DevBlocky committed Nov 30, 2017
2 parents a47a6cc + 6ea0118 commit c755a74
Show file tree
Hide file tree
Showing 88 changed files with 4,702 additions and 1,935 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ luac.out
*.yml
*.userprefs

# Annoying files
src/.vs/DispatchSystem/v15/sqlite3/storage.ide

# Build folders
src/Client/obj/*
src/Server/obj/*
src/Common/obj/*
src/DumpUnloader/obj/*
src/bin/*
.vs/*
src/.vs/*
src/.vs/*
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Dispatch Systems
# DispatchSystem

Discord:

[![Discord](https://discordapp.com/api/guilds/358081805850640384/widget.png)](https://discord.gg/ZcTayce)

> Dispatch Systems is a CAD/MDT system for ingame FiveM use, this is not a permenant solution, but it works for free. This is an open source free project courtesy of BlockBa5her (the coder). It is free for anyone to use, as long as they do not re-distribute the software under their own name. It does not store data in CouchDB and MySQL so EssentialMode is not needed. It stores all of the player's information in the RAM of the computer, so the next restart of the server clears all of the names that it has stored. It now also comes with database settings for saving Civilian Profiles and Vehicles to 2 files.
## Summary

Dispatch Systems is a CAD/MDT system for ingame FiveM use, this is not a permenant solution, but it works for free. This is an open source free project courtesy of BlockBa5her (the coder). It is free for anyone to use, as long as they do not re-distribute the software under their own name. It does not store data in CouchDB and MySQL so EssentialMode is not needed. It stores all of the player's information in the RAM of the computer, but saves all of the data once the server is restarted. It now also comes with storage settings for saving Civilian Profiles and Vehicles in a file.

## Uses

Expand All @@ -14,7 +18,7 @@
* C# with open source code
* Availability to everyone, not just people who pay
* Open for suggestions and always looking for more to add-on too
* Will always stay non-SQL/CouchDB based for easy use (with included database settings)
* Will always stay non-SQL/CouchDB based for easy use (with included storage settings)

## Pictures

Expand All @@ -26,18 +30,17 @@
<a href="https://i.gyazo.com/78258256b01b67ce32d8bbe602b20866.png"><img src="https://i.gyazo.com/78258256b01b67ce32d8bbe602b20866.png" width="500" alt="Tickets and Notes"></img></a>
<a href="https://i.gyazo.com/e4b5ce6ca98c82fcc85739443037922e.png"><img src="https://i.gyazo.com/e4b5ce6ca98c82fcc85739443037922e.png" width="500" alt="Dispatch Main"></img></a>
<a href="https://i.gyazo.com/b9578ed701735082606ca0fe140317f2.png"><img src="https://i.gyazo.com/b9578ed701735082606ca0fe140317f2.png" width="500" alt="Dispatch BOLO"></img></a>
<a href="https://i.imgur.com/a0WEauz.png"><img src="https://i.imgur.com/a0WEauz.png" width="500" alt="Civ menu display"></img></a>
<a href="https://i.imgur.com/h6waE4d.png"><img src="https://i.imgur.com/h6waE4d.png" width="500" alt="Leo menu display"></img></a>

## Commands

### ---Civilian Commands---

* `/civ` - Opens the civilian NUI menu In-game

### ---Police Commands---

* `/leo` - Opens the officer NUI menu In-game (Can be used to for other emergency personel)
* `/dsciv` - Opens the civilian NUI menu In-game
* `/dsleo` - Opens the officer NUI menu In-game (Can be used to for other emergency personel)
* `/dsdmp` - Dumps all of the info of DispatchSystem into a file labeled `dispatchsystem.dmp` in the root directory, please only use if DispatchSystem is not working properly.

## In the works

1. Arrest ability - `/arrest {first} {last}` arrests a ped and show it in the system
2. Warrant Types - `/warrant {type}` have different types of bench warrants and also a toggle for outstanding
3. Bug fixes - There seems to be a lot of bugs that popped up in v2.0 of DispatchSystem, I'm hard at working trying to fix all of them
158 changes: 0 additions & 158 deletions docs/api.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ These errors have not occured with anyone, but I just want to make sure that the

* Both project file say that there are missing dependencies/references
1. Just add both of the references back to the right project, the references can be found in the `ref` folder in the clone
2. Sometimes the NuGet packages are weird and don't follow the clone, so just download the package CloNET & MaterialSkin again.
> TODO: More to add once more errors popup
## Build location
Expand Down
13 changes: 13 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Installation guide

## Deciding options
Decide what options you would want to have on your server. The most important things to decide on are the database feature, and the server feature. They are both togglable in the server's `settings.ini` file. The server feature is what allows the client to connect to the server, and the database is where it stores all of your data on restart.

## Basic installation
To install all of the stuff on the server, you can make a drag and drop the resource folder `dispatchsystem` inside of the download folder inside of your `resources/` folder. From there, you can go inside of the resource folder and change all of the `ini` settings. Now all that's left to do is put the resource inside your `server.cfg`

## Client installation
To install the client is easy. All you have to do is make sure that the `dispatchsystem` resource has the `server` setting enabled. After that, just make sure that you have port `33333` open to use (If on web hoster or VPS it's already open). Now, you just have to configure your client's settings so that the IP matches with the IP that your FiveM server is run off of.

## Common issues
A lot of issues have been appearing with DispatchSystem lately. That is why I integrated the `/dsdmp` command to allow you to dump your server information to a file, and delete the rest of the info on the server. The `dispatchsystem.dmp` file that is exported in the dump process is located at the root of your FiveM directory.
8 changes: 4 additions & 4 deletions docs/server.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Setting up the Server

## Toggling the server

Basically, just open up the `settings.ini` that comes with the server, and change the option under the `[server]` tag that says `enable` to `0`

## Setting up the server

Don't change any settings in the INI, unless you are having problems. All of the settings in there should work with your average joe

## Setting up the client

In the `settings.ini`, change the the IP of the server to the IP of your server, and keep the PORT the same unless you changed it on the server's side

## Toggling the database
In the `settings.ini` of the server, change the `database` option to 0.

## Ports to have open

If you are running this off a basic home internet, then you will need to open the PORT `33333`, and that is 5 threes just to confirm. If you are running this off a VPS or hosting website then you should be good from opening ports.
If you are running this off a basic home internet, then you will need to open the PORT `33333`, and that is 5 threes just to confirm. If you are running this off a VPS or hosting website then you shouldn't have to open any ports because they are already open for you.
6 changes: 3 additions & 3 deletions src/Client/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>
</configuration>
10 changes: 7 additions & 3 deletions src/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -30,15 +32,15 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="CloNET, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CloneCommando.CloNET.0.4.2\lib\net461\CloNET.dll</HintPath>
<HintPath>..\packages\CloneCommando.CloNET.0.5.4\lib\net461\CloNET.dll</HintPath>
</Reference>
<Reference Include="MaterialSkin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialSkin.Updated.0.2.2\lib\MaterialSkin.dll</HintPath>
Expand Down Expand Up @@ -185,7 +187,9 @@
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico">
Expand Down
23 changes: 13 additions & 10 deletions src/Client/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,43 @@ namespace DispatchSystem.cl
{
public class Config
{
public static IPAddress IP { get; private set; }
public static IPAddress Ip { get; private set; }
public static int Port { get; private set; }

public static void Create(string FilePath)
public static void Create(string filePath)
{
string[] lines = File.ReadAllLines(FilePath);
string[] lines = File.ReadAllLines(filePath);

foreach (string[] line in lines.Where(x => !x.StartsWith(";")).Select(x => x.Split('=').Select(y => y.Trim()).ToArray()))
switch (line[0])
{
case "IP":
if (line[1] == "changeme")
{
MessageBox.Show("Looks like you forgot to change the config.\nPlease edit your config and then come back ༼ つ ◕_◕ ༽つ", "DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(
"Looks like you forgot to change the config.\nPlease edit your config and then come back ༼ つ ◕_◕ ༽つ",
"DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
}

if (!IPAddress.TryParse(line[1], out IPAddress address))
{
MessageBox.Show("The ip address is invalid.", "DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("The ip address is invalid.", "DispatchSystem", MessageBoxButtons.OK,
MessageBoxIcon.Error);
Environment.Exit(0);
}

IP = address;
Ip = address;
break;

case "Port":
if (!int.TryParse(line[1], out int _Port) || _Port < 1024 || _Port > 65536)
if (!int.TryParse(line[1], out int port) || port < 1024 || port > 65536)
{
MessageBox.Show("The port is invalid.\nMake sure it is a positive integer within 1025-65535.", "DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("The port is invalid.\nMake sure it is a positive integer within 1025-65535.",
"DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(0);
}

Port = _Port;
Port = port;
break;
}
}
Expand Down

0 comments on commit c755a74

Please sign in to comment.