Git Product home page Git Product logo

multitheftauto / mtasa-blue Goto Github PK

View Code? Open in Web Editor NEW
1.3K 72.0 406.0 829.26 MB

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.

Home Page: https://multitheftauto.com

License: GNU General Public License v3.0

C++ 97.65% C 0.89% NSIS 0.92% Shell 0.02% Python 0.13% Batchfile 0.03% Lua 0.28% Makefile 0.01% Dockerfile 0.01% HTML 0.04% JavaScript 0.02%
multiplayer multi-theft-auto scripting lua reverse-engineering game-mod grand-theft-auto gtasa game-engine modding

mtasa-blue's Introduction

Multi Theft Auto: San Andreas

Multi Theft Auto (MTA) is a software project that adds network play functionality to Rockstar North's Grand Theft Auto game series, in which this functionality is not originally found. It is a unique modification that incorporates an extendable network play element into a proprietary commercial single-player PC game.

Development

This repository is not maintained and is only serving as a landing page for old links.

Our project's code repository can be found on the multitheftauto/mtasa-blue Git repository at GitHub.

Introduction

Multi Theft Auto is based on code injection and hooking techniques whereby the game is manipulated without altering any original files supplied with the game. The software functions as a game engine that installs itself as an extension of the original game, adding core functionality such as networking and GUI rendering while exposing the original game's engine functionality through a scripting language.

Originally founded back in early 2003 as an experimental piece of C/C++ software, Multi Theft Auto has since grown into an advanced multiplayer platform for gamers and third-party developers. Our software provides a minimal sandbox style gameplay that can be extended through the Lua scripting language in many ways, allowing servers to run custom created game modes with custom content for up to hundreds of online players.

Formerly a closed-source project, we have migrated to open-source to encourage other developers to contribute as well as showing insight into our project's source code and design for educational reasons.

Multi Theft Auto is built upon the "Blue" concept that implements a game engine framework. Since the class design of our game framework is based upon Grand Theft Auto's design, we are able to insert our code into the original game. The game is then heavily extended by providing new game functionality (including tweaks and crash fixes) as well as a completely new graphical interface, networking and scripting component.

Gameplay content

By default, Multi Theft Auto provides the minimal sandbox style gameplay of Grand Theft Auto. The gameplay can be heavily extended through the use of the Lua scripting language that has been embedded in the client and server software. Both the server hosting the game, as well as the client playing the game are capable of running and synchronizing Lua scripts. These scripts are layered on top of Multi Theft Auto's game framework that consists of many classes and functions so that the game can be adjusted in virtually any possible way.

All gameplay content such as Lua scripts, images, sounds, custom models or textures is grouped into a "resource". This resource is nothing more than an archive (containing the content) and a metadata file describing the content and any extra information (such as dependencies on other resources).

Using a framework based on resources has a number of advantages. It allows content to be easily transferred to clients and servers. Another advantage is that we can provide a way to import and export scripting functionality in a resource. For example, different resources can import (often basic) functionality from one or more common resources. These will then be automatically downloaded and started. Another feature worth mentioning is that server administrators can control the access to specific resources by assigning a number of different user rights to them.

mtasa-blue's People

Contributors

alonsohki avatar arcusmaximus avatar botder avatar cazomino05 avatar ccw808 avatar crosroad95 avatar darkdreamingdan avatar dutchman101 avatar fcs49 avatar gamesnert avatar github-actions[bot] avatar impuslive001 avatar jushar avatar kenix157 avatar kevuwk avatar lopezloo avatar lpsd avatar mabako avatar merlin avatar mtabot avatar necktrox avatar patrikjuvonen avatar pirulax avatar qaisjp avatar sbx320 avatar strixg avatar tederis avatar thenormalnij avatar toady avatar zzzjax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtasa-blue's Issues

setVehicleDoorsUndamageable does nothing

Describe the bug
setVehicleDoorsUndamageable does not prevent the doors from falling off even though it is being advertised so on Wiki.

To Reproduce

  1. Create a vehicle
  2. Set the vehicle doors undamageable
  3. Lock the vehicle doors (you can also try doing this before 2.)
  4. Start punching a door, use the kick if you want to test it faster
  5. Door will fall off

Expected behavior
Door should not fall off.

Screenshots
See YouTube video below:
See YouTube video
2018-07-26-01-09-49-min

MTA Client & Server:

  • Windows 10.0.17134.165
  • Multi Theft Auto v1.5.5-release-13804

Additional context
Wiki says you are supposed to lock the vehicle for undamageable doors to work right. Doesn't have any effect whatsoever, even when using without the lock.

I think the door shouldn't get damaged either, rather than just not falling off...

Blip size is not checked the same way as on server-side

Describe the bug
You can create a blip with size over 25, which is what the limit is server-side. Code is inconsistent.

To reproduce

  • createBlip( 0, 0, 3, 0, 500 ) -> works
  • createBlipAttachedTo( localPlayer, 0, 500 ) -> works
  • setBlipSize( blip, 500 ) -> works

Expected behavior
Clamped between 0 and 25.

Screenshots
mta-screen_2018-07-29_20-05-55

MTA Client & Server:

  • Multi Theft Auto v1.5.5-release-13816
  • Windows 10.0.17134.165

Additional context

  • Discovered by zHooP on Discord. Thanks.
  • This bug has been in the client code forever.
  • Better to make it backwards compatible and clamp the size instead of returning false upon invalid size.

Modern style!

Is your feature request related to a problem? Please describe.
No, as a kind of players may feel bored of the classic style, so decided to design a new style dgs
I would like the administration to make it a sub-style Example: dgs, This style is only designed to wait for my suggestion to be accepted.
best wishes!

Screen freezes when streamed in player changes clothes

The screen is freezing when local player or streamed in players change clothes.

addPedClothes(localPlayer, "vest", "vest", 0)

A freeze lasts around 0.25 seconds. Best reproduction when adding not used clothes.

Should not lag.

image

MTA:SA Server v1.5.5-release-12404
Multi Theft Auto v1.5.5-release-12411
Windows client, Linux server

onClientMarkerHit ignores element's interior

I have a client-side marker, placed into a non-zero interior, but onClientMarkerHit would still trigger if element in interior 0 enters the marker. I assume onClientColShapeHit has the same issue, though it's more evident with markers since they ignore hit element's height on the client side.

setElementParent on GUI elements is slightly broken

Describe the bug

  • It does not seem to be possible to set the parent of a GUI element to guiRoot. Also tested on root, resourceRoot and getResourceDynamicElementRoot(resource).
  • It does not seem to reset the position relative to the new parent when set (from window to another, for example). Repositioning does not reload the position.

To reproduce

  1. Create a GUI element and optionally another GUI element as the parent.
  2. setElementParent(guiElement, guiRoot) -> doesn't do anything
  3. setElementParent(guiElement, guiSecondWindow) -> sets, but doesn't reposition relative to the new parent

