multitheftauto / amx

MTA AMX compatibility layer.
zlib License
30 stars 8 forks source link

RakNet based plugins #69

Closed Zorono closed 3 years ago

Zorono commented 4 years ago

Describe the bug once i try to load any RakNet based plugin the whole server gets crashed...

To reproduce

  1. Add YSF plugin into your \server\mods\deathmatch\resources\amx\plugins YSF binaries.zip
  2. insert YSF(Plugin name) into your \server\mods\deathmatch\resources\amx\meta.xml settings element-> setting sub-element with plugins attribute for example
    <meta>
    <!-- ................... -->
    <settings>
    <!-- ..................... -->
    <setting name="plugins" value="YSF" />
    </settings>
    </meta>

Expected behaviour Load normally and echo the follow credits

   Loading plugin: YSF

   ===============================
         YSF - kurta999's version R20-RC4 loaded
    (c) 2008 Alex "Y_Less" Cole - (c) 2010 - 2016 kurta999
     Server version: 0.3.7 R2-1
     Operating System: Windows
     Built on: Dec 20 2018 at 16:56:06
   ===============================

   Loaded.

Additional context please note that i am currently trying to run NoBody's fork of YSF

colistro123 commented 4 years ago

Plugins that either try to patch memory or depend on RakNet are currently not supported. Your best bet is probably editing the plugin and recompiling it with the RakNet stuff removed I guess.

Zorono commented 4 years ago

Plugins that either try to patch memory or depend on RakNet are currently not supported. Your best bet is probably editing the plugin and recompiling it with the RakNet stuff removed I guess.

unfortunately, that would break my script's main features fully :( i guess there could be a future compatibility by redirecting MTA RPCs/Packets to SAMP's one... by other words, just receive MTA RPCs/Packets and consider it's data/value as SAMP's one by redirecting it to that RakNet version which is being used by SAMP(and vice-versa)... (i know it would waste a lot of resources like RAM and CPU but i haven't any other idea...)

SAMP's Packets/RPCs ID: https://github.com/BrunoBM16/samp-packet-list/wiki

AGraber commented 3 years ago

I think this is not relevant to the goals of the project.

The goal of the project is very simple: Add an AMX compatibility layer; note the AMX on that sentence. I understand that SA-MP has several needless limitations which can be overcome by using the RakNet plugin, which effectively implements or alters functionality based on existing systems. But implementing a raknet compatibility layer is just impossible for a simple reason: MTA is not SA-MP. MTA works very differently under the hood, you can't just "translate" packets. It simply just doesn't work like that.

Even then, YSF is a very "hacky" plugin (not to say it's bad, it's very good for some cases) which hooks into internal structures, data and native (not AMX natives, real x86 native code) functions of SA-MP. Again, there's no way to support all that.

However, you also have to remember that, again, this is not SA-MP: MTA is open source and there's literally tons of more functionality compared to SA-MP, so it's extremely likely that whatever functionality this plugin or other RakNet-based solutions might be implementing is already implemented in MTA.

If the lack of access to a network API "breaks your script's main features fully", then your script is severely flawed. Proper abstractions on top of RakNet functions would have made the process of migrating stuff from raknet to MTA a simple matter of changing the "new" function's implementation (raknet packet -> mta function).

Most scripts that use these kinds of plugins (mine included) will require some work to run on MTA, but it's not very much, since you get to keep your existing Pawn script entirely without having to rewrite it in another language.