Skip to content

Commit

Permalink
feature: Cfx.re 💝 developers - lots of build friendliness and READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
blattersturm committed Jun 1, 2020
1 parent 950c129 commit 86df2ee
Show file tree
Hide file tree
Showing 32 changed files with 526 additions and 81 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# <img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.6/assets/png/1f40c.png" width="32" height="32"> FiveM
# <img src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.6/assets/png/1f40c.png" width="32" height="32"> Cfx.re (FiveM/RedM)

[FiveM](https://fivem.net/) is a dual-purpose (SP/MP) modification framework for the PC version of Grand Theft Auto V as released by Rockstar Games.
This repository contains the code for the Cfx.re projects, among which are the following:

On the multiplayer aspect, it differs from other similar modifications by utilizing the embedded game networking frameworks, building a modification framework around them, and expanding the game's functionality on an end-to-end level, directly binding to the RAGE Technology Group's base frameworks and Rockstar North's GTA codebase.
* [FiveM](https://fivem.net/), a dual-purpose (SP/MP) modification framework for the PC version of Grand Theft Auto V as released by Rockstar Games.
* [RedM](https://redm.gg/), a modification framework for the PC version of Red Dead Redemption 2 as released by Rockstar Games.
* FXServer, the server component for multiplayer services on the Cfx.re projects.

On the multiplayer aspect, the GTA/RAGE modifications differ from other similar modifications by utilizing the embedded game networking frameworks, building a modification framework around them, and expanding the game's functionality on an end-to-end level, directly binding to the RAGE Technology Group's base frameworks and Rockstar North's GTA codebase.

## Getting started
To play FiveM, simply download the launcher binaries from the [website](https://fivem.net).

To develop FiveM, please follow the documentation in `docs/` in the repository.
To develop FiveM, please follow the documentation in [docs/](https://github.com/citizenfx/fivem/tree/master/docs) in the repository.

## License
FiveM is licensed under a dual license, details of which are in the `code/LICENSE` file in the repository.
FiveM is licensed under a dual license, details of which are in the [code/LICENSE](https://github.com/citizenfx/fivem/blob/master/code/LICENSE) file in the repository.
2 changes: 2 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
[Bb]in/
/build
/package-lock.json
9 changes: 6 additions & 3 deletions code/LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CitizenFX/FiveM are (c) 2017 the CitizenFX Collective.
CitizenFX/FiveM are (c) 2017-2020 the CitizenFX Collective.

Use of this source code is subject to the terms provided on the CitizenFX
Collective web site, currently versioned (1) at the following web URL:
Collective web site, currently versioned (4) at the following web URL:

https://runtime.fivem.net/fivem-service-agreement-1.pdf
https://fivem.net/terms

The following files, as long as they are marked as licensed under the
CitizenFX Project license, are optionally available under the LGPLv2, as in
Expand All @@ -28,6 +28,9 @@ PSA.
This project is based on the original CitizenFX framework by NTAuthority,
the original permission notice of which is reproduced below.

Please note that this permission notice does not apply to any changes made
since 2016.

Copyright (c) 2014 Bas Timmer/NTAuthority et al.

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
12 changes: 12 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CitizenFX Native Project

This directory contains the primary native CitizenFX project.

* [**client/**](./client): A historical misnomer, contains common code shared across projects, as well as the client launcher logic.
* [**components/**](./components): Contains most of the code as part of a 'component' system.
* [**deplibs/**](./deplibs): Legacy manually-vendored-in includes/lib files.
* [**server/**](./server): Contains the server launcher logic.
* [**shared/**](./shared): A confusing cognate to `client/shared/`, contains lower-level shared code.
* [**tests/**](./tests): Unused since 2014, a prototype of unit/integration tests for the framework.
* [**tools/**](./tools): Tooling used for building the native CitizenFX project.
* [**vendor/**](./vendor): Premake vendor definition files and non-submoduled dependent includes/source files.
14 changes: 14 additions & 0 deletions code/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# `client/`

Shared CitizenFX framework code.

* [**citicore/**](./citicore): CitizenFX Runtime, handles loading components and implements the CitizenFX Object Model.
* [**citigame/**](./citigame): Auxiliary component for client-side lifecycle after bootstrapping.
* [**clrcore/**](./clrcore): CitizenFX.Core C# library.
* [**clrref/**](./clrref): Reference generation for the CitizenFX.Core library.
* [**common/**](./common): Shared source files included in all projects.
* [**console/**](./console): `FiveM.com` console launcher.
* [**diag/**](./diag): `CfxDiag` utility.
* [**ipfsdl/**](./ipfsdl): IPFS download API wrapper.
* [**launcher/**](./launcher): Main client entry point/bootstrapper.
* [**shared/**](./shared): Shared includes and source files.
2 changes: 1 addition & 1 deletion code/client/launcher/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local function launcherpersonality(name)

defines("LAUNCHER_PERSONALITY_" .. name:upper())

flags "NoManifest"
flags { "NoManifest", "NoImportLib" }

symbols "Full"

Expand Down
4 changes: 4 additions & 0 deletions code/client/shared/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
targetname(libc and "shared_libc" or "shared")
language "C++"
kind "StaticLib"

if os.istarget('windows') then
dependson { 'CfxPrebuild' }
end

if libc then
staticruntime "On"
Expand Down
105 changes: 105 additions & 0 deletions code/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# `components/`

CitizenFX implementation components.

## List

### Common
* [**citizen-game-ipc/**](./citizen-game-ipc): IPC wrapper for CfxGL.
* [**citizen-game-main/**](./citizen-game-main): Main entry point for CfxGL.
* [**citizen-legacy-net-resources/**](./citizen-legacy-net-resources): Binds `net` to the `citizen:resources:client` resource system.
* [**citizen-resources-client/**](./citizen-resources-client): Resources system, client-specific functionality.
* [**citizen-resources-core/**](./citizen-resources-core): Resources system, core functionality.
* [**citizen-resources-gta/**](./citizen-resources-gta): Resource system, GTA-specific functionality.
* [**citizen-resources-metadata-lua/**](./citizen-resources-metadata-lua): Loader for `fxmanifest.lua` and `__resource.lua` files.
* [**citizen-scripting-core/**](./citizen-scripting-core): Core scripting runtime (ScRT) functionality.
* [**citizen-scripting-lua/**](./citizen-scripting-lua): Lua ScRT.
* [**citizen-scripting-mono/**](./citizen-scripting-mono): Mono ScRT loader. Most of the implementation is in `CitizenFX.Core.dll`.
* [**citizen-scripting-v8/**](./citizen-scripting-v8): V8 ScRT.
* [**comptest/**](./comptest): Testing component.
* [**conhost-posh/**](./conhost-posh): Deprecated PowerShell console host.
* [**conhost-v2/**](./conhost-v2): dear ImGui-based console host.
* [**debug-net/**](./debug-net): Debug visualizations for `net`.
* [**debug-script/**](./debug-script): Script debugging functionality.
* [**devcon/**](./devcon): VConsole2 server.
* [**discord/**](./discord): Discord integration.
* [**font-renderer/**](./font-renderer): Watermark renderer and DirectWrite font client.
* [**glue/**](./glue): High-level 'glue' to link other components together.
* [**http-client/**](./http-client): Async cURL wrapper library.
* [**legacy-game-re3/**](./legacy-game-re3): ...
* [**lovely-script/**](./lovely-script): Background script.
* [**n19ui/**](./n19ui): Jupiter-based UI. Not currently used.
* [**net/**](./net): Network client for game servers.
* [**net-base/**](./net-base): Base networking library for client/server projects.
* [**net-http-server/**](./net-http-server): HTTP server for `net:tcp-server`.
* [**net-tcp-server/**](./net-tcp-server): Generic transport-agnostic TCP server framework.
* [**nui-core/**](./nui-core): NUI core library.
* [**nui-gsclient/**](./nui-gsclient): NUI game server client, for the server list.
* [**nui-profiles/**](./nui-profiles): NUI user profile functionality.
* [**nui-resources/**](./nui-resources): NUI bindings to the resource system.
* [**profiles/**](./profiles): User profile functionality.
* [**rage-formats-x/**](./rage-formats-x): RAGE file format library.
* [**scrbind-base/**](./scrbind-base): High-level C++ class script binding support.
* [**scrbind-formats/**](./scrbind-formats): Uses scrBind to bind to rage:formats:x.
* [**scripthookv/**](./scripthookv): ScriptHookV compatibility library.
* [**scripting-gta/**](./scripting-gta): Scripting implementation wrapper to `rage:scripting`.
* [**steam/**](./steam): Steam integration.
* [**sticky/**](./sticky): Surrogate for private `adhesive` component.
* [**template/**](./template): Template for use with new components.
* [**tool-formats/**](./tool-formats): Tool component for `rage:formats:x`.
* [**tool-vehrec/**](./tool-vehrec): Tool component to generate .#vr files.
* [**vfs-core/**](./vfs-core): Virtual File System, core library.
* [**vfs-impl-rage/**](./vfs-impl-rage): Virtual File System, RAGE implementation.
* [**voip-mumble/**](./voip-mumble): Mumble client.

### Server
* [**citizen-server-impl/**](./citizen-server-impl): Server core implementation. This is a single component due to ABI limitations
on Linux.
* [**citizen-server-instance/**](./citizen-server-instance): Server `instance` wrapper. Factored out for dependencies.
* [**citizen-server-main/**](./citizen-server-main): Server entry point.
* [**citizen-server-monitor/**](./citizen-server-monitor): Server entry point for txAdmin monitor mode.
* [**citizen-server-net/**](./citizen-server-net): Server `net` wrapper. Factored out for dependencies.
* [**citizen-ssh-server/**](./citizen-ssh-server): ...
* [**conhost-server/**](./conhost-server): Dummy `conhost` implementation for the server.
* [**scripting-server/**](./scripting-server): Standalone scripting implementation for use in the server.
* [**vfs-impl-server/**](./vfs-impl-server): Standalone VFS implementation for use in the server.
* [**voip-server-mumble/**](./voip-server-mumble): Mumble server.

### GTA5
* [**asi-five/**](./asi-five): ASI loader.
* [**citizen-level-loader-five/**](./citizen-level-loader-five): SP level loading support.
* [**citizen-mod-loader-five/**](./citizen-mod-loader-five): .oiv mod loading support.
* [**citizen-playernames-five/**](./citizen-playernames-five): Player name overrides.
* [**devtools-five/**](./devtools-five): Developer tools.
* [**extra-natives-five/**](./extra-natives-five): High-level game-specific natives.
* [**gta-core-five/**](./gta-core-five): Low-level GTA project wrappers.
* [**gta-game-five/**](./gta-game-five): High-level GTA project wrappers.
* [**gta-mission-cleanup-five/**](./gta-mission-cleanup-five): Bindings to GTA mission cleanup.
* [**gta-net-five/**](./gta-net-five): Network functionality for GTA.
* [**gta-streaming-five/**](./gta-streaming-five): Streaming functionality for GTA.
* [**handling-loader-five/**](./handling-loader-five): Handling loader.
* [**loading-screens-five/**](./loading-screens-five): Loading screen override functionality.
* [**rage-allocator-five/**](./rage-allocator-five): Wraps RAGE allocators.
* [**rage-device-five/**](./rage-device-five): Wraps RAGE VFS.
* [**rage-graphics-five/**](./rage-graphics-five): Wraps RAGE grcore.
* [**rage-input-five/**](./rage-input-five): Wraps RAGE grcore input.
* [**rage-nutsnbolts-five/**](./rage-nutsnbolts-five): Generic 'nuts and bolts' for RAGE.
* [**rage-scripting-five/**](./rage-scripting-five): Wraps RAGE scripting.
* [**ros-patches-five/**](./ros-patches-five): ROS compatibility.

### RDR2
* [**citizen-level-loader-rdr3/**](./citizen-level-loader-rdr3): SP level loading support.
* [**citizen-playernames-rdr3/**](./citizen-playernames-rdr3): Player name overrides.
* [**extra-natives-rdr3/**](./extra-natives-rdr3): High-level game-specific natives.
* [**gta-core-rdr3/**](./gta-core-rdr3): Low-level GTA project wrappers. (RDR3 is built atop GTA/RAGE)
* [**gta-game-rdr3/**](./gta-game-rdr3): High-level GTA project wrappers.
* [**gta-mission-cleanup-rdr3/**](./gta-mission-cleanup-rdr3): ...
* [**gta-net-rdr3/**](./gta-net-rdr3): ...
* [**gta-streaming-rdr3/**](./gta-streaming-rdr3): ...
* [**rage-allocator-rdr3/**](./rage-allocator-rdr3): ...
* [**rage-device-rdr3/**](./rage-device-rdr3): ...
* [**rage-graphics-rdr3/**](./rage-graphics-rdr3): ...
* [**rage-input-rdr3/**](./rage-input-rdr3): ...
* [**rage-nutsnbolts-rdr3/**](./rage-nutsnbolts-rdr3): ...
* [**rage-scripting-rdr3/**](./rage-scripting-rdr3): ...
* [**ros-patches-rdr3/**](./ros-patches-rdr3): Symlinked ROS compatibility.
2 changes: 0 additions & 2 deletions code/components/ros-patches-five/component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ links { "libcef_dll", "delayimp", "libGLESv2" }

links { "libcef" }

flags { 'Maps' }

filter 'architecture:x64'
links { "steam_api64" }

Expand Down
2 changes: 0 additions & 2 deletions code/components/ros-patches-rdr3/component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ links { "libcef_dll", "delayimp", "libGLESv2" }

links { "libcef" }

flags { 'Maps' }

filter 'architecture:x64'
links { "steam_api64" }

Expand Down
18 changes: 17 additions & 1 deletion code/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ workspace "CitizenMP"
buildoptions '-mpclmul -maes -mssse3 -mavx2 -mrtm'
buildoptions '-fsanitize=address -fsanitize-recover=address'
end

filter { 'action:vs*' }
implibdir "$(IntDir)/lib/"
symbolspath "$(TargetDir)dbg/$(TargetName).pdb"

filter {}

-- debug output
configuration "Debug*"
Expand Down Expand Up @@ -166,10 +172,14 @@ workspace "CitizenMP"
else
include 'server/launcher'
end

if os.istarget('windows') then
include 'premake5_layout.lua'
end

-- TARGET: corert
include 'client/citicore'

if _OPTIONS['game'] ~= 'server' then
include 'client/ipfsdl'

Expand Down Expand Up @@ -205,6 +215,12 @@ premake.override(premake.vstudio.dotnetbase, 'debugProps', function(base, cfg)
_p(2,'<Optimize>%s</Optimize>', iif(premake.config.isOptimizedBuild(cfg), "true", "false"))
end)

premake.override(premake.vstudio.vc2010, 'ignoreImportLibrary', function(base, cfg)
if cfg.flags.NoImportLib then
premake.vstudio.vc2010.element("IgnoreImportLibrary", nil, "true")
end
end)

premake.override(premake.vstudio.vc2010, 'importLanguageTargets', function(base, prj)
base(prj)

Expand Down
35 changes: 35 additions & 0 deletions code/premake5_layout.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- setup pre-build and post-build layouts
project 'CfxPrebuild'
kind 'Utility'

prebuildcommands {
('"%s"'):format(
path.getabsolute('tools/build/run_prebuild.cmd')
)
}

project 'CfxPostbuild'
kind 'Utility'

if _OPTIONS['game'] ~= 'launcher' then
dependson { 'glue' }
else
dependson { 'citizen-game-main' }
end

files {
'tools/build/run_postbuild.ps1'
}

filter 'files:**.ps1'
buildmessage 'Preparing application to run from layout...'

buildcommands {
-- directly use $(TargetDir) and remove trailing \ so pwsh doesn't get upset
([["%s" "$(TargetDir.TrimEnd('\'))" %s]]):format(
path.getabsolute('tools/build/run_postbuild.cmd'),
_OPTIONS['game']
)
}

buildoutputs { 'tools/build/dummy_dont_generate.txt' }
8 changes: 8 additions & 0 deletions code/tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# `tools/`
CitizenFX build infrastructure.

* [**build/**](./build): Premake5 build tool helpers.
* [**ci/**](./ci): CI scripts. Confused about the build process? Look here.
* [**dbg/**](./dbg): Wrappers for adding debug info to game clients.
* [**ext/**](./ext): External data.
* [**idl/**](./idl): `xpidl` fork.
4 changes: 4 additions & 0 deletions code/tools/build/run_postbuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
set ROOT=%~dp0

powershell -ExecutionPolicy Bypass %ROOT%\run_postbuild.ps1 %*
Loading

0 comments on commit 86df2ee

Please sign in to comment.