Expected behavior
Set parent as requested and reset position relative to the new parent.

MTA Client:
Multi Theft Auto v1.5.5-release-13968

Additional context

Crashes with dxCreateTexture with pixel count+:setPixels()

Describe the bug
So, I was doing some random thing, and for some reason I crashed a few times.
I was using dxCreateTexture() with some big pixel counts(12k+ on x and y)+setPixels()
I crashed out every time, but I dont know exactly caused the crash, but it has something to do with the mentioned functions.

To Reproduce
Maybe:

  1. C a texture(dxCreateTexture(20000, 20000))
  2. Set pixels on each axis:
    for x = 0, math.floor(20000/32), 32 do for y = 0, math.floor(20000/32), 32 do tex:setPixels(<Add pixels here from a 32x32 image>, x, y, 32, 32) end end
    This is how I crashed, or at least, it was like this.

Expected behavior
It should create the texture and set its pixels

MTA Client (please complete the following information):

  • Multi Theft Auto v1.5.5-release-12411
  • Running on Wine? Nein.

MTA Server (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.17134.165]
  • Multi Theft Auto Server v1.5.5-release-12411

setSoundEffectParameters function

Is your feature request related to a problem? Please describe.
Inability to change the sound effects' parameters.

Describe the solution you'd like
Add the following functions:

  • setSoundEffectParameters(element sound, string effectName, table effectParams)
  • table getSoundEffectParameters(element sound, string effectName)

Example usage:

local params = getSoundEffectParameters(sound, "reverb")
setSoundEffectParameter(sound, "reverb", {inGain = -5, reverbTime = params.reverbTime + 200})

Additional context
We can use the BASS_FXSetParameters function.

Voice system improvements

Is your feature request related to a problem? Please describe.

  • An excellent new feature for RP servers is the ability to check if a player has a mic plugged in (to show a custom icon or not). In my case, I'll display a mic icon (or not) besides the player's name.
  • Another excellent feature for RP servers is the ability to change the voice volume for each player based in a distance given. In doing this, we can implement the proximity voice chat system and some other cool stuffs.
  • Fix voice crashing and bugging out

Describe the solution you'd like
Enable both features or create them.

Mantis: https://bugs.mtasa.com/view.php?id=7168

dxSetAspectRatioAdjustmentEnabled fix

Describe the bug

I am designing my HUD elements in a 16:9 screen (1366x768) and using this function, I want to align above the radar.
The thing is that setting second argument as "aspect ratio the dxDraws were originally designed in" (in my case 16:9) will cause problems with MTA aspect ratio option.

Example:

  • 1366x768 (native 16:9), MTA aspect ratio 16:9 (auto) positions correctly
    mta-screen_2018-08-23_10-43-14
  • 1366x768 (native 16:9), MTA aspect ratio 4:3 positions incorrectly
    mta-screen_2018-08-23_10-43-25
  • 800x600 (native 4:3), MTA aspect ratio 16:9 positions correctly
    mta-screen_2018-08-23_10-00-59
  • 800x600 (native 4:3), MTA aspect ratio 4:3 positions incorrectly
    mta-screen_2018-08-23_10-02-00

To Reproduce

  1. Using onClientRender event, call dxSetAspectRatioAdjustmentEnabled(true, 16/9).
  2. Create any dx element with positions above radar, like I did.
    Here's example:
    dxDrawText("Text", sW*(-0.73), sH*(0.32), sW, sH, tocolor(255, 255, 255, 255), 1, "bankgothic", "center", "center")
  3. Go to MTA Settings -> Video -> Aspect Ratio -> Change to see the difference.
  4. Change resolution to a different aspect ratio (800x600) and repeat step 3.

Expected behavior

What I want to see is the placement of dx elements above the radar at any screen aspect ratio, at any MTA aspect ratio, without doing checks. My method of avoiding the use of this function is:

  • Checking for screen aspect ratio (sW/sH)
  • Then, checking MTA aspect ratio using dxGetStatus.SettingAspectRatio
    • dxGetStatus.SettingHUDMatchAspectRatio is a strange check. does more "stretch" to the screen.
  • Finally, creating positions for every case;

Screenshots
posted in bug description

MTA Client:

  • Version: v1.5.5-release-13968
  • Running in Wine? No

MTA Server:

  • OS: Linux, Debian 9
  • Version: 1.5.5-9.12430.0

Refactor CElementDeleter for IFP (shared_ptr support)

Is your feature request related to a problem? Please describe.
Before using the delete operator on entity, it is checked whether it's IFP or not. We need to remove that check. Now, the reason why the check is there, it's due to shared_ptr, you are not suppose to use delete operator on it. Fixing this problem will allow us to easily use shared_ptr in future instead of using dynamic memory allocation.

Describe the solution you'd like
Either use dynamic memory allocation and remove shared_ptr which I don't recommend, or create a new function that works like CElementDeleter::DoDeleteAll but for shared_ptr, and eliminate the check for IFP. Currently, there are two references to CElementDeleter::DoDeleteAll, so it shouldn't be that difficult to accomplish.

callRemote will always return a nil errno even if successful

Describe the bug
callRemote returns a nil errno although the request was successful. This behavior is not consistent with fetchRemote.

To Reproduce

  1. Send a request with callRemote.
  2. Inspect the errno argument provided by the callback function.

Expected behavior
CURLE_OK (0) as the errno if the request went through okay (see error codes on Wiki). If the request did not go through alright then it should return the corresponding error code for that error.

MTA Client & Server:

  • Multi Theft Auto v1.5.5-release-13959
  • Windows 10.0.17134.165

Additional context
Initially committed here: #271 (comment)
Will create a new PR for this.

Add logic cpu stat to 'shownetstat'

Describe the solution you'd like
So, I noticed, when looking at the 'shownetstat' window, that there is no logic cpu' row, like in 'getPerformanceStats', so maybe 'logic cpu' row could be added, that'd be a nice thing.

Crash when using dxDrawText with very long strings

Describe the bug
So, I made a stat resource, which displays stats, with, you nailed it: dxDrawText+dxDrawRectangle(bg)

To Reproduce
Steps to reproduce the behavior:

  1. Download this this resource
  2. Start it
  3. Let it run, and you'll start having frame drop. A lot of it.
  4. Craaash

MTA Client (please complete the following information):

  • Version: Multi Theft Auto v1.5.5-release-12411
  • Running in Wine? No

MTA Server (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.17134.165]
  • Version Multi Theft Auto Server v1.5.5-release-12411

Support for basic physics

Is your feature request related to a problem? Please describe.
support to make simple physics ( boxes and spheres ) with attaching elements to physics.
Calculating physics in lua isn't a good idea.

