diff --git a/source/cl_parse.c b/source/cl_parse.c index 7a7a711..efedb68 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -1130,6 +1130,13 @@ void CL_ParseServerMessage (void) MSG_ReadByte(); break; + case svc_rumble: + // This platform doesn't use this. + MSG_ReadShort(); + MSG_ReadShort(); + MSG_ReadShort(); + break; + case svc_screenflash: screenflash_color = MSG_ReadByte(); screenflash_duration = sv.time + MSG_ReadByte(); diff --git a/source/pr_cmds.c b/source/pr_cmds.c index 7b54bb5..319a821 100644 --- a/source/pr_cmds.c +++ b/source/pr_cmds.c @@ -3345,6 +3345,39 @@ void PF_LockViewmodel(void) MSG_WriteByte (&client->message, state); } +/* +================= +PF_Rumble + +Server tells client to rumble their +GamePad. + +nzp_rumble() +================= +*/ +void PF_Rumble(void) +{ + client_t *client; + int entnum; + int low_frequency; + int high_frequency; + int duration; + + entnum = G_EDICTNUM(OFS_PARM0); + low_frequency = G_FLOAT(OFS_PARM1); + high_frequency = G_FLOAT(OFS_PARM2); + duration = G_FLOAT(OFS_PARM3); + + if (entnum < 1 || entnum > svs.maxclients) + return; + + client = &svs.clients[entnum-1]; + MSG_WriteByte (&client->message, svc_rumble); + MSG_WriteShort (&client->message, low_frequency); + MSG_WriteShort (&client->message, high_frequency); + MSG_WriteShort (&client->message, duration); +} + /* ================= PF_ScreenFlash @@ -4058,6 +4091,8 @@ PF_BettyPrompt, // #504 PF_SetPlayerName, // #505 PF_SetDoubleTapVersion, // #506 PF_ScreenFlash, // #507 +PF_LockViewmodel, // #508 +PF_Rumble, // #509 PF_Fixme, }; diff --git a/source/protocol.h b/source/protocol.h index 529e597..ea52ec4 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -160,6 +160,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define svc_doubletap 49 #define svc_screenflash 50 // [byte] color [byte] duration [byte] type #define svc_lockviewmodel 51 +#define svc_rumble 52 // [short] low frequency [short] high frequency [short] duration (ms) // // client to server