Compare commits

..
Author SHA1 Message Date
alufolie91 0da78ae3d1 Merge branch 'Saturn-Next' into retrySOCK 2026-11-19 15:46:21 +01:00
alufolie91 f029a2b7d8 Merge branch 'Saturn-Next' into retrySOCK 2026-11-12 20:54:24 +01:00
alufolie91 32bd5a02ec fix some smol style gripes in lua mobj and player lib 2026-11-12 20:46:01 +01:00
alufolie91 9a100439df Merge branch 'Saturn-Next' into retrySOCK 2026-11-05 15:40:28 +01:00
alufolie91 3b37f85024 Merge branch 'Saturn-Next' into retrySOCK 2026-10-16 15:24:18 +02:00
alufolie91 27a65ef973 Merge branch 'Saturn-Next' into retrySOCK 2026-09-27 17:54:06 +02:00
alufolie91 ffa9b2fa9a Merge branch 'Saturn-Next' into retrySOCK 2026-09-23 19:41:27 +02:00
alufolie91 ab9e0f923e Merge branch 'Saturn-Next' into retrySOCK 2026-09-18 18:31:42 +02:00
alufolie91 8bf3953b4a Merge branch 'Saturn-Next' into retrySOCK 2026-09-07 19:30:21 +02:00
alufolie91 44ef42cf84 start retry attempt prints from 1 not 0 2026-08-24 14:02:47 +02:00
alufolie91 746035bfea add missing line breaks to sock_send prints 2026-08-24 14:01:00 +02:00
alufolie91 70bc9879b3 Merge branch 'Saturn-Next' into retrySOCK 2026-08-24 13:57:25 +02:00
alufolie91 0e6a794a84 Merge branch 'Saturn-Next' into retrySOCK 2026-08-21 16:24:10 +02:00
alufolie91 4eccf40a0a Merge branch 'Saturn-Next' into retrySOCK 2026-08-07 16:38:50 +02:00
alufolie91 e3fd46297a Merge branch 'Saturn-Next' into retrySOCK 2026-08-01 16:29:40 +02:00
alufolie91 4c2e119385 Merge branch 'Saturn-Next' into retrySOCK 2026-07-24 16:22:36 +02:00
alufolie91 229a6a161e Merge branch 'Saturn-Next' into retrySOCK 2026-07-21 16:11:43 +02:00
alufolie91 1b2e4a1acc Merge branch 'Saturn-Next' into retrySOCK 2026-07-20 16:45:09 +02:00
alufolie91 2e6d49fcd6 Merge remote-tracking branch 'origin/Saturn-Next' into retrySOCK 2026-07-20 11:47:57 +02:00
alufolie91 7a8c66781b Merge branch 'Saturn-Next' into retrySOCK 2026-07-10 20:10:39 +02:00
alufolie91 c877226bfe Merge branch 'Saturn-Next' into retrySOCK 2026-07-08 18:57:24 +02:00
alufolie91 ac3c8b1d25 Merge branch 'Saturn-Next' into retrySOCK 2026-07-02 21:27:14 +02:00
alufolie91 feeba45b0d Merge branch 'Saturn-Next' into retrySOCK 2026-06-29 17:28:41 +02:00
alufolie91 06f3d2c91b Merge branch 'Saturn-Next' into retrySOCK 2026-06-28 22:58:25 +02:00
alufolie91 332fadc823 Merge branch 'Saturn-Next' into retrySOCK 2026-06-28 19:17:09 +02:00
alufolie91 39dc1b85e3 Merge branch 'Saturn-Next' into retrySOCK 2026-06-28 16:28:33 +02:00
alufolie91 5b2413444f Merge branch 'Saturn-Next' into retrySOCK 2026-06-27 18:53:02 +02:00
alufolie91 7855b2ed95 Merge branch 'Saturn-Next' into retrySOCK 2026-06-22 21:14:19 +02:00
alufolie91 caebe62ddb Merge branch 'Saturn-Next' into retrySOCK 2026-06-15 17:14:08 +02:00
alufolie91 9de285caac use sizeu1 instead of %lu
windoze.......
2026-06-13 13:41:00 +02:00
alufolie91 9bb4420ad3 Merge branch 'Saturn-Next' into retrySOCK 2026-06-13 13:37:44 +02:00
alufolie91 8dc3d870a1 Merge branch 'Saturn-Next' into retrySOCK 2026-06-12 22:08:53 +02:00
alufolie91 158546bd73 Merge remote-tracking branch 'origin/Saturn-Next' into retrySOCK 2026-06-12 21:21:33 +02:00
alufolie91 b89a3f1017 Merge branch 'Saturn-Next' into retrySOCK 2026-06-08 16:58:06 +02:00
alufolie91 f2e355a5a8 SOCK_Send: retry failed connections
very sketchy since idk networking for shit
but seems to work so far?
2026-06-05 13:21:26 +02:00
4 changed files with 57 additions and 107 deletions