inside blowVehicle ( hardcoded function in gtasa ) is something that couse that doors, windows fly away from vehicle ( you can get damage from that )

client and server side if it possible ( not too hard )

Update curl from 7.59.0 to 7.61.0

Summary:

Copy of changelog:

Fixed in 7.61.0 - July 11 2018

Changes:

getinfo: add microsecond precise timers for seven intervals
curl: show headers in bold, switch off with --no-styled-output
httpauth: add support for Bearer tokens
Add CURLOPT_TLS13_CIPHERS and CURLOPT_PROXY_TLS13_CIPHERS
curl: --tls13-ciphers and --proxy-tls13-ciphers
Add CURLOPT_DISALLOW_USERNAME_IN_URL
curl: --disallow-username-in-url

Bugfixes:

CVE-2018-0500: smtp: fix SMTP send buffer overflow
schannel: disable client cert option if APIs not available
schannel: disable manual verify if APIs not available
tests/libtest/Makefile: Do not unconditionally add gcc-specific flags
openssl: acknowledge --tls-max for default version too
stub_gssapi: fix 'unused parameter' warnings
examples/progressfunc: make it build on both new and old libcurls
docs: mention it is HA Proxy protocol "version 1"
curl_fnmatch: only allow two asterisks for matching
docs: clarify CURLOPT_HTTPGET
configure: replace a AC_TRY_RUN with CURL_RUN_IFELSE
configure: do compile-time SIZEOF checks instead of run-time
checksrc: make sure sizeof() is used *with* parentheses
CURLOPT_ACCEPT_ENCODING.3: add brotli and clarify a bit
schannel: make CAinfo parsing resilient to CR/LF
tftp: make sure error is zero terminated before printfing it
http resume: skip body if http code 416 (range error) is ignored
configure: add basic test of --with-ssl prefix
cmake: set -d postfix for debug builds
multi: provide a socket to wait for in Curl_protocol_getsock
content_encoding: handle zlib versions too old for Z_BLOCK
winbuild: only delete OUTFILE if it exists
winbuild: In MakefileBuild.vc fix typo DISTDIR->DIRDIST
schannel: add failf calls for client certificate failures
cmake: Fix the test for fsetxattr and strerror_r
curl.1: Fix cmdline-opts reference errors
cmdline-opts/gen.pl: warn if mutexes: or see-also: list non-existing options
cmake: check for getpwuid_r
configure: fix ssh2 linking when built with a static mbedtls
psl: use latest psl and refresh it periodically
fnmatch: insist on escaped bracket to match
KNOWN_BUGS: restore text regarding #2101
INSTALL: LDFLAGS=-Wl,-R/usr/local/ssl/lib
configure: override AR_FLAGS to silence warning
os400: implement mime api EBCDIC wrappers
curl.rc: embed manifest for correct Windows version detection
strictness: correct {infof, failf} format specifiers
tests: update .gitignore for libtests
configure: check for declaration of getpwuid_r
fnmatch: use the system one if available
CURLOPT_RESOLVE: always purge old entry first
multi: remove a potentially bad DEBUGF()
curl_addrinfo: use same #ifdef conditions in source as header
build: remove the Borland specific makefiles
axTLS: not considered fit for use
cmdline-opts/cert-type.d: mention "p12" as a recognized type
system.h: add support for IBM xlc C compiler
tests/libtest: Add lib1521 to nodist_SOURCES
mk-ca-bundle.pl: leave certificate name untouched
boringssl + schannel: undef X509_NAME in lib/schannel.h
openssl: assume engine support in 1.0.1 or later
cppcheck: fix warnings
test 46: make test pass after year 2025
schannel: support selecting ciphers
Curl_debug: remove dead printhost code
test 1455: unflakified
Curl_init_do: handle NULL connection pointer passed in
progress: remove a set of unused defines
mk-ca-bundle.pl: make -u delete certdata.txt if found not changed
GOVERNANCE.md: explains how this project is run
configure: use pkg-config for c-ares detection
configure: enhance ability to build with static openssl
maketgz: fix sed issues on OSX
multi: fix memory leak when stopped during name resolve
CURLOPT_INTERFACE.3: interface names not supported on Windows
url: fix dangling conn->data pointer
cmake: allow multiple SSL backends
system.h: fix for gcc on 32 bit OpenServer
ConnectionExists: make sure conn->data is set when "taking" a connection
multi: fix crash due to dangling entry in connect-pending list
CURLOPT_SSL_VERIFYPEER.3: Add performance note
netrc: use a larger buffer to support longer passwords
url: check Curl_conncache_add_conn return code
configure: Add dependent libraries after crypto
easy_perform: faster local name resolves by using *multi_timeout()
getnameinfo: not used, removed all configure checks
travis: add a build using the synchronous name resolver
CURLINFO_TLS_SSL_PTR.3: improve the example
openssl: allow TLS 1.3 by default
openssl: make the requested TLS version the *minimum* wanted
openssl: Remove some dead code
telnet: fix clang warnings
DEPRECATE: new doc describing planned item removals
example/crawler.c: simple crawler based on libxml2
libssh: goto DISCONNECT state on error, not SESSION_FREE
CMake: Remove unused functions
darwinssl: allow High Sierra users to build the code using GCC
scripts: include _curl as part of CLEANFILES

---
Fixed in 7.60.0 - May 16 2018

Changes:

Add CURLOPT_HAPROXYPROTOCOL, support for the HAProxy PROXY protocol
Add --haproxy-protocol for the command line tool
Add CURLOPT_DNS_SHUFFLE_ADDRESSES, shuffle returned IP addresses

Bugfixes:

