SA-MP 0.3c R3/R4/R5 server update
#1

This update is for SA-MP server owners only

We are issuing a server update for SA-MP 0.3c to address some security concerns.

If updating from an existing 0.3c R1/R2 server: you can update simply by replacing the 'samp03svr' file on linux or 'samp-server.exe' file on Windows found in the 0.3c R5 server download package.

SA-MP 0.3c R5 server

- The server crash vulnerabilities, described as resolved in the 0.3c R3/R4 server, were not completely fixed. We are making the 0.3c R5 server available. These server crash vulnerabilities only effect the Linux version of the SA-MP 0.3c server. Both Windows and Linux versions of the SA-MP server are being updated to 0.3c R5 for server version consistency.

SA-MP 0.3c R4 server

- Another denial of service vulnerability was discovered after the 0.3c R3 server release and has been fixed in the 0.3c R4 server.
- Fixes an issue with GetPlayerSurfingObjectID() returning the wrong object ID.
- Fixes a few minor problems with the format() function in pawn.

New pawn natives:
pawn Code:
native GetPlayerNetworkStats(playerid, retstr[], size);
native GetNetworkStats(retstr[], size);
The above functions return a string similar to the information seen in the player's F5 stats. It is the server's version of the network statistics which includes a list of things like network Packetloss, Upload/Download rates etc. This information might be useful in determining network problems for specific players, or for the entire server. If you are interested in these functions please see the netstats.pwn filterscript included with the Windows server package.

SA-MP 0.3c R3 server

- Fixes a denial of service vulnerability on SA-MP linux servers where a remote attacker could send a specially crafted packet which would trigger a debug assertion in SA-MP's networking layer; causing the server to shut down.

New pawn natives:
pawn Code:
native GetPlayerCameraMode(playerid);
Returns the current GTA camera mode for the requested player. The camera modes are useful in determining whether a player is aiming, doing a passenger driveby etc.

pawn Code:
native Float:GetPlayerDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z);
native Float:GetVehicleDistanceFromPoint(vehicleid, Float:X, Float:Y, Float:Z);
The above functions can be used as fast alternatives to calculating distances in pawn. It is still preferable to use IsPlayerInRangeOfPoint() if you don't require the exact distance.

pawn Code:
native GetPlayerSurfingObjectID(playerid);
GetPlayerSurfingObjectID is similar to GetPlayerSurfingVehicleID. If the player is standing on a global moving object, the ID of the object will be returned. If the player is not surfing a moving object, it will return INVALID_OBJECT_ID.

New callback:
pawn Code:
forward OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
This callback is called when a player updates the position of a vehicle they're not driving. This can happen outside of the vehicle or when the player is a passenger of a vehicle that has no driver.

Downloads:

SA-MP 0.3c R5 Linux Server: http://files.sa-mp.com/samp03csvr_R5.tar.gz
SA-MP 0.3c R5 Windows Server: http://files.sa-mp.com/samp03csvr_R5_win32.zip

Update 25/07/2011 There was a small issue regarding space padding in the format() function in the original 0.3c R3 release. If you happened to download this version, please download the above 0.3c R3-1 server.
Update 27/07/2011 0.3c R3 server was updated to SA-MP 0.3c R4.
Update 28/07/2011 0.3c R4 server was updated to SA-MP 0.3c R5.
Reply
#2

Seems like OnUnoccupiedVehicleUpdate could help some Roleplay servers, thanks for the update Kalcor.
Reply
#3

Thanks for the release Kalcor, great as always . The GetPlayerSurfingObjectID will become quite useful.
Reply
#4

Jizzed my pants. Good job
Reply
#5

Great update. I'm looking to more camera functions in the future hopefully those are nice, but maybe some that can be used to create easy made moving cameras? Built-in functions would be much better than those scripts with math equations and server lag timers.
Reply
#6

truly awesome.
we'll finally get rid of the god damn server attackers
Reply
#7

