SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 22/04/2018, 12:41 AM   #1
AdrianGraber
Big Clucker
 
AdrianGraber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 97
Reputation: 102
Lightbulb samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

samp-compat libraries



Allow connections from clients with clients that differ from the server's version, allowing them to play alongside other clients without any additional software.

Installation

Simply install to your project depending on the version you wish to allow (0.3.7 servers should grab samp-dl-compat, and 0.3.DL servers should use samp-037-compat):

Code:
sampctl package install AGraber/samp-dl-compat
OR
sampctl package install AGraber/samp-037-compat
Include in your code:

Code:
#include <dl-compat>
OR
#include <037-compat>

Usage

Just include it to your script, nothing else to do. If you want to detect clients that use another version, you can use the original SA-MP function GetPlayerVersion, or use IsClient03DL(playerid) or IsClient037(playerid) (depending on the version you choose). This is not required for the include to work though.


Testing

A testing gamemode is included, this test showcases the capabilities of the include, by using functions that would rather be incompatible with clients if the RPCs contents weren't patched.

To test, simply run the package:
Code:
sampctl package run

Disclaimer
Custom objects and skins are not going to work with old clients. Custom skins will fallback to their base IDs, while objects are going to spawn as a `?` object that SA-MP falls back to when it tries to create an invalid object.

Please check the include if you're going to modify RPC contents, since some RPCs are modified, you must know what kind of changes or reads are you going do, otherwise you will recieve inconsistent data. You can use the functions provided by the include to know what to expect.

Credits


Thanks for using!

Last edited by AdrianGraber; 08/05/2018 at 05:44 PM.
AdrianGraber is offline   Reply With Quote
Old 22/04/2018, 01:59 AM   #2
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,269
Reputation: 1129
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Wow this is really nice man, a lot of people will appreciate this. I'm in shock!

Is it possible to replace every 0.3.7DL object with a specific model, if it is not found? (Being the question mark object model)

I hope this gets the approval by SA-MP moderators/Kalcor too

Edit: maybe im confused, can a 0.3.7.DL server take in 0.3.7 players?
__________________
Join the best Cops And Robbers in SA-MP, today. svr.irresistiblegaming.com:7777

Lorenc_ is offline   Reply With Quote
Old 22/04/2018, 04:57 AM   #3
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,473
Reputation: 295
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Quote:
(one in the works is one for 0.3.7 connections to 0.3.DL)
Would be dope,

Good job once again.
__________________
Code:
I'm available to script stuff for cash PM me here or on discord @ Andy[RDZ]#0040
[Tutorial]:Anti-cheat guide ||Mini-game 101||VC/LC maps install||
Array index out of bounds


[Github]:Link [Pastebin]:Link [Forum]:Link [Server]:Link [Discord]:Link




Code:
You may only contact me through the links on my signature, if else then its an impersonating one, i am not on amy other place not mentioned in my signature.
RogueDrifter is offline   Reply With Quote
Old 22/04/2018, 06:42 AM   #4
std
Big Clucker
 
Join Date: Apr 2018
Posts: 54
Reputation: 0
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

this is useful man, i hope a lot of servers use this to avoid me switching versions all the time.

one suggestion would be add the link to download https://github.com/AGraber/samp-dl-compat in case some people don't use sampctl

Quote:
Originally Posted by Lorenc_ View Post
Edit: maybe im confused, can a 0.3.7.DL server take in 0.3.7 players?
As of right now, his include allows 0.3.DL connections to join a 0.3.7 server.

but later on, as stated, if requested there will be "one in the works is one for 0.3.7 connections to 0.3.DL."
__________________
is only game, why you heff to be mad?
std is offline   Reply With Quote
Old 22/04/2018, 06:50 AM   #5
JesterlJoker
Huge Clucker
 
Join Date: Apr 2015
Location: Cagayan de Oro, Philippines
Posts: 265
Reputation: 27
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

How about the models though? Will it also be shown to users on 0.3.7, since AFAIK only 0.3.DL have this kind of function in it. What will be shown to 0.3.7?
__________________
My Projects:

JesterlJoker is offline   Reply With Quote
Old 22/04/2018, 07:57 AM   #6
std
Big Clucker
 
Join Date: Apr 2018
Posts: 54
Reputation: 0
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Quote:
Originally Posted by JesterlJoker View Post
How about the models though? Will it also be shown to users on 0.3.7, since AFAIK only 0.3.DL have this kind of function in it. What will be shown to 0.3.7?
the models can be replaced with a 0.3.7 compatible object. the skins too
__________________
is only game, why you heff to be mad?
std is offline   Reply With Quote
Old 22/04/2018, 08:10 AM   #7
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,473
Reputation: 295
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Quote:
Originally Posted by std View Post
the models can be replaced with a 0.3.7 compatible object. the skins too
If somehow they can take the baseid that would make much sense.

Although @Joker this include (for now) allows 0.3DL to connect to 0.3.7 which means the custom objects for now shouldnt matter.
__________________
Code:
I'm available to script stuff for cash PM me here or on discord @ Andy[RDZ]#0040
[Tutorial]:Anti-cheat guide ||Mini-game 101||VC/LC maps install||
Array index out of bounds


[Github]:Link [Pastebin]:Link [Forum]:Link [Server]:Link [Discord]:Link




Code:
You may only contact me through the links on my signature, if else then its an impersonating one, i am not on amy other place not mentioned in my signature.
RogueDrifter is offline   Reply With Quote
Old 22/04/2018, 09:24 AM   #8
AdrianGraber
Big Clucker
 
AdrianGraber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 97
Reputation: 102
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Quote:
Originally Posted by Lorenc_ View Post
Wow this is really nice man, a lot of people will appreciate this. I'm in shock!

Is it possible to replace every 0.3.7DL object with a specific model, if it is not found? (Being the question mark object model)

I hope this gets the approval by SA-MP moderators/Kalcor too

Edit: maybe im confused, can a 0.3.7.DL server take in 0.3.7 players?
For the moment, this include makes the server take in 0.3.DL players in 0.3.7 servers (old server), but I've just started working on one that would do what you say (0.3.7 players into 0.3.DL server).

The thing is that, with that version I would have to trust the developer to not send downloadable models to old clients. This can be actually useful when, for example, it's just an interior with custom models (you can deny entrance to this interior for old clients. Or even big maps that only change the virtual world, making a Vice City map totally optional, just to name two examples), or if you're just adding skins then, base ID would be shown instead.

For normal (non-skin) models, I'm not sure if sending the base ID is a good idea, since the base ID is mostly used for IDE flags. The model can be totally unrelated, but that really depends on the server. I think best thing would be to let server owners to place a pair of defines to make things a bit configurable, so that you could change the behaviour of what would happen if this happens.

Thanks for the feedback to all!
AdrianGraber is offline   Reply With Quote
Old 22/04/2018, 09:34 AM   #9
Dice_
Huge Clucker
 
Dice_'s Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 491
Reputation: 56
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

Once you released the 0.3.7 to 0.3DL,I will be using 0.3DL. I suggest to let the server owners decide what the original model is through coding,for example;
PHP Code:
BaseModel(customobjectid,baseobjectid); 
If that code is not assigned,use the baseid in artconfig instead.
Good job tho!
__________________
Dice_ is offline   Reply With Quote
Old 04/05/2018, 09:52 PM   #10
Gr00t
Little Clucker
 
Join Date: Apr 2018
Posts: 13
Reputation: 2
Default Re: samp-compat: Backwards and forward compatibility libraries between server-client (Old IsClient03DL)

It's working perfectly, all server owners should include this to their servers to have a full access to 0.3.7 servers from 0.3.DL client
Gr00t is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to port forward samp server using ptcl broadband router hassan12345 Server Support 4 25/07/2017 02:11 AM
SAMP for x64(Client, Server) Cherbet General 3 14/06/2017 03:15 PM
Editing samp client and server? GunZsmd Scripting Help 11 14/08/2016 11:29 PM
Backwards compatibility Voxel Scripting Help 10 22/01/2014 08:15 AM


All times are GMT. The time now is 05:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.