FTP: shutdown response buffer overflow CVE-2018-1000300
RTSP: bad headers buffer over-read CVE-2018-1000301
FTP: fix typo in recursive callback detection for seeking
test1208: marked flaky
HTTP: make header-less responses still count correct body size
user-agent.d:: mention --proxy-header as well
http2: fixes typo
cleanup: misc typos in strings and comments
rate-limit: use three second window to better handle high speeds
examples/hiperfifo.c: improved
pause: when changing pause state, update socket state
multi: improved pending transfers handling => improved performance
curl_version_info.3: fix ssl_version description
add_handle/easy_perform: clear errorbuffer on start if set
darwinssl: fix iOS build
cmake: add support for brotli
parsedate: support UT timezone
vauth/ntlm.h: fix the #ifdef header guard
lib/curl_path.h: added #ifdef header guard
vauth/cleartext: fix integer overflow check
CURLINFO_COOKIELIST.3: made the example not leak memory
cookie.d: mention that "-" as filename means stdin
CURLINFO_SSL_VERIFYRESULT.3: fixed the example
http2: read pending frames (including GOAWAY) in connection-check
timeval: remove compilation warning by casting
cmake: avoid warn-as-error during config checks
travis-ci: enable -Werror for CMake builds
openldap: fix for NULL return from ldap_get_attribute_ber()
threaded resolver: track resolver time and set suitable timeout values
cmake: Add advapi32 as explicit link library for win32
docs: fix CURLINFO_*_T examples use of CURL_FORMAT_CURL_OFF_T
test1148: set a fixed locale for the test
cookies: when reading from a file, only remove_expired once
cookie: store cookies per top-level-domain-specific hash table
openssl: fix build with LibreSSL 2.7
tls: fix mbedTLS 2.7.0 build + handle sha256 failures
openssl: RESTORED verify locations when verifypeer==0
file: restore old behavior for file:////foo/bar URLs
FTP: allow PASV on IPv6 connections when a proxy is being used
build-openssl.bat: allow custom paths for VS and perl
winbuild: make the clean target work without build-type
build-openssl.bat: Refer to VS2017 as VC14.1 instead of VC15
curl: retry on FTP 4xx, ignore other protocols
configure: detect (and use) sa_family_t
examples/sftpuploadresume: Fix Windows large file seek
build: cleanup to fix clang warnings/errors
winbuild: updated the documentation
lib: silence null-dereference warnings
travis: bump to clang 6 and gcc 7
travis: build libpsl and make builds use it
proxy: show getenv proxy use in verbose output
duphandle: make sure CURLOPT_RESOLVE is duplicated
all: Refactor malloc+memset to use calloc
checksrc: Fix typo
system.h: Add sparcv8plus to oracle/sunpro 32-bit detection
vauth: Fix typo
ssh: show libSSH2 error code when closing fails
test1148: tolerate progress updates better
urldata: make service names unconditional
configure: keep LD_LIBRARY_PATH changes local
ntlm_sspi: fix authentication using Credential Manager
schannel: add client certificate authentication
winbuild: Support custom devel paths for each dependency
schannel: add support for CURLOPT_CAINFO
http2: handle on_begin_headers() called more than once
openssl: support OpenSSL 1.1.1 verbose-mode trace messages
openssl: fix subjectAltName check on non-ASCII platforms
http2: avoid strstr() on data not zero terminated
http2: clear the "drain counter" when a stream is closed
http2: handle GOAWAY properly
tool_help: clarify --max-time unit of time is seconds
curl.1: clarify that options and URLs can be mixed
http2: convert an assert to run-time check
curl_global_sslset: always provide available backends
ftplistparser: keep state between invokes
Curl_memchr: zero length input can't match
examples/sftpuploadresume: typecast fseek argument to long
examples/http2-upload: expand buffer to avoid silly warning
ctype: restore character classification for non-ASCII platforms
mime: avoid NULL pointer dereference risk
cookies: ensure that we have cookies before writing jar
os400.c: fix checksrc warnings
configure: provide --with-wolfssl as an alias for --with-cyassl
cyassl: adapt to libraries without TLS 1.0 support built-in
http2: get rid of another strstr
checksrc: force indentation of lines after an else
cookies: remove unused macro
CURLINFO_PROTOCOL.3: mention the existing defined names
tests: provide 'manual' as a feature to optionally require
travis: enable libssh2 on both macos and Linux
CURLOPT_URL.3: added ENCODING section
wolfssl: Fix non-blocking connect
vtls: don't define MD5_DIGEST_LENGTH for wolfssl
docs: remove extraneous commas in man pages
URL: fix ASCII dependency in strcpy_url and strlen_url
ssh-libssh.c: fix left shift compiler warning
configure: only check for CA bundle for file-using SSL backends
travis: add an mbedtls build
http: don't set the "rewind" flag when not uploading anything
configure: put CURLDEBUG and DEBUGBUILD in lib/curl_config.h
transfer: don't unset writesockfd on setup of multiplexed conns
vtls: use unified "supports" bitfield member in backends
URLs: fix one more http url
travis: add a build using WolfSSL
openssl: change FILE ops to BIO ops
travis: add build using NSS
smb: reject negative file sizes
cookies: accept parameter names as cookie name
http2: getsock fix for uploads
all over: fixed format specifiers
http2: use the correct function pointer typedef

onClientCursorMove returns 65k on X or Y axis if moving the cursor too fast.

Describe the bug
So, if you move ur mouse too fast on an axis(X or Y) it sometimes returns(depends on the speed you are moving ur mouse with) it returns 65k (between 65500 and 65600) for some reason.

To Reproduce
Steps to reproduce the behavior:

  1. Add an event handler on onClientCursorMove:
    addEventHandler("onClientCursorMove", root, function(_, _, cx, cy) if (cx>65000) or (cy>65000) then print(cx, cy) end end)
  2. Move ur mouse like a total idiot
  3. Here u go

Expected behavior
It should return a normal value

Screenshots
no pls

MTA Client (please complete the following information):

  • Multi Theft Auto v1.5.5-release-12411
  • Running in Wine? Nein

MTA Server (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.17134.112]
  • Version: Multi Theft Auto v1.5.5-release-12411

Additional context
I ran my game in windowed mode, maybe that causes the problem, because my cursor goes out from the screen.

function `tocolor` server side

There's nothing to describe, just make tocolor possible to use serverside.

Example if you making group system with tag/group color, you have to rewrite tocolor function serverside or store color as table { r, g, b[, a] }

Marker size problem

hi
i am have problem with markers

the problem is if i am set marker size for example 100 and if i am used isElementWithinMarker or "onMarkerHit" or "onMarkerLeave"

will isElementWithinMarker return true and i am not in it

or events will run if i am not in it

and i m made function for solved the problem and Which it

https://wiki.multitheftauto.com/wiki/IsElementInMarker

and this function

https://wiki.multitheftauto.com/wiki/GetElementsInMarker

and i'm putting this functions in https://wiki.multitheftauto.com/wiki/Useful_Functions Someone delete pages

and this pic explain what i'm talking about

image

the code :

testMarker = createMarker ( 2492 , -1666 , 12.5 , "cylinder" , 100 , 255 , 255 , 255 , 120 )
setTimer( function( )
outputChatBox ( tostring ( isElementWithinMarker ( getElementsByType ( "player" ) [ 1 ] , testMarker ) ) )
end , 100 , 1 )

but if you used my function will the result is

image

the code :

local testMarker = createMarker ( 2492 , -1666 , 12.5 , "cylinder" , 100 , 255 , 255 , 255 , 120 )
setTimer( function( )
outputChatBox ( tostring ( isElementInMarker ( getElementsByType ( "player" ) [ 1 ] , testMarker ) ) )
end , 100 , 1 )

i hope approval my functions

Make setAccountSerial() function

Hi! On my own server I have a system that checks whenever the serial account is the same to the PC serial, if thats the case they log in, if not, the system checks other stuff.

The thing is that this serial changes to the serial of the PC that it logged last (if that sentence makes sense), so in order to check I need to get the account and account serial, and do the checks.