Added most of the new functions to the wiki (https://sampwiki.blast.hk/wiki/Special:Recentchanges), with the exception of GetPlayerCameraMode because I can't find any defines (like CAMERA_MODE_AIMING) in a_players.inc.
Reply
#8

I put GetPlayerCameraMode (in a SendClientMessage) in OnPlayerUpdate with the default LVDM.amx on my server, The server crashes within a minute, and doesn't crash when I unload this test FS.

pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    new string[128];
    format(string, sizeof(string), "%d", GetPlayerCameraMode(playerid));
    SendClientMessage(playerid, 0x0FFFFFFFA, string);
    return 1;
}
Reply
#9

Thanks for the update. What does GetPlayerCameraMode actually return? A string, float, or integer?
Reply
#10

It returns an integer.

Some camera modes i found:

camera 3: tram/train passenger entering camera (??!), tram/train driver camera
camera 4: normal onfoot chasing camera (several variable distances)
camera 7: sniper aiming mode
camera 8: rpg aiming mode
camera 16: front closeup camera attached on car (+skimmer+heli+airplane)
camera 18: normal car (+skimmer+helicopter+airplane) chase camera (several variable distances)
camera 22: normal boat chase camera (several variable distances)
camera 15: chase cinematic camera (also spray garage camera)
camera 46: picture-camera camera mode
camera 51: heatseeker aiming mode
camera 53: over-shoulder on-foot aiming with a weapon (any, including minigun)
camera 55: passenger window-driveby mode
camera 56: news-reporter style chase cinematic camera (wobbbling and zooming)
Reply
#11

Oh, cool! Thanks, JernejL.
Reply
#12

Thanks, I added a wiki entry for it now.
Reply
#13

Thank you for the update.
Reply
#14

Quote:
Originally Posted by whitetigerswt
View Post
I put GetPlayerCameraMode (in a SendClientMessage) in OnPlayerUpdate with the default LVDM.amx on my server, The server crashes within a minute, and doesn't crash when I unload this test FS.

pawn Code:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
    new string[128];
    format(string, sizeof(string), "%d", GetPlayerCameraMode(playerid));
    SendClientMessage(playerid, 0x0FFFFFFFA, string);
    return 1;
}
I'm attempting to confirm this problem. Can you give more info? Are you running this on Windows or Linux? Can you provide the crashinfo.txt file or a gdb backtrace from linux?

Edit:

Unable to confirm problem. I have tested the conditions described on both Windows and Linux servers.
Reply
#15

no crash for me with windows server and linux with your code
Reply
#16

Quote:
Originally Posted by JernejL
View Post
It returns an integer.

Some camera modes i found:

camera 3: tram/train passenger entering camera (??!), tram/train driver camera
camera 4: normal onfoot chasing camera (several variable distances)
camera 7: sniper aiming mode
camera 8: rpg aiming mode
camera 16: front closeup camera attached on car (+skimmer+heli+airplane)
camera 18: normal car (+skimmer+helicopter+airplane) chase camera (several variable distances)
camera 22: normal boat chase camera (several variable distances)
camera 15: chase cinematic camera (also spray garage camera)
camera 46: picture-camera camera mode
camera 51: heatseeker aiming mode
camera 53: over-shoulder on-foot aiming with a weapon (any, including minigun)
camera 55: passenger window-driveby mode
camera 56: news-reporter style chase cinematic camera (wobbbling and zooming)
In addition to those

Camera 0: Not spawned at all
Camera 15: Seems to happen while you are spawning + entering a interior + Gambling
Reply
#17

Very nice!
Reply
#18

I thought you are dead
Reply
#19

Finally something new, nice job, Kalcor. Try to update SA-MP with images/sounds uploading to the server without any plugins or something like that.
Good luck ;]
Reply
#20

Wow this upgrade is so cool I realy like these new natives because they are very helpful. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)