Coding info: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (add compiling links) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
This page has information which would be useful for anyone who is doing coding for MTA SA. [[Coding guidelines]] also has a lot of useful info. | This page has information which would be useful for anyone who is doing coding for MTA SA. [[Coding guidelines]] also has a lot of useful info. | ||
Also useful: | |||
* [[Compiling_MTASA|Compiling MTASA on Windows]] | |||
* [[Building_MTASA_Server_on_GNU_Linux|Compiling MTASA on GNU/Linux]] | |||
== Directory Structure == | |||
Our project is organised into a number of different directories which serve different purposes: | |||
* '''Client''' | |||
* '''Server''' | |||
* '''Shared''': contains code shared between both the client and the server | |||
* '''utils''': utilities used to automate certain tasks | |||
* '''vendor''': unmodified third-party code and libraries (optionally linked to the appropriate third-party Git repository through Git submodules). | |||
== Projects explained == | == Projects explained == | ||
Line 19: | Line 34: | ||
* Dependencies: Has a load of 3rd party code, modules like sqlite, curl, lua, ehs, etc. | * Dependencies: Has a load of 3rd party code, modules like sqlite, curl, lua, ehs, etc. | ||
* CEGUI: Crazy Eddie's GUI system is a graphical user interface C++ library. | * CEGUI: Crazy Eddie's GUI system is a graphical user interface C++ library. | ||
Some of the code may be explained in detail in pages under the this category: [[:Category:Classes (Blue)|Classes (Blue)]] | |||
== Simplification of data types == | == Simplification of data types == | ||
Line 66: | Line 83: | ||
== Entity types == | == Entity types == | ||
CCLIENTCAMERA - Camera | * CCLIENTCAMERA - Camera | ||
CCLIENTPLAYER - Player | * CCLIENTPLAYER - Player | ||
CCLIENTVEHICLE - Vehicle | * CCLIENTVEHICLE - Vehicle | ||
CCLIENTRADARMARKER - Blip | * CCLIENTRADARMARKER - Blip | ||
CCLIENTOBJECT - Object | * CCLIENTOBJECT - Object | ||
CCLIENTPICKUP - Pickup | * CCLIENTPICKUP - Pickup | ||
CCLIENTRADARAREA - RadarArea | * CCLIENTRADARAREA - RadarArea | ||
CCLIENTMARKER - Marker | * CCLIENTMARKER - Marker | ||
CCLIENTTEAM - Team | * CCLIENTTEAM - Team | ||
CCLIENTPED - Ped | * CCLIENTPED - Ped | ||
CCLIENTPROJECTILE - Projectile | * CCLIENTPROJECTILE - Projectile | ||
CCLIENTGUI: | * CCLIENTIFP - EngineIFP | ||
CGUI_BUTTON - GuiButton | * CCLIENTGUI: | ||
CGUI_CHECKBOX - GuiCheckBox | * CGUI_BUTTON - GuiButton | ||
CGUI_EDIT - GuiEdit | * CGUI_CHECKBOX - GuiCheckBox | ||
CGUI_GRIDLIST - GuiGridList | * CGUI_EDIT - GuiEdit | ||
CGUI_LABEL - GuiLabel | * CGUI_GRIDLIST - GuiGridList | ||
CGUI_MEMO - GuiMemo | * CGUI_LABEL - GuiLabel | ||
CGUI_PROGRESSBAR - GuiProgressBar | * CGUI_MEMO - GuiMemo | ||
CGUI_RADIOBUTTON - GuiRadioButton | * CGUI_PROGRESSBAR - GuiProgressBar | ||
CGUI_STATICIMAGE - GuiStaticImage | * CGUI_RADIOBUTTON - GuiRadioButton | ||
CGUI_TAB - GuiTab | * CGUI_STATICIMAGE - GuiStaticImage | ||
CGUI_TABPANEL - GuiTabPanel | * CGUI_TAB - GuiTab | ||
CGUI_WINDOW - GuiWindow | * CGUI_TABPANEL - GuiTabPanel | ||
CGUI_SCROLLPANE - GuiScrollPane | * CGUI_WINDOW - GuiWindow | ||
CGUI_SCROLLBAR - GuiScrollBar | * CGUI_SCROLLPANE - GuiScrollPane | ||
CGUI_COMBOBOX - GuiComboBox | * CGUI_SCROLLBAR - GuiScrollBar | ||
CCLIENTCOLSHAPE - ColShape | * CGUI_COMBOBOX - GuiComboBox | ||
SCRIPTFILE - File | * CCLIENTCOLSHAPE - ColShape | ||
CCLIENTDFF - EngineDFF | * SCRIPTFILE - File | ||
CCLIENTCOL - EngineCOL | * CCLIENTDFF - EngineDFF | ||
CCLIENTTXD - EngineTXD | * CCLIENTCOL - EngineCOL | ||
CCLIENTSOUND - Sound | * CCLIENTTXD - EngineTXD | ||
CCLIENTWATER - Water | * CCLIENTSOUND - Sound | ||
CCLIENTDXFONT - DxFont | * CCLIENTWATER - Water | ||
CCLIENTGUIFONT - GuiFont | * CCLIENTDXFONT - DxFont | ||
CCLIENTTEXTURE - DxTexture | * CCLIENTGUIFONT - GuiFont | ||
CCLIENTSHADER - DxShader | * CCLIENTTEXTURE - DxTexture | ||
CCLIENTWEAPON - Weapon | * CCLIENTSHADER - DxShader | ||
CCLIENTEFFECT - Effect | * CCLIENTWEAPON - Weapon | ||
CCLIENTSCREENSOURCE - DxScreenSource | * CCLIENTEFFECT - Effect | ||
CCLIENTRENDERTARGET - DxRenderTarget | * CCLIENTSCREENSOURCE - DxScreenSource | ||
* CCLIENTRENDERTARGET - DxRenderTarget | |||
[[Category: Development]] |
Latest revision as of 17:37, 12 March 2020
Introduction
This page has information which would be useful for anyone who is doing coding for MTA SA. Coding guidelines also has a lot of useful info.
Also useful:
Directory Structure
Our project is organised into a number of different directories which serve different purposes:
- Client
- Server
- Shared: contains code shared between both the client and the server
- utils: utilities used to automate certain tasks
- vendor: unmodified third-party code and libraries (optionally linked to the appropriate third-party Git repository through Git submodules).
Projects explained
- Client - Core: Typically UI elements like main menu etc and isn't ever unloaded.
- Client - Deathmatch: Where MTA makes all it's functions and events do stuff.
- Client - Game SA: Low level stuff which is mainly function calls to the game so each element will have a game_sa class like Vehicle, Ped, Object etc.
- Client - GUI: It's just wrappers to CEGUI, you need not touch.
- Client - Launch: Is the MTA executable which loads loader, you need not touch.
- Client - Loader: You need not touch the loader either.
- Client - Multiplayer SA: Hooks, code modification and that sort of low level things that lets us work.
- Server - Core: Cazomino05: "I genuinely don't really know why we have server core."
- Server - Dbconmy: Stuff to do with the db* functions, you need not touch.
- Server - Deathmatch: All the server logic and storage classes for elements as well as Lua stuff.
- Server - Launcher: Just an executable to load all the DLLs we need.
- Shared - XML Module: XML module is just tinyxml and some high level wrapper functions for stuff we need.
- Dependencies: Has a load of 3rd party code, modules like sqlite, curl, lua, ehs, etc.
- CEGUI: Crazy Eddie's GUI system is a graphical user interface C++ library.
Some of the code may be explained in detail in pages under the this category: Classes (Blue)
Simplification of data types
MTA has some type definitions you can use (Can be found in Shared/sdk/SharedUtil.h)
- ulong = unsigned long
- uint = unsigned int
- ushort = unsigned short
- uchar = unsigned char
- uint64 = unsigned long long
- uint32 = unsigned int
- uint16 = unsigned short
- uint8 = unsigned char
- int64 = signed long long
- int32 = signed int
- int16 = signed short
- int8 = signed char
- BYTE = unsigned char
- WORD = unsigned short
- DWORD = unsigned long
- FLOAT = float
Debug Commands
MTA has some commands which you can use if you're running debug mode
- showsync - show sync data
- foo - debug command for devs
- showwepdata - shows the given player weapon data (nick)
- showtasks - shows the local player tasks (nick)
- showplayer - shows extended player information (nick)
- setmimic - enables player mimics (amount)
- setmimiclag - enables player mimic lag (amount)
- paintballs - enables paintball mode
- breakpoint - inserts breakpoint
- giveweapon - gives the player a weapon (id)
- showrpcs - shows the remote prodecure calls
- showinterpolation - shows information about the interpolation
- watch - enables wpm watch mode
- modules - enables wpm module
- debug - debug function 1
- debug2 - debug function 2
- debug3 - debug function 3
- debug4 - debug function 4
Entity types
- CCLIENTCAMERA - Camera
- CCLIENTPLAYER - Player
- CCLIENTVEHICLE - Vehicle
- CCLIENTRADARMARKER - Blip
- CCLIENTOBJECT - Object
- CCLIENTPICKUP - Pickup
- CCLIENTRADARAREA - RadarArea
- CCLIENTMARKER - Marker
- CCLIENTTEAM - Team
- CCLIENTPED - Ped
- CCLIENTPROJECTILE - Projectile
- CCLIENTIFP - EngineIFP
- CCLIENTGUI:
- CGUI_BUTTON - GuiButton
- CGUI_CHECKBOX - GuiCheckBox
- CGUI_EDIT - GuiEdit
- CGUI_GRIDLIST - GuiGridList
- CGUI_LABEL - GuiLabel
- CGUI_MEMO - GuiMemo
- CGUI_PROGRESSBAR - GuiProgressBar
- CGUI_RADIOBUTTON - GuiRadioButton
- CGUI_STATICIMAGE - GuiStaticImage
- CGUI_TAB - GuiTab
- CGUI_TABPANEL - GuiTabPanel
- CGUI_WINDOW - GuiWindow
- CGUI_SCROLLPANE - GuiScrollPane
- CGUI_SCROLLBAR - GuiScrollBar
- CGUI_COMBOBOX - GuiComboBox
- CCLIENTCOLSHAPE - ColShape
- SCRIPTFILE - File
- CCLIENTDFF - EngineDFF
- CCLIENTCOL - EngineCOL
- CCLIENTTXD - EngineTXD
- CCLIENTSOUND - Sound
- CCLIENTWATER - Water
- CCLIENTDXFONT - DxFont
- CCLIENTGUIFONT - GuiFont
- CCLIENTTEXTURE - DxTexture
- CCLIENTSHADER - DxShader
- CCLIENTWEAPON - Weapon
- CCLIENTEFFECT - Effect
- CCLIENTSCREENSOURCE - DxScreenSource
- CCLIENTRENDERTARGET - DxRenderTarget