I think this is very annoying, because if one mistake is made, the serial could be one that isn't meant to be.

So I was thinking now that some people gave the function getAccountByID() and setAccountName(), maybe you could work on setAccountSerial(). This maybe could help some people which are still using the main MTA db instead of MySQL for example.

Thanks!

Extend exporting (variable exporting)

Is your feature request related to a problem? Please describe.
My idea is to make possible export variables, for read and write.
Yes, i already can export variable by using functions.

Describe the solution you'd like
New new attribute:
<export type="variable" name="variableName" readOnly = "true" />
readOnly = true by default.

New Functions:

mixed value = getVariable( resource, variableName )
bool success = setVariable( resource, variableName, value ) -- return false if is read only.

New event:

"onVariableChanged" with attributes; source of change, resource, variable name, old value, new value

Describe alternatives you've considered
There's no alternatives.

Additional context

dxDrawCircle invoked from inside custom lua class breaks rendering

Describe the bug
dxDrawCircle invoked from inside custom lua class breaks rendering.

To Reproduce

Copy script from here and run it using /bench
-- ----------------------------------------------------------------------------
-- Kamil Marciniak <github.com/forkerer> wrote this code. As long as you retain this 
-- notice, you can do whatever you want with this stuff. If we
-- meet someday, and you think this stuff is worth it, you can
-- buy me a beer in return.
-- ----------------------------------------------------------------------------

local min = math.min
local max = math.max

Benchmark = {}
Benchmark.metatable = {
    __index = Benchmark,
}
setmetatable( Benchmark, { __call = function(self,...) return self:New(...) end } )

function Benchmark:New()
	local self = setmetatable( {}, Benchmark.metatable )
	self.onRenderFunc = bind(Benchmark.OnRender, self)
	addEventHandler( "onClientPreRender", root, self.onRenderFunc )
	return self
end

function Benchmark:OnRender()
	dxDrawRoundedRectangle(350, 50, 100, 100, tocolor(0, 255, 0, 255), 20)
end

function StartBenchmark()
	Benchmark()
end
addCommandHandler( "bench", StartBenchmark )

function dxDrawRoundedRectangle(x, y, rx, ry, color, radius)
    rx = rx - radius * 2
    ry = ry - radius * 2
    x = x + radius
    y = y + radius

    if (rx >= 0) and (ry >= 0) then
        dxDrawRectangle(x, y, rx, ry, color)
        dxDrawRectangle(x, y - radius, rx, radius, color)
        dxDrawRectangle(x, y + ry, rx, radius, color)
        dxDrawRectangle(x - radius, y, radius, ry, color)
        dxDrawRectangle(x + rx, y, radius, ry, color)

        dxDrawCircle(x, y, radius, 180, 270, color, color, 7)
        dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7)
        dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7)
        dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7)
    end
end

