Merge remote-tracking branch 'origin/Saturn-Next' into waterrefract
This commit is contained in:
commit
d258c920de
8 files changed
+112
-78
No files matched your search
+26
-1
@@ -110,7 +110,7 @@ SINT8 joinnode = 0; // used for CL_VIEWSERVER
|
||||
boolean player_muted[MAXPLAYERS] = {};
|
||||
|
||||
// Server specific vars
|
||||
UINT8 playernode[MAXPLAYERS] = {};
|
||||
UINT8 playernode[MAXPLAYERS] = {UINT8_MAX};
|
||||
|
||||
// Minimum timeout for sending the savegame
|
||||
// The actual timeout will be longer depending on the savegame length
|
||||
@@ -3767,6 +3767,10 @@ static void Command_Ban(void)
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
|
||||
// player does not exist
|
||||
if (!playeringame[pn])
|
||||
return;
|
||||
|
||||
WRITEUINT8(p, pn);
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
@@ -3884,6 +3888,10 @@ static void Command_Kick(void)
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
|
||||
// player does not exist
|
||||
if (!playeringame[pn])
|
||||
return;
|
||||
|
||||
// Special case if we are trying to kick a player who is downloading the game state:
|
||||
// trigger a timeout instead of kicking them, because a kick would only
|
||||
// take effect after they have finished downloading
|
||||
@@ -3933,6 +3941,13 @@ static void Got_KickCmd(const UINT8 **p, INT32 playernum)
|
||||
pnum = READUINT8(*p);
|
||||
msg = READUINT8(*p);
|
||||
|
||||
if (pnum >= MAXPLAYERS)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal kick command received from %s for player %d\n"), player_names[playernum], pnum);
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: this does not work at all on dedi, servernode == 0 which is prevented from kick/ban command
|
||||
if (pnum == serverplayer && IsPlayerAdmin(playernum))
|
||||
{
|
||||
CONS_Printf(M_GetText("Server is being shut down remotely. Goodbye!\n"));
|
||||
@@ -3987,6 +4002,16 @@ static void Got_KickCmd(const UINT8 **p, INT32 playernum)
|
||||
msg = KICK_MSG_CON_FAIL;
|
||||
}
|
||||
|
||||
// without this the server will remove itself and thus self destruct on dedicated
|
||||
if (server && (playernode[pnum] == UINT8_MAX || !playeringame[pnum]))
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Attempting to kick player %d which is not in game received from %s\n"), pnum, player_names[playernum]);
|
||||
return;
|
||||
}
|
||||
|
||||
// make sure we dont read garbage anywhere
|
||||
memset(reason, 0, sizeof(buf));
|
||||
|
||||
if (msg == KICK_MSG_CUSTOM_BAN || msg == KICK_MSG_CUSTOM_KICK)
|
||||
{
|
||||
READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
|
||||
|
||||
+10
-7
@@ -1806,7 +1806,7 @@ INT32 D_LookupPlayer(const char *s)
|
||||
|
||||
if ((playernum = atoi(s)))
|
||||
{
|
||||
playernum = max(min(playernum, MAXPLAYERS-1), 0);/* not out of range */
|
||||
playernum = max(min(playernum, MAXPLAYERS-1), 0); /* not out of range */
|
||||
return playernum;
|
||||
}
|
||||
|
||||
@@ -5691,19 +5691,22 @@ static void Command_SkinSearch(void)
|
||||
size_t i;
|
||||
UINT16 s;
|
||||
UINT16 ic = 0;
|
||||
//skin_t *skininput = &skins[s];
|
||||
for (i = 1; i < COM_Argc(); i++){
|
||||
for( s = 0 ; s < numallskins ; s++ )
|
||||
|
||||
for (i = 1; i < COM_Argc(); i++)
|
||||
{
|
||||
for (s = 0; s < numskins; s++)
|
||||
{
|
||||
skin_t *skininput = &skins[s];
|
||||
if (strcasestr(skininput->realname,COM_Argv(i)))
|
||||
|
||||
if (strcasestr(skininput->realname, COM_Argv(i)))
|
||||
{
|
||||
ic++;
|
||||
CONS_Printf("%d. %s%s:\x80 %s\n", ic,HU_SkinColorToConsoleColor(skininput->prefcolor),skininput->realname,skininput->name);
|
||||
CONS_Printf("%d. %s%s:\x80 %s\n", ic, HU_SkinColorToConsoleColor(skininput->prefcolor), skininput->realname, skininput->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
CONS_Printf("Total %d skins.\n", ic);
|
||||
|
||||
CONS_Printf("Total %d skins.\n", ic);
|
||||
}
|
||||
|
||||
/** Sends a color change for the console player, unless that player is moving.
|
||||
|
||||
+31
-22
@@ -162,8 +162,7 @@ const char *wadSearchPaths[] = {
|
||||
|
||||
/** \brief WAD file to look for
|
||||
*/
|
||||
#define WADKEYWORD1 "srb2.srb"
|
||||
#define WADKEYWORD2 "srb2.wad"
|
||||
#define WADKEYWORD "srb2.srb"
|
||||
/** \brief holds wad path
|
||||
*/
|
||||
static char returnWadPath[256];
|
||||
@@ -526,16 +525,23 @@ void I_OutputMsg(const char *fmt, ...)
|
||||
{
|
||||
size_t len;
|
||||
char *txt;
|
||||
va_list argptr;
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr,fmt);
|
||||
if (!fmt)
|
||||
return;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, argptr);
|
||||
va_end(argptr);
|
||||
if (len == 0)
|
||||
return;
|
||||
|
||||
txt = malloc(len+1);
|
||||
va_start(argptr,fmt);
|
||||
txt = (char*)(malloc(len+1));
|
||||
|
||||
if (!txt)
|
||||
I_Error("I_OutputMsg: Out of memory!\n");
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsprintf(txt, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
@@ -1421,6 +1427,7 @@ static void I_Fork(void)
|
||||
|
||||
int I_OpenURL(const char *url)
|
||||
{
|
||||
(void)url;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1813,20 +1820,12 @@ const char *I_ClipboardPaste(void)
|
||||
*/
|
||||
static boolean isWadPathOk(const char *path)
|
||||
{
|
||||
char *wad3path = malloc(256);
|
||||
char *wad3path = (char*)(malloc(256));
|
||||
|
||||
if (!wad3path)
|
||||
return false;
|
||||
|
||||
sprintf(wad3path, pandf, path, WADKEYWORD1);
|
||||
|
||||
if (FIL_ReadFileOK(wad3path))
|
||||
{
|
||||
free(wad3path);
|
||||
return true;
|
||||
}
|
||||
|
||||
sprintf(wad3path, pandf, path, WADKEYWORD2);
|
||||
sprintf(wad3path, pandf, path, WADKEYWORD);
|
||||
|
||||
if (FIL_ReadFileOK(wad3path))
|
||||
{
|
||||
@@ -1843,12 +1842,17 @@ static void pathonly(char *s)
|
||||
size_t j;
|
||||
|
||||
for (j = strlen(s); j != (size_t)-1; j--)
|
||||
{
|
||||
if ((s[j] == '\\') || (s[j] == ':') || (s[j] == '/'))
|
||||
{
|
||||
if (s[j] == ':') s[j+1] = 0;
|
||||
else s[j] = 0;
|
||||
if (s[j] == ':')
|
||||
s[j+1] = 0;
|
||||
else
|
||||
s[j] = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** \brief search for srb2.srb in the given path
|
||||
@@ -1864,7 +1868,7 @@ static const char *searchWad(const char *searchDir)
|
||||
static char tempsw[256] = "";
|
||||
filestatus_t fstemp;
|
||||
|
||||
strcpy(tempsw, WADKEYWORD1);
|
||||
strcpy(tempsw, WADKEYWORD);
|
||||
fstemp = filesearch(tempsw, searchDir, NULL, true, 20);
|
||||
if (fstemp == FS_FOUND)
|
||||
{
|
||||
@@ -1985,17 +1989,22 @@ const char *I_LocateWad(void)
|
||||
static long get_entry(const char* name, const char* buf)
|
||||
{
|
||||
long val;
|
||||
char* hit = strstr(buf, name);
|
||||
if (hit == NULL) {
|
||||
const char* hit = strstr(buf, name);
|
||||
|
||||
if (hit == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = strtol(hit + strlen(name), NULL, 10);
|
||||
if (errno != 0) {
|
||||
|
||||
if (errno != 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7055,6 +7055,28 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
// "Stair jank" visuals akin to RR
|
||||
if (cv_stairjank.value && player->stairjank > 0)
|
||||
{
|
||||
// only spawn em once
|
||||
if (player->stairjank > 8)
|
||||
{
|
||||
// 90 degrees to direction you're facing
|
||||
fixed_t dirx = -FINESINE(player->mo->angle>>ANGLETOFINESHIFT);
|
||||
fixed_t diry = FINECOSINE(player->mo->angle>>ANGLETOFINESHIFT);
|
||||
fixed_t offset = player->mo->radius;
|
||||
|
||||
dirx = K_AltFlip(-dirx, 4);
|
||||
diry = K_AltFlip(-diry, 4);
|
||||
|
||||
mobj_t * spark = P_SpawnMobj(player->mo->x + FixedMul(dirx, offset), player->mo->y + FixedMul(diry, offset), player->mo->z, MT_DRIFTDUST);
|
||||
spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momx)/10;
|
||||
spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momy)/10;
|
||||
spark->momz = 5*FRACUNIT;
|
||||
spark->scale = mapobjectscale/5;
|
||||
spark->destscale = mapobjectscale/2;
|
||||
spark->islocal = true;
|
||||
spark->color = SKINCOLOR_WHITE;
|
||||
P_SetTarget(&spark->target, player->mo);
|
||||
}
|
||||
|
||||
player->mo->temprollangle += K_StairJankFlip(ANGLE_11hh / 2 / (17 / player->stairjank)); // TODO: make strength adjustable?
|
||||
}
|
||||
|
||||
|
||||
+2
-28
@@ -2610,36 +2610,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
// sound does not work out all that well for kart maps
|
||||
|
||||
// best i can do...
|
||||
if (cv_stairjanksfx.value)
|
||||
if (cv_stairjank.value && cv_stairjanksfx.value)
|
||||
S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul
|
||||
|
||||
//if (!thing->player->stairjank)
|
||||
{
|
||||
// 90 degrees to direction you're facing
|
||||
fixed_t dirx = -FINESINE(thing->angle>>ANGLETOFINESHIFT);
|
||||
fixed_t diry = FINECOSINE(thing->angle>>ANGLETOFINESHIFT);
|
||||
fixed_t offset = thing->radius;
|
||||
|
||||
if (leveltime % 8 < 4)
|
||||
{
|
||||
dirx = -dirx;
|
||||
diry = -diry;
|
||||
}
|
||||
|
||||
mobj_t * spark = P_SpawnMobj(thing->x + FixedMul(dirx, offset), thing->y + FixedMul(diry, offset), thing->z, MT_DRIFTDUST);
|
||||
spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momx)/10;
|
||||
spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momy)/10;
|
||||
spark->momz = 5*FRACUNIT;
|
||||
spark->scale = mapobjectscale/5;
|
||||
spark->destscale = mapobjectscale/2;
|
||||
spark->islocal = true;
|
||||
//spark->fuse = 9;
|
||||
spark->color = SKINCOLOR_WHITE;
|
||||
//spark->cusval = K_StairJankFlip(ANGLE_90);
|
||||
P_SetTarget(&spark->target, thing);
|
||||
//P_SetTarget(&spark->owner, thing);
|
||||
//spark->renderflags |= RF_REDUCEVFX;
|
||||
}
|
||||
// Can't spawn things during P_TryMove, because global variables :)
|
||||
|
||||
thing->player->stairjank = 9;
|
||||
//thing->player->stairjank = 17;
|
||||
|
||||
@@ -178,8 +178,7 @@ const char *wadSearchPaths[] = {
|
||||
|
||||
/** \brief WAD file to look for
|
||||
*/
|
||||
#define WADKEYWORD1 "srb2.srb"
|
||||
#define WADKEYWORD2 "srb2.wad"
|
||||
#define WADKEYWORD "srb2.srb"
|
||||
/** \brief holds wad path
|
||||
*/
|
||||
static char returnWadPath[256];
|
||||
@@ -561,12 +560,12 @@ void I_OutputMsg(const char *fmt, ...)
|
||||
{
|
||||
size_t len;
|
||||
char *txt;
|
||||
va_list argptr;
|
||||
va_list argptr;
|
||||
|
||||
if (!fmt)
|
||||
return;
|
||||
|
||||
va_start(argptr,fmt);
|
||||
va_start(argptr, fmt);
|
||||
len = vsnprintf(NULL, 0, fmt, argptr);
|
||||
va_end(argptr);
|
||||
if (len == 0)
|
||||
@@ -577,7 +576,7 @@ void I_OutputMsg(const char *fmt, ...)
|
||||
if (!txt)
|
||||
I_Error("I_OutputMsg: Out of memory!\n");
|
||||
|
||||
va_start(argptr,fmt);
|
||||
va_start(argptr, fmt);
|
||||
vsprintf(txt, fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
@@ -2265,7 +2264,6 @@ void I_ShutdownSystem(void)
|
||||
logstream = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void I_GetDiskFreeSpace(INT64 *freespace)
|
||||
@@ -2437,7 +2435,7 @@ static boolean isWadPathOk(const char *path)
|
||||
if (!wad3path)
|
||||
return false;
|
||||
|
||||
sprintf(wad3path, pandf, path, WADKEYWORD1);
|
||||
sprintf(wad3path, pandf, path, WADKEYWORD);
|
||||
|
||||
if (FIL_ReadFileOK(wad3path))
|
||||
{
|
||||
@@ -2477,10 +2475,10 @@ static void pathonly(char *s)
|
||||
*/
|
||||
static const char *searchWad(const char *searchDir)
|
||||
{
|
||||
static char tempsw[255] = "";
|
||||
static char tempsw[256] = "";
|
||||
filestatus_t fstemp;
|
||||
|
||||
strcpy(tempsw, WADKEYWORD1);
|
||||
strcpy(tempsw, WADKEYWORD);
|
||||
fstemp = filesearch(tempsw, searchDir, NULL, true, 20);
|
||||
if (fstemp == FS_FOUND)
|
||||
{
|
||||
|
||||
+12
-11
@@ -972,7 +972,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
||||
// initialized to NULL
|
||||
};
|
||||
|
||||
char freeslotnames[sfx_freeslot0 + NUMSFXFREESLOTS + NUMSKINSFXSLOTS][7] = {};
|
||||
static char freeslotnames[sfx_freeslot0 + NUMSFXFREESLOTS + NUMSKINSFXSLOTS][MAXSOUNDNAME] = {};
|
||||
|
||||
// Prepare free sfx slots to add sfx at run time
|
||||
void S_InitRuntimeSounds(void)
|
||||
@@ -985,16 +985,13 @@ void S_InitRuntimeSounds(void)
|
||||
{
|
||||
value = (i+1) - sfx_freeslot0;
|
||||
|
||||
if (value < 10)
|
||||
sprintf(soundname, "fre00%d", value);
|
||||
else if (value < 100)
|
||||
sprintf(soundname, "fre0%d", value);
|
||||
else if (value < 1000)
|
||||
sprintf(soundname, "fre%d", value);
|
||||
else
|
||||
sprintf(soundname, "fr%d", value);
|
||||
sprintf(soundname, "fr%04x", value);
|
||||
|
||||
strcpy(freeslotnames[value-1], soundname);
|
||||
// this might happen when raising skinlimit
|
||||
I_Assert(strlen(soundname) < MAXSOUNDNAME);
|
||||
|
||||
strncpy(freeslotnames[value-1], soundname, MAXSOUNDNAME-1);
|
||||
freeslotnames[value-1][MAXSOUNDNAME-1] = '\0';
|
||||
|
||||
S_sfx[i].name = freeslotnames[value-1];
|
||||
S_sfx[i].singularity = false;
|
||||
@@ -1024,7 +1021,11 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean
|
||||
{
|
||||
if (!S_sfx[i].priority)
|
||||
{
|
||||
strncpy(freeslotnames[i-sfx_freeslot0], name, 6);
|
||||
I_Assert(strlen(name) < MAXSOUNDNAME);
|
||||
|
||||
strncpy(freeslotnames[i - sfx_freeslot0], name, MAXSOUNDNAME-1);
|
||||
freeslotnames[i - sfx_freeslot0][MAXSOUNDNAME-1] = '\0';
|
||||
|
||||
S_sfx[i].singularity = singular;
|
||||
S_sfx[i].priority = 60;
|
||||
S_sfx[i].pitch = flags;
|
||||
|
||||
@@ -59,6 +59,8 @@ typedef enum
|
||||
#define NUMSFXFREESLOTS 1600 // Matches SOC Editor.
|
||||
#define NUMSKINSFXSLOTS (MAXSKINS*NUMSKINSOUNDS)
|
||||
|
||||
#define MAXSOUNDNAME 7
|
||||
|
||||
//
|
||||
// SoundFX struct.
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user