No files matched your search

+20 -96
View File
@@ -350,8 +350,6 @@ static void D_Renderview(void)
// added comment : there is a wipe eatch change of the gamestate
gamestate_t wipegamestate = GS_LEVEL;
static void D_LimitFps(void);
static void D_MakeIntermissionBG(void)
{
if (!lastdraw)
@@ -647,10 +645,6 @@ static boolean D_Display(void)
CON_Drawer(); // Ha, i LIED!
// be sure to limit our fps *before* drawing
// so we can properly "pace" our frames
D_LimitFps();
if (cv_lua_profile.value > 0)
{
LUA_RenderTimers();
@@ -664,78 +658,6 @@ static boolean D_Display(void)
return ranwipe;
}
static precise_t sleeptime = 0;
static boolean D_UseNewFramelimiter(void)
{
//if (!cv_newframelimiter.value) return false;
return (rendermode != render_none && !dedicated && (R_GetFramerateCap() >= 45) && R_UsingFrameInterpolation());
}
static void D_LimitFps(void)
{
precise_t curtime, start;
static precise_t lasttime = 0;
// timedemo runs uncapped!
if (singletics)
return;
if (!D_UseNewFramelimiter())
return;
const UINT32 framecap = R_GetFramerateCap();
// uncapped obviously does not need to be... capped...
if (framecap == 0)
return;
// dont need to sleep if we vsync and our framecap is set to refresh rate or higher
if (cv_vidwait.value && (cv_fpscap.value == 0 || framecap > I_GetRefreshRate()))
return;
start = I_GetPreciseTime();
const UINT64 precision = I_GetPrecisePrecision();
// frametarget in precise_t ticks (ex. 60fps = ~16,666,666)
const precise_t frametarget = precision / framecap;
lasttime += frametarget;
// just sync this up if we missed the target
if ((INT64)(start - lasttime) >= 0)
lasttime = start;
while (1)
{
// check the current time against the "time of the old frame"
curtime = I_GetPreciseTime();
// done waiting!
// continue as normal
if ((INT64)(curtime - lasttime) >= 0)
{
// time we spent :chaosleep:ing or doing absolutely nothing
// for frameskip calculations
sleeptime = curtime - start;
return;
}
// if we have more than 1ms to wait
// sleep for a bit to not trash the cpu lul
precise_t remaining = lasttime - curtime;
if (remaining > (precise_t)(precision / 1000))
{
// sleep for 90% of the time we gotta wait for the next frame
// since we dont wanna oversleep :chaosleep:
I_SleepDuration(9 * remaining / 10);
}
}
// the rest we just be waitin until we meet our frametime target
}
// =========================================================================
// D_SRB2Loop
// =========================================================================
@@ -787,13 +709,13 @@ void D_SRB2Loop(void)
for (;;)
{
// capbudget is the minimum precise_t duration of a single loop iteration
precise_t capbudget;
precise_t elapsed;
precise_t enterprecise, finishprecise;
boolean ranwipe = false;
sleeptime = 0;
enterprecise = I_GetPreciseTime();
I_HandleInterrupt();
@@ -801,6 +723,10 @@ void D_SRB2Loop(void)
memset(&g_dc, 0, sizeof(g_dc));
Z_Frame_Reset();
// Casting the return value of a function is bad practice (apparently)
const UINT32 framecap = R_GetFramerateCap();
capbudget = (framecap == 0) ? 0 : (precise_t)((double)precision / (double)framecap + 0.5); // + 0.5 instead of round
I_UpdateTime(cv_timescale.value);
if (lastwipetic)
@@ -821,9 +747,11 @@ void D_SRB2Loop(void)
}
#ifdef DEBUGFILE
if (!realtics && debugload)
debugload--;
if (!realtics)
if (debugload)
debugload--;
#endif
interp = !dedicated && R_UsingFrameInterpolation();
doDisplay = false;
@@ -857,7 +785,6 @@ void D_SRB2Loop(void)
{
P_RunChaseCameras();
}
R_UpdateViewInterpolation();
}
@@ -903,6 +830,7 @@ void D_SRB2Loop(void)
M_SaveFrame();
if (takescreenshot)
M_DoScreenShot();
#ifndef DEDICATED
if (!dedicated && renderisnewtic)
{
@@ -924,9 +852,9 @@ void D_SRB2Loop(void)
// Fully completed frame made.
finishprecise = I_GetPreciseTime();
// Use the time without sleep for frameskip calculations:
// Use the time before sleep for frameskip calculations:
// post-sleep time is literally being intentionally wasted
elapsed = (finishprecise - enterprecise) - sleeptime;
elapsed = finishprecise - enterprecise;
deltasecs = (double)elapsed / (double)precision;
deltatics = deltasecs * (double)NEWTICRATE;
@@ -954,12 +882,8 @@ void D_SRB2Loop(void)
frameskip = 0;
}
// old fps limiter
if (!singletics && !D_UseNewFramelimiter())
if (!singletics)
{
const UINT32 framecap = R_GetFramerateCap();
const precise_t capbudget = (framecap == 0) ? 0 : (precise_t)((double)precision / (double)framecap + 0.5); // + 0.5 instead of round
// in the case of "match refresh rate" + vsync, don't sleep at all
const boolean vsync_with_match_refresh = cv_vidwait.value && cv_fpscap.value == 0;
@@ -967,13 +891,13 @@ void D_SRB2Loop(void)
{
I_SleepDuration(capbudget - elapsed);
}
// Capture the time once more to get the real delta time.
finishprecise = I_GetPreciseTime();
elapsed = finishprecise - enterprecise;
deltasecs = (double)elapsed / (double)precision;
deltatics = deltasecs * (double)NEWTICRATE;
}
// Capture the time once more to get the real delta time.
finishprecise = I_GetPreciseTime();
elapsed = finishprecise - enterprecise;
deltasecs = (double)elapsed / (double)precision;
deltatics = deltasecs * (double)NEWTICRATE;
}
}
+34 -4
View File
@@ -752,9 +752,14 @@ static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr
static void SOCK_Send(void)
{
ssize_t c = ERRSOCKET;
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
size_t i, j;
int retrycount = 0;
ssize_t c;
int e; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
retry:
c = ERRSOCKET;
e = 0;
if (doomcom->remotenode < 0 || !nodeconnected[doomcom->remotenode])
return;
@@ -808,10 +813,35 @@ static void SOCK_Send(void)
if (c == ERRSOCKET && e != 0) // 0 means no socket for the address family was found
{
if (!ALLOWEDERROR(e))
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
if (ALLOWEDERROR(e))
return;
//if (!ALLOWEDERROR(e))
//I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
//SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
// no need to spam this on retries
if (retrycount == 0)
CONS_Alert(CONS_ERROR, "SOCK_Send, error sending to node %d (%s) #%u, %s\n", doomcom->remotenode,
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
// retry sending it
if (retrycount <= 3)
{
CONS_Printf("SOCK_Send: retrying... Attempt %d\n", retrycount+1);
retrycount++;
// wait quarter of a second or smth
I_Sleep(250);
goto retry;
}
// no recovery, guess we die
I_Error("SOCK_Send, error sending to node %d (%s) #%u, %s", doomcom->remotenode,
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
}
if (retrycount > 0)
CONS_Alert(CONS_NOTICE, "SOCK_Send: successfully reconnected on Attempt %d\n", retrycount);
}
#undef ALLOWEDERROR
+1 -5
View File
@@ -217,11 +217,7 @@ static int mobj_get(lua_State *L)
case mobj_skin: // skin name or nil, not struct
if (!mo->skin)
return 0;
// HUD ONLY!!!!!!!!!!
if (hud_running && cv_luaimmersion.value)
lua_pushstring(L, K_GetMobjSkin(mo)->name);
else
lua_pushstring(L, ((skin_t *)mo->skin)->name);
lua_pushstring(L, ((skin_t *)mo->skin)->name);
break;
case mobj_color:
lua_pushinteger(L, mo->color);
+2 -2
View File
@@ -262,9 +262,9 @@ void OglSdlFinishUpdate(SDL_Window *window)
// Sryder: We need to draw the final screen texture again into the other buffer in the original position so that
// effects that want to take the old screen can do so after this
#ifdef USE_FBO_OGL
if (!usefbo && (realwidth != sdlw || realheight != sdlh || WipeInAction)) // not needed if fbo is in use
if (!usefbo && (realwidth != sdlw || realheight != sdlh)) // not needed if fbo is in use
#else
if (realwidth != sdlw || realheight != sdlh || WipeInAction) // this is not needed if the render size matches window size
if (realwidth != sdlw || realheight != sdlh) // this is not needed if the render size matches window size
#endif
HWR_DrawScreenFinalTexture(realwidth, realheight);
}