function bind(func, ...)
	if not (type(func) == "function") then
		outputConsole( debug.traceback() )
		error("First argument to bind has to be function")
	end
	--assert(type(func) == "function", "First argument to bind has to be function")
	local args = {...}
  	local argsCnt = select("#",...)
	return function(...) 
		local retTable = {}
	    for i=1, argsCnt do
	      retTable[#retTable+1] = args[i]
	    end
    	local newArgs = {...}
    	local newArgsCnt = select("#",...)
		for i=1, newArgsCnt do
			retTable[#retTable+1] = newArgs[i]
		end
		return func(unpack(retTable))
	end
end

Expected behavior
Draw Stuff normally

Screenshots

image

MTA Client (please complete the following information):
Multi Theft Auto v1.5.5-release-13999

MTA Server (please complete the following information):
Same as client, it's newest nightly.

Use submodules for dependencies

I've briefly discussed this on the development chat and I've created this issue so that we can properly evaluate whether we want to use submodules. Please share your thoughts.


Is your feature request related to a problem? Please describe.
Updating and verifying vendor code is fairly manual work.

Describe the solution you'd like
For "vendored" code we haven't modified we can use git submodules.

This would make it easier to update and verify dependencies as we no longer need to fiddle about with copying code and figuring out which files to keep. We would just need to update the submodule reference.

Some things to be aware of:

  • We need to remind people to use git pull --recursive or git pull --recursive --shallow-submodules (the latter doing --depth=1 on submodules) and there are a couple other caveats
  • Most importantly, it must work with the build server (uses svn)

Additional context

Client side database

Simple request, support for file database client side ( without remote database ).

Nowadays a lot of browsers have support for database.
Yes, i can store data in raw file, xml, but i database is easy to manage, fast.

Trigger error messages should be improved

Is your feature request related to a problem? Please describe.
error that appear while event isn't added should contain source from where was triggered. Now i see only that random event was triggered, nothing else. If server have a lot of events, search can take forever.

Describe the solution you'd like
Add information about source of error ( resource, file, line ).

Describe alternatives you've considered
add event onEvent which first argument is event name and rest of arguments are from trigger.

Additional context

m_pScriptDebugging->LogError(NULL, "Client (%s) triggered serverside event %s, but event is not added serverside", pCaller->GetNick(), szName);

Issue with setMaxPlayers, you can pass 0 as max players.

Describe the bug
You shoulden't able to set 0 slots on server.

To Reproduce
/srun iprint(setMaxPlayers(0))

Expected behavior
Should print warning that said that you can set only 1 or more slots.

Screenshots
image

MTA Client (please complete the following information):
Working on any version

MTA Server (please complete the following information):
Working on any version

Additional context
I'm lazy, and i want to report it insted of add 2 lines of code ๐Ÿ˜‚

Hide line numbers when files are garbage collected

Is your feature request related to a problem? Please describe.
When unclosed files are garbage collected the file is automatically closed and a warning is triggered.

This warning uses the line number and script file of the exact point where Lua pauses for collection. This is bad as this debug info is pointless and can be confusing.

Describe the solution you'd like
Remove the line number and script file from the warning.

Additional context
See todo task.

Hard mode: bonus points and cold hard GTA cash will be rewarded if you somehow instead manage to report the line/file where the file was created. (p.s. this may result in unnecessary overhead + may still be confusing - this could be limited to development mode only)

Fix unhelpful destroyElement error messages

Is your feature request related to a problem? Please describe.
Some error messages are unhelpful, like the one from :destroy() method: Bad argument @ 'destroy'[Expected element at argument 1]
But if I use the destroyElement() function it actually outputs what it got(...1 got nil*)

Describe the solution you'd like
Adding the type of self to :destroy()'s debug message, and to other methods/functions.
I tried to fix it myself, but wasn't able to find the function(GetFullErrorMessage()) which outputs those messages.

Update json-c from 0.12 to 0.13.1

Summary:

  • Contains performance improvements and bug fixes
  • Not many changes required to our code:
    1. Removal: is_error() -> a simple NULL check is the way to go now
    2. Change: "Use size_t for array length and size." -> we need to change any affected parts to use unsigned ints instead of signed ints to avoid compiler warnings. In our case this only affects a couple for loops int -> uint.
    3. Remember to edit double precision: json-c has changed it a few times, by default it is at %.17g but we've had it at %.16g so it has to be edited (due to backwards compatibility reasons) in the source code at json_object.c:808 (issue: https://bugs.mtasa.com/view.php?id=8853) (commit: 4cc6fda)
    4. Remember to add extra changes to pretty mode: See @qaisjp's commit here: e5b1c3f
    5. Couldn't find any other commits related to json-c that we should take into account: https://github.com/multitheftauto/mtasa-blue/commits/master/vendor/json-c
  • It is good to update while we select and upgrade out of json-c to some other json library. The upgrade is unlikely to happen before 1.6, so it doesn't hurt to update now for whatever little performance boost it's worth.
  • Changelog: https://github.com/json-c/json-c/blob/master/ChangeLog
  • Releases: 0.12.1, 0.13, 0.13.1

Copy of changelog:

Build changes:
--------------

0.13.1 (up to commit 0f814e5, 2018/03/04)
=========================================

* Bump the major version of the .so library generated up to 4.0 to avoid 
  conflicts because some downstream packagers of json-c had already done
  their own bump to ".so.3" for a much older 0.12 release.
* Add const size_t json_c_object_sizeof()
* Avoid invalid free (and thus a segfault) when ref_count gets < 0
* PR#394: fix handling of custom double formats that include a ".0"
* Avoid uninitialized variable warnings in json_object_object_foreach
* Issue #396: fix build for certain uClibc based systems.
* Add a top level fuzz directory for fuzzers run by OSS-Fuzz


0.13 (up to commit 5dae561, 2017/11/29)
=================================

This release, being three and a half years after the 0.12 branch (f84d9c),
   has quite a number of changes included.  The following is a sampling of
   the most significant ones.

Since the 0.12 release, 250 issues and pull requests have been closed.
See issues_closed_for_0.13.md for a complete list.


Deprecated and removed features:
--------------------------------
* All internal use of bits.h has been eliminated.  The file will be removed.
	Do not use: hexdigit(), error_ptr(), error_descrition() and it_error() 
* lh_abort() is deprecated.  It will be removed.

Behavior changes:
-----------------
* Tighten the number parsing algorithm to raise errors instead of truncating
     the results.  For example 12.3.4 or 2015-01-15, which now return null.
	 See commit 99d8fc

* Use size_t for array length and size.  Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible
	See commits 45c56b, 92e9a5 and others.

* Check for failue when allocating memory, returning NULL and errno=ENOMEM.
	 See commit 2149a04.

* Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change)

New features:
-------------
* We're aiming to follow RFC 7159 now.

* Add a couple of additional option to json_object_to_json_string_ext:
	JSON_C_TO_STRING_PRETTY_TAB
	JSON_C_TO_STRING_NOSLASHESCAPE

* Add a json_object_object_add_ex() function to allow for performance
	improvements when certain constraints are known to be true.

* Make serialization format of doubles configurable, in two different ways:
	Call json_object_set_serializer with json_object_double_to_json_string and a custom
	 format on each double object, or
	Call json_c_set_serialization_double_format() to set a global or thread-wide format.

* Add utility function for comparing json_objects - json_object_equal()

* Add a way to copy entire object trees: json_object_deep_copy()
* Add json_object_set_<type> function to modify the value of existing json_object's
 without the need to recreate them.  Also add a json_object_int_inc function to
 adjust an int's value.
* Add support for JSON pointer, RFC 6901.  See json_pointer.h
* Add a json_util_get_last_err() function to retrieve the string describing the
 cause of errors, instead of printing to stderr.
* Add perllike hash function for strings, and json_global_set_string_hash() 8f8d03d
* Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects.

Notable bug fixes and other improvements:
-----------------------------------------
* Make reference increment and decrement atomic to allow passing json objects between threads.
* Fix json_object_object_foreach to avoid uninitialized variable warnings.
* Improve performance by removing unneeded data items from hashtable code and reducing duplicate hash computation.
* Improve performance by storing small strings inside json_object
* Improve performance of json_object_to_json_string by removing variadic printf. commit 9ff0f49
* Issue #371: fix parsing of "-Infinity", and avoid needlessly copying the input when doing so.
* Fix stack buffer overflow in json_object_double_to_json_string_format() - commit 2c2deb87
* Fix various potential null ptr deref and int32 overflows
* Issue #332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length.
* Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments.
* Issue #275: fix out of bounds read when handling unicode surrogate pairs.
* Ensure doubles that happen to be a whole number are emitted with ".0" - commit ca7a19
* PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated.
* Fix double to int cast overflow in json_object_get_int64.
* Clamp double to int32 when narrowing in json_object_get_int.
* Use strtoll() to parse ints - instead of sscanf
* Miscellaneous smaller changes, including removing unused variables, fixing warning
 about uninitialized variables adding const qualifiers, reformatting code, etc...

Build changes:
--------------
* Add Appveyor and Travis build support
* Switch to using CMake when building on Windows with Visual Studio.
	A dynamic .dll is generated instead of a .lib
	config.h is now generated, config.h.win32 should no longer be manually copied
* Add support for MacOS through CMake too.
* Enable silent build by default
* Link against libm when needed
* Add support for building with AddressSanitizer
* Add support for building with Clang
* Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified.

List of new functions added:
----------------------------
### json_object.h
* array_list_bsearch()
* array_list_del_idx()
* json_object_to_json_string_length()
* json_object_get_userdata()
* json_object_set_userdata()
* json_object_object_add_ex()
* json_object_array_bsearch()
* json_object_array_del_idx()
* json_object_set_boolean()
* json_object_set_int()
* json_object_int_inc()
* json_object_set_int64()
* json_c_set_serialization_double_format()
* json_object_double_to_json_string()
* json_object_set_double()
* json_object_set_string()
* json_object_set_string_len()
* json_object_equal()
* json_object_deep_copy()

### json_pointer.h
* json_pointer_get()
* json_pointer_getf()
* json_pointer_set()
* json_pointer_setf()

### json_util.h
* json_object_from_fd()
* json_object_to_fd()
* json_util_get_last_err()

### json_visit.h
* json_c_visit()

### linkhash.h
* json_global_set_string_hash()
* lh_table_resize()

### printbuf.h
* printbuf_strappend()


0.12.1
======

  * Minimal changes to address compile issues.

Linux server crashes with a warning of unclosed inject.so file being garbage collected

I communicate through a translator, because I don't know English well, sorry. Every 30 minutes, my server shuts down on its own. Server crash occurs. We managed to see only one error that came out. Hosting, where is the server does not help me, but I know for sure that it is not the resources. Here's a list of the mistakes that were made.

WARNING: Unclosed file (inject.so ) was garbage collected. Check your resource for dereferenced files.

MTA:SA Server v1.5.5-r12250-release crash report.
2018-08-04 18:31
Caught 37 addresses ...

Backtrace:
#0 - ./core.so(+0x53881) [0xf74c2881]
#1 - ./core.so(+0x760d6) [0xf74e50d6]
#2 - ./core.so(+0x76572) [0xf74e5572]
#3 - linux-gate.so.1(kernel_rt_sigreturn+0) [0xffffe410]
#4 - linux-gate.so.1(kernel_vsyscall+0x5) [0xffffe425]
#5 - /lib/libc.so.6(gsignal+0xc2) [0xf760e9c2]
#6 - /lib/libc.so.6(abort+0x193) [0xf7610353]
#7 - /lib/libc.so.6(+0x27d4b) [0xf7606d4b]
#8 - /lib/libc.so.6(+0x27dab) [0xf7606dab]
#9 - /game/mods/deathmatch/deathmatch.so(+0x2a06c0) [0xf66836c0]
#10 - /game/mods/deathmatch/deathmatch.so(+0x335656) [0xf6718656]
#11 - /game/mods/deathmatch/deathmatch.so(+0x49b24c) [0xf687e24c]
#12 - /game/mods/deathmatch/deathmatch.so(+0x4b182f) [0xf689482f]
#13 - /game/mods/deathmatch/deathmatch.so(+0x49b6ab) [0xf687e6ab]
#14 - /game/mods/deathmatch/deathmatch.so(+0x490ab5) [0xf6873ab5]
#15 - /game/mods/deathmatch/deathmatch.so(+0x49a5a3) [0xf687d5a3]
#16 - /game/mods/deathmatch/deathmatch.so(+0x49b902) [0xf687e902]
#17 - /game/mods/deathmatch/deathmatch.so(lua_pcall+0x66) [0xf6876ef6]
#18 - /game/mods/deathmatch/deathmatch.so(+0x314a51) [0xf66f7a51]
#19 - /game/mods/deathmatch/deathmatch.so(+0x2ccdea) [0xf66afdea]
#20 - /game/mods/deathmatch/deathmatch.so(+0x1b31f9) [0xf65961f9]
#21 - /game/mods/deathmatch/deathmatch.so(+0x1b4703) [0xf6597703]
#22 - /game/mods/deathmatch/deathmatch.so(+0x146ec3) [0xf6529ec3]
#23 - /game/mods/deathmatch/deathmatch.so(+0x15a834) [0xf653d834]
#24 - /game/mods/deathmatch/deathmatch.so(+0x16db2d) [0xf6550b2d]
#25 - /game/mods/deathmatch/deathmatch.so(+0x16de77) [0xf6550e77]
#26 - /game/mods/deathmatch/deathmatch.so(+0x46a7de) [0xf684d7de]
#27 - /game/mods/deathmatch/deathmatch.so(+0x46ac23) [0xf684dc23]
#28 - /game/mods/deathmatch/deathmatch.so(+0x15e726) [0xf6541726]
#29 - /game/mods/deathmatch/deathmatch.so(+0xb3218) [0xf6496218]
#30 - ./core.so(+0x55d27) [0xf74c4d27]
#31 - ./core.so(+0x56fc2) [0xf74c5fc2]
#32 - ./core.so(+0x589ae) [0xf74c79ae]
#33 - ./core.so(Run+0x82) [0xf74d6c72]
#34 - ./mta-server(main+0x408) [0x809a558]
#35 - /lib/libc.so.6(__libc_start_main+0xf3) [0xf75f75b3]
#36 - ./mta-server() [0x809a9fd]

Merge the two fire extinguish functions into one extinguishFire

Is your feature request related to a problem? Please describe.
Right now we've got two functions for extinguishing fire, making it a bit redundant:

  • extinguishAllFires
  • extinguishFireInRadius

Describe the solution you'd like
Merge the two fire extinguish functions into one extinguishFire function.
Proposed syntax: extinguishFire ( [ float x, float y, float z [, float radius = 1.0 ] ] )

Describe alternatives you've considered
None

Additional context
Requested originally by @qaisjp
I'm going to look at this now, feel free to assign me to it.
Should be a quick and small tweak. Will also not affect backwards compatibility, as these functions were newcomers to 1.5.6 anyway.

Upgrade from tinyxml to pugixml

Is your feature request related to a problem? Please describe.
TinyXML development has stopped and all development has moved to TinyXML-2.

Describe the solution you'd like
@sbx320 opened a branch to upgrade to pugixml and seems to have done a lot of progress on it.

Describe alternatives you've considered
TinyXML-2

Additional context
Is there a specific reason why the branch has not been merged in yet?

Window mode problem

Describe the bug
Window mode cut bottom of window

My monitor is 1920x1080 pixels

To Reproduce
Steps to reproduce the behavior:

  1. Enable window mode
  2. Connect to any server
  3. You can't see mta version,
  4. open client console and move mta window few pixels up
  5. now you can see mta version and sometimes explorer bar shows up above mta

Expected behavior
MTA Should be displaying properly, don't cut bottom of window

Screenshots
Right down corner invisible,
image
If i moved window few pixels up, then everything seems to be ok
image

MTA Client (please complete the following information):

  • Version: newstest, nightly
  • Running in Wine? NO

Additional context

MTA

Script jetpack warnings

Is your feature request related to a problem? Please describe.
Latest nightly server version outputs "Replaced with setPedWearingJetpack. Refer to the wiki for details" warnings.

Describe the solution you'd like
Remove warnings.

Additional context
Are the warnings are important? Do the old functions still work as expected?

dxDrawCircle crashes the client

After updating to MTA r13987, the game crashes as soon as i want to spawn on a certain map with custom objects.

Steps to reproduce the behavior:
-Go to my server (SAAW WW2)
-Ask a staff member to open map "Iceberg"
-Try to spawn, game will crash

Server and client is version r13987.

Crash reason: Core.dll

Crash dumps:
https://www.dropbox.com/s/xg5z76ld995hdbm/client_1.5.5-release-13987.0.000_core_001f8874_7363_DPxMb_6D01A8C0_55F3_0C7_7564F_20180807_2129.dmp?dl=0
https://www.dropbox.com/s/6p43qlxugkqms2r/client_1.5.5-release-13987.0.000_core_001f8874_7363_DPxMb_6D01A8C0_55F3_08C_7564F_20180807_2132.dmp?dl=0
https://www.dropbox.com/s/wzf7y8022so1sin/client_1.5.5-release-13987.0.000_core_001f8874_7363_DPxMb_6D01A8C0_55F3_021_7564F_20180807_2129.dmp?dl=0

CEGUI properties

New property for GUI Editbox
Please, add property for change background editbox. Example, as well as "ReadOnlyBGColour", but for NotRead add "BGColour"

Fix alpha channel rendering of replaced objects

Describe the bug
Currently there seems to be an issue with engineLoadDFF or engineLoadTXD that breaks alpha channel of objects. Object ID 3851 (A glass window) has perfectly fine alpha channel rendering and no issues occur.
However, if you try to replace that object with itself (carshowwin_SFSX.dff + carshowglass_SFSX.txd), you do NOT get the same result.

Notice how car and Ped are only visible behind the left window (original object), but they are invisible behind another object that has been replaced by engineLoadDFF/TXD to mimic the original:

image

Notice how some default SA map objects (the house etc) are only visible through the left (original) object, but rendering issues occur through the right object:

image

These issues are the exact same if you replace the object with itself, so there must be an issue with model replacing.

To Reproduce
-Go to map editor
-Create object 3851 - everything looks good
-start this resource: issue.zip
-Notice how alpha channel is suddenly broken

Expected behavior
Replacing an object with alpha channel should work the same way like an original object

MTA VERSION
Multi Theft Auto v1.5.5-release-14005

Additional context
Because some objects are still visible while others are not, it seems like there is a problem with the rendering order.

Maybe i am not aware of a speciality that i need to look out for when replacing an object - if i made a mistake and there is a way to fix this without patching MTA itself, let me know.

Update CEGUI

Is your feature request related to a problem? Please describe.
So, CEGUI is a littlebit outdated(just a tiny bit. It's version 0.4 here, and the newest one is 0.8.7)

Describe the solution you'd like
Updating CEGUI would solve the problem, since the newer CEGUI has some neat features, which could solve the need of custom dx libs like dgs.

New animation functions and improvement for current ones

Is your feature request related to a problem? Please describe.

  • 1. When you load an IFP file, there's no way to know what animations are loaded. You have to keep a track of animation names, which can sometimes be really frustrating, same thing goes for internal default animations, there's no way to know how many animations already exist and their names.
  • 2. There's no way to modify animation speed.
  • 3. engineReplaceAnimation requires you to replace animation for every ped individually, it's useful sometimes but sometimes it's not.
  • 4. engineReplaceAnimation does not immediately apply animation, it requires you to switch to another animation, and then switching back to the replaced animation will play the new animation.
  • 5. A function to get all animation block names.

Describe the solution you'd like
1. Add a new function getBlockAnimations. This function should take a string as parameter for block name and return a Lua table containing all animations for that block.
2. Add a new function setPedAnimationSpeed and setPedAnimation should take an extra parameter for animation speed.
3. If first parameter is not provided, i.e., ped, then engineReplaceAnimation should replace that animation for all players and server-side peds within the server.
4. The fix is pretty simple, when engineReplaceAnimation is called, simply get the animation association, delete its animation blend nodes pAnimAssociation->pAnimBlendNodeArray by calling CAnimBlendAssociationSAInterface::FreeAnimBlendNodeArray, and then reinitializing the same animation association with the new animation hierarchy by calling its constructor.
5. Add a new function getAnimationBlocks. This function should take first parameter as bool to include IFP blocks or not, and return the animation block names in a Lua table.

Additional context
These requested features related to animations are very useful, especially the 4th one.

Many player functions behave inconsistently when passing an invalid player element

Describe the bug
Many player functions process the element provided as CElement* instead of CPlayer*, causing inconsistency between some of the functions. For example, by providing root as the element, it will not throw a warning, while some of the functions do.

To Reproduce

  1. getPlayerIP(root) -> false, no warning
  2. getPlayerSerial(root) -> false, warning

Expected behavior
Make all functions work consistently. Specific class function -> require that specific class element.

MTA Client & Server
Multi Theft Auto v1.5.5-release-13977

Additional context

  • Should probably also check out other classes while at it.
  • I stumbled across to this problem while helping someone with a script problem on our Discord #scripting channel. They were using these two functions together and they asked me why does it throw an error on serial, but not on IP (IP was before serial). I then investigated and found these inconsistencies. And I agree, it is a stupid inconsistency that has to be fixed.
  • Does not require backwards compatibility as the only thing changing is we're essentially adding a warning.

Enable CEF's experimental features

Is your feature request related to a problem? Please describe.
It isn't a problem, just a desire to use CEF's experimental features to create some effects and use it in my server. For example, CEF's experimental features has gaussian blur.

GTMP, a Multiplayer modification for GTA V, has enabled CEF Experimental Features: https://gt-mp.net/forum/thread/1223-gt-mp-server-client-patch-v0-1-638-634/

Enabled CEF "experimental-web-platform-features" for newer CSS features

Describe the solution you'd like
Follow the solution by ed123 in this thread: http://magpcss.org/ceforum/viewtopic.php?f=6&t=12695

Got this solved. You need to override OnBeforeCommandLineProcessing method of CefApp class.

In cefsimple project, place the function below inside SimpleApp class:

virtual void OnBeforeCommandLineProcessing(
const CefString& process_type,
CefRefPtr command_line) {
command_line->AppendSwitch("enable-experimental-web-platform-features");
}

Add some functions to the File class

Is your feature request related to a problem? Please describe.
Partially, because sometimes I just want to rewrite the whole file, so a functions like:
File.readall
File.writeall
And maybe: File.clear

Describe the solution you'd like
Add the mentioned functions.

Vectors are incredibly slow

Describe the bug
So, using Vectors is a really good way to make your script more maintainable, but...
They are incredibly slow.
Here are some results:

------------[Vector2]------------
Create: 12348 ms.
sub: 16146 ms.
mul: 12616 ms.
eq: 456 ms.
pow: 12112 ms.
div: 13508 ms.
add: 11024 ms.
------------[Vector3]------------
Create: 13820 ms.
sub: 12819 ms.
mul: 11932 ms.
eq: 635 ms.
pow: 11516 ms.
div: 11353 ms.
add: 12621 ms.
------------[Vector4]------------
Create: 14891 ms.
sub: 11640 ms.
mul: 12306 ms.
eq: 385 ms.
pow: 13031 ms.
div: 11626 ms.
add: 10854 ms.
------------------------
Sub: 95
Function calls: 283 ms.

Sub: 95 (Time it takes to do a simple i = i-i expression)
Function calls: 283 ms. (This is the time it takes to call a function.)

Expected behavior
I'd expect Vectors to be far more faster.
The main reason they are slow is they use lua_classmetamethod, you may ask why:
Because I made a little Vector class in Lua and ran a performance test, got nearly the same results
the difference was 300ms/1m runs(with integers, with floats it was a little bit less)
Looks like comparation is pretty fast, maybe modification of the value is the slow part.

Additional context
Here's the test resource:
vectest.zip

(It's redundant a little and such, but really I just made it to ran these tests.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.