Giter Site home page Giter Site logo

multitheftauto / mtasa-php-sdk Goto Github PK

View Code? Open in Web Editor NEW
20.0 6.0 7.0 416 KB

The official PHP SDK for the Multi Theft Auto Web Interface.

Home Page: https://multitheftauto.com

License: MIT License

PHP 99.09% Dockerfile 0.91%
multi-theft-auto php composer sdk httplug

mtasa-php-sdk'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-php-sdk's People

Contributors

daemant avatar deltanic avatar dependabot-preview[bot] avatar dependabot[bot] avatar ecastro98 avatar lpsd avatar megathorx avatar patrikjuvonen avatar qaisjp avatar

Stargazers

 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

mtasa-php-sdk's Issues

Function call only allows arrays as parameters

https://github.com/multitheftauto/mtasa-php-sdk/blob/master/src/Model/Resource.php#L60

The array prevents that you just pass numbers or strings as a parameter.

$this->mta->getResource('vrp')->call('phpSDKKickPlayer', $adminId, $targetId, $reason)

For now I need to wrap all the parameters into an array and unpack it in the script.

$this->mta->getResource('vrp')->call('phpSDKKickPlayer', ['adminId' => $adminId, 'targetId' => $targetId, 'reason' => $reason])

system() call causes failure

It seems that calling system() from PHP causes things to fail in some way. Take the following example:

require_once __DIR__ . '/vendor/autoload.php'; 
use MultiTheftAuto\Sdk\Mta;

$input = Mta::getInput();
Mta::doReturn($input[0]);

Create a basic Lua script using callRemote and call this PHP script. It simply returns the value that you passed to it (works fine).

Now try the following:

require_once __DIR__ . '/vendor/autoload.php'; 
use MultiTheftAuto\Sdk\Mta;

system("ls");

$input = Mta::getInput();
Mta::doReturn($input[0]);

This will result in failure, and return nil instead of the value you passed to callRemote.

As a note, this issue was present in the previous version of the PHP SDK.

Tags need to use the `v` prefix

v1.0.0 and v1.0.1 instead of 1.0.0 and 1.0.1 as per github's recommendations:

image

It would be nice if you could update the existing tags too please!

Unexpected exception when instantiating class.

<?php

require_once 'vendor/autoload.php';

use MultiTheftAuto\Sdk\Mta;
use MultiTheftAuto\Sdk\Model\Server;
use MultiTheftAuto\Sdk\Model\Authentication;

try {

    $server = new Server('127.0.0.1', 22005);
    $auth = new Authentication('myUser', 'myPassword');
    $mta = new Mta($server, $auth); # this line gives the error

}catch(Exception $e){
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

?>

This is a sample concept code extracted from my PHP script. I have logically replaced ip, port, user, password with my own credentials in my script, but no matter what's written there, $mta line gives the error which is in the title of this issue.

Package is not compatible with PHP 7.4.1

They bumped the version of ext-json from 1.5 to 7.4.1. It works fine with PHP 7.3

  Problem 1
    - multitheftauto/mtasa-php-sdk 1.0.2 requires ext-json ^1.5 -> the requested PHP extension json has the wrong version (7.4.1) installed.
    - multitheftauto/mtasa-php-sdk 1.0.2 requires ext-json ^1.5 -> the requested PHP extension json has the wrong version (7.4.1) installed.
    - Installation request for multitheftauto/mtasa-php-sdk 1.0.2 -> satisfiable by multitheftauto/mtasa-php-sdk[1.0.2].

/EDIT php/php-src#4459

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.