Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2Classic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chromaticpipe
SRB2Classic
Compare revisions
next to master
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
chromaticpipe2/srb2classic
Select target project
No results found
master
Select Git revision
Swap
Target
STJr/SRB2
Select target project
STJr/SRB2
Sryder/SRB2
wolfy852/SRB2
Alpha2244/SRB2
Inuyasha/SRB2
yoshibot/SRB2
TehRealSalt/SRB2
PrisimaTF/SRB2
Hatninja/SRB2
SteelT/SRB2
james/SRB2
ShaderWraith/SRB2
SinnamonLat/SRB2
mazmazz_/SRB2
filpAM/SRB2
chaoloveicemdboy/SRB2
Whooa21/SRB2
Machturne/SRB2
Golden/SRB2
Tatsuru/SRB2
Snu/SRB2
Zwip-Zwap_Zapony/SRB2
fickleheart/SRB2
alphaRexJames/SRB2
JJK/SRB2
diskpoppy/SRB2
Hannu_Hanhi/SRB2
ZipperQR/SRB2
kays/SRB2
spherallic/SRB2
Zippy_Zolton/SRB2
namiishere/SRB2
Ors/SRB2
SMS_Alfredo/SRB2
sonic_edge/SRB2
lavla/SRB2
ashi/SRB2
X.organic/SRB2
Fafabis/SRB2
Meziu/SRB2
v-rob/SRB2
tertu/SRB2
bitten2up/SRB2
flarn2006/SRB2
Krabs/SRB2
clairebun/SRB2
Lactozilla/SRB2
thehackstack/SRB2
Spice/SRB2
win8linux/SRB2
JohnFrostFox/SRB2
talktoneon726/SRB2
Wane/SRB2
Lamibe/SRB2
spectrumuk2/srb-2
nerdyminer18/srb-2
256nil/SRB2
ARJr/SRB2
Alam/SRB2
Zenya/srb-2-marathon-demos
Acelite/srb-2-archivedmodifications
MIDIMan/SRB2
Lach/SRB2
Frostiikin/bounce-tweaks
Jaden/SRB2
Tyron/SRB2
Astronight/SRB2
Mari0shi06/SRB2
aiire/SRB2
Galactice/SRB2
srb2-ports/srb2-dreamcast
sdasdas/SRB2
chreas/srb-2-vr
StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
LoganAir/SRB2
NepDisk/srb-2
alufolie91/SRB2
Felicia.iso/SRB2
twi/SRB2
BarrelsOFun/SRB2
Speed2411/SRB2
Leather_Realms/SRB2
Ayemar/SRB2
Acelite/SRB2
VladDoc/SRB2
kaldrum/model-features
strawberryfox417/SRB2
Lugent/SRB2
Rem/SRB2
Refrag/SRB2
Henry_3230/srb-3230
TehPuertoRicanSpartan2/tprs-srb2
Leminn/srb-2-marathon-stuff
chromaticpipe2/SRB2
MiguelGustavo15/SRB2
Maru/srb-2-tests
SilicDev/SRB2
UnmatchedBracket/SRB2
HybridDog/SRB2
xordspar0/SRB2
jsjhbewfhh/SRB2
Fancy2209/SRB2
Lorsoen/SRB2
shindoukin/SRB2
GamerOfDays/SRB2
Craftyawesome/SRB2
tenshi-tensai-tennoji/SRB2
Scarfdudebalder/SRB2
luigi-budd/srb-2-fix-interplag-lockon
mskluesner/SRB2
johnpetersa19/SRB2
Pheazant/SRB2
chromaticpipe2/srb2classic
romoney5/SRB2
PAS/SRB2Classic
BlueStaggo/SRB2
Jisk/srb-2-beef-jerky
117 results
next
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (7)
Clean up d_net.c and push back missed acks to acktosend
· c5d0693d
Hanicef
authored
5 months ago
c5d0693d
Clear acktosend when initializing node
· d083a8d4
Hanicef
authored
5 months ago
d083a8d4
Remove acktosend
· 99574431
Hanicef
authored
5 months ago
99574431
Fix short freeze when disconnecting from a server
· bfb9bf44
Hanicef
authored
5 months ago
bfb9bf44
Fix freeslots + add DeltaSanic to the credits
· 5266d871
Radicalicious
authored
5 months ago
and
Hanicef
committed
5 months ago
5266d871
Hide shield overlays and not just the shield while shieldscale zero
· afc76b57
candelavla
authored
5 months ago
and
Hanicef
committed
5 months ago
afc76b57
Fix crash when listing servers in the MS
· 61340986
Hanicef
authored
5 months ago
61340986
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/deh_tables.c
+8
-0
8 additions, 0 deletions
src/deh_tables.c
src/f_finale.c
+1
-0
1 addition, 0 deletions
src/f_finale.c
src/netcode/d_net.c
+31
-208
31 additions, 208 deletions
src/netcode/d_net.c
src/netcode/d_net.h
+0
-1
0 additions, 1 deletion
src/netcode/d_net.h
src/p_mobj.c
+8
-2
8 additions, 2 deletions
src/p_mobj.c
with
48 additions
and
211 deletions
src/deh_tables.c
View file @
61340986
...
...
@@ -3687,6 +3687,12 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_MARIOBRICKDEBRISM"
,
"S_NAMECHECK"
,
// LJ Knuckles
"S_OLDK_STND"
,
"S_OLDK_DIE0"
,
"S_OLDK_DIE1"
,
"S_OLDK_DIE2"
,
};
// RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1",
...
...
@@ -4511,6 +4517,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_NAMECHECK"
,
"MT_RAY"
,
"MT_OLDK"
,
};
const
char
*
const
MOBJFLAG_LIST
[]
=
{
...
...
This diff is collapsed.
Click to expand it.
src/f_finale.c
View file @
61340986
...
...
@@ -1105,6 +1105,7 @@ static const char *credits[] = {
"Paul
\"
Boinciel
\"
Clempson"
,
"Sally
\"
TehRealSalt
\"
Cochenour"
,
"
\"
DaJumpJump
\"
"
,
// New Ringslinger graphics (2.2.14)
"
\"
DeltaSanic
\"
"
,
"Desmond
\"
Blade
\"
DesJardins"
,
"Sherman
\"
CoatRack
\"
DesJardins"
,
"
\"
DirkTheHusky
\"
"
,
...
...
This diff is collapsed.
Click to expand it.
src/netcode/d_net.c
View file @
61340986
...
...
@@ -163,12 +163,6 @@ typedef struct
// ack return to send (like sliding window protocol)
UINT8
firstacktosend
;
// when no consecutive packets are received we keep in mind what packets
// we already received in a queue
UINT8
acktosend_head
;
UINT8
acktosend_tail
;
UINT8
acktosend
[
MAXACKTOSEND
];
// automatically send keep alive packet when not enough trafic
tic_t
lasttimeacktosend_sent
;
// detect connection lost
...
...
@@ -200,10 +194,9 @@ FUNCMATH static INT32 cmpack(UINT8 a, UINT8 b)
/** Sets freeack to a free acknum and copies the netbuffer in the ackpak table
*
* \param freeack The address to store the free acknum at
* \param lowtimer ???
* \return True if a free acknum was found
*/
static
boolean
GetFreeAcknum
(
UINT8
*
freeack
,
boolean
lowtimer
)
static
boolean
GetFreeAcknum
(
UINT8
*
freeack
)
{
node_t
*
node
=
&
nodes
[
doomcom
->
remotenode
];
INT32
numfreeslot
=
0
;
...
...
@@ -232,17 +225,8 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
node
->
nextacknum
++
;
ackpak
[
i
].
destinationnode
=
(
UINT8
)(
node
-
nodes
);
ackpak
[
i
].
length
=
doomcom
->
datalength
;
if
(
lowtimer
)
{
// Lowtime means can't be sent now so try it as soon as possible
ackpak
[
i
].
senttime
=
0
;
ackpak
[
i
].
resentnum
=
1
;
}
else
{
ackpak
[
i
].
senttime
=
I_GetTime
();
ackpak
[
i
].
resentnum
=
0
;
}
ackpak
[
i
].
senttime
=
I_GetTime
();
ackpak
[
i
].
resentnum
=
0
;
M_Memcpy
(
ackpak
[
i
].
pak
.
raw
,
netbuffer
,
ackpak
[
i
].
length
);
*
freeack
=
ackpak
[
i
].
acknum
;
...
...
@@ -259,38 +243,6 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
return
false
;
}
/** Counts how many acks are free
*
* \param urgent True if the type of the packet meant to
* use an ack is lower than PT_CANFAIL
* If for some reason you don't want use it
* for any packet type in particular,
* just set to false
* \return The number of free acks
*
*/
INT32
Net_GetFreeAcks
(
boolean
urgent
)
{
INT32
numfreeslot
=
0
;
INT32
n
=
0
;
// Number of free acks found
for
(
INT32
i
=
0
;
i
<
MAXACKPACKETS
;
i
++
)
if
(
!
ackpak
[
i
].
acknum
)
{
// For low priority packets, make sure to let freeslots so urgent packets can be sent
if
(
!
urgent
)
{
numfreeslot
++
;
if
(
numfreeslot
<=
URGENTFREESLOTNUM
)
continue
;
}
n
++
;
}
return
n
;
}
// Get a ack to send in the queue of this node
static
UINT8
GetAcktosend
(
INT32
node
)
{
...
...
@@ -308,9 +260,9 @@ static void RemoveAck(INT32 i)
}
// We have got a packet, proceed the ack request and ack return
static
int
Processackpak
(
void
)
static
boolean
Processackpak
(
void
)
{
int
goodpacket
=
0
;
boolean
goodpacket
=
true
;
node_t
*
node
=
&
nodes
[
doomcom
->
remotenode
];
// Received an ack return, so remove the ack in the list
...
...
@@ -319,7 +271,7 @@ static int Processackpak(void)
node
->
remotefirstack
=
netbuffer
->
ackreturn
;
// Search the ackbuffer and free it
for
(
INT32
i
=
0
;
i
<
MAXACKPACKETS
;
i
++
)
if
(
ackpak
[
i
].
acknum
&&
ackpak
[
i
].
destinationnode
==
node
-
node
s
if
(
ackpak
[
i
].
acknum
&&
ackpak
[
i
].
destinationnode
==
doomcom
->
remote
node
&&
cmpack
(
ackpak
[
i
].
acknum
,
netbuffer
->
ackreturn
)
<=
0
)
{
RemoveAck
(
i
);
...
...
@@ -335,119 +287,32 @@ static int Processackpak(void)
{
DEBFILE
(
va
(
"Discard(1) ack %d (duplicated)
\n
"
,
ack
));
duppacket
++
;
goodpacket
=
1
;
// Discard packet (duplicate)
goodpacket
=
false
;
// Discard packet (duplicate)
}
else
{
// Check if it is not already in the queue
for
(
INT32
i
=
node
->
acktosend_tail
;
i
!=
node
->
acktosend_head
;
i
=
(
i
+
1
)
%
MAXACKTOSEND
)
if
(
node
->
acktosend
[
i
]
==
ack
)
{
DEBFILE
(
va
(
"Discard(2) ack %d (duplicated)
\n
"
,
ack
));
duppacket
++
;
goodpacket
=
1
;
// Discard packet (duplicate)
break
;
}
if
(
goodpacket
==
0
)
// Is a good packet so increment the acknowledge number,
// Then search for a "hole" in the queue
UINT8
nextfirstack
=
(
UINT8
)(
node
->
firstacktosend
+
1
);
if
(
!
nextfirstack
)
nextfirstack
=
1
;
if
(
ack
==
nextfirstack
)
{
node
->
firstacktosend
=
nextfirstack
;
}
else
// Out of order packet
{
// Is a good packet so increment the acknowledge number,
// Then search for a "hole" in the queue
UINT8
nextfirstack
=
(
UINT8
)(
node
->
firstacktosend
+
1
);
if
(
!
nextfirstack
)
nextfirstack
=
1
;
if
(
ack
==
nextfirstack
)
{
UINT8
hm1
;
// head - 1
boolean
change
=
true
;
node
->
firstacktosend
=
nextfirstack
++
;
if
(
!
nextfirstack
)
nextfirstack
=
1
;
hm1
=
(
UINT8
)((
node
->
acktosend_head
-
1
+
MAXACKTOSEND
)
%
MAXACKTOSEND
);
while
(
change
)
{
change
=
false
;
for
(
INT32
i
=
node
->
acktosend_tail
;
i
!=
node
->
acktosend_head
;
i
=
(
i
+
1
)
%
MAXACKTOSEND
)
{
if
(
cmpack
(
node
->
acktosend
[
i
],
nextfirstack
)
<=
0
)
{
if
(
node
->
acktosend
[
i
]
==
nextfirstack
)
{
node
->
firstacktosend
=
nextfirstack
++
;
if
(
!
nextfirstack
)
nextfirstack
=
1
;
change
=
true
;
}
if
(
i
==
node
->
acktosend_tail
)
{
node
->
acktosend
[
node
->
acktosend_tail
]
=
0
;
node
->
acktosend_tail
=
(
UINT8
)((
i
+
1
)
%
MAXACKTOSEND
);
}
else
if
(
i
==
hm1
)
{
node
->
acktosend
[
hm1
]
=
0
;
node
->
acktosend_head
=
hm1
;
hm1
=
(
UINT8
)((
hm1
-
1
+
MAXACKTOSEND
)
%
MAXACKTOSEND
);
}
}
}
}
}
else
// Out of order packet
{
// Don't increment firsacktosend, put it in asktosend queue
// Will be incremented when the nextfirstack comes (code above)
UINT8
newhead
=
(
UINT8
)((
node
->
acktosend_head
+
1
)
%
MAXACKTOSEND
);
DEBFILE
(
va
(
"out of order packet (%d expected)
\n
"
,
nextfirstack
));
if
(
newhead
!=
node
->
acktosend_tail
)
{
node
->
acktosend
[
node
->
acktosend_head
]
=
ack
;
node
->
acktosend_head
=
newhead
;
}
else
// Buffer full discard packet, sender will resend it
{
// We can admit the packet but we will not detect the duplication after :(
DEBFILE
(
"no more freeackret
\n
"
);
goodpacket
=
2
;
}
}
// Don't increment firsacktosend, put it in asktosend queue
// Will be incremented when the nextfirstack comes (code above)
DEBFILE
(
va
(
"out of order packet (%d expected)
\n
"
,
nextfirstack
));
goodpacket
=
false
;
}
}
}
// return values: 0 = ok, 1 = duplicate, 2 = out of order
return
goodpacket
;
}
// send special packet with only ack on it
void
Net_SendAcks
(
INT32
node
)
{
netbuffer
->
packettype
=
PT_NOTHING
;
M_Memcpy
(
netbuffer
->
u
.
textcmd
,
nodes
[
node
].
acktosend
,
MAXACKTOSEND
);
HSendPacket
(
node
,
false
,
0
,
MAXACKTOSEND
);
}
static
void
GotAcks
(
void
)
{
for
(
INT32
j
=
0
;
j
<
MAXACKTOSEND
;
j
++
)
if
(
netbuffer
->
u
.
textcmd
[
j
])
for
(
INT32
i
=
0
;
i
<
MAXACKPACKETS
;
i
++
)
if
(
ackpak
[
i
].
acknum
&&
ackpak
[
i
].
destinationnode
==
doomcom
->
remotenode
)
{
if
(
ackpak
[
i
].
acknum
==
netbuffer
->
u
.
textcmd
[
j
])
RemoveAck
(
i
);
// nextacknum is first equal to acknum, then when receiving bigger ack
// there is big chance the packet is lost
// When resent, nextacknum = nodes[node].nextacknum
// will redo the same but with different value
else
if
(
cmpack
(
ackpak
[
i
].
nextacknum
,
netbuffer
->
u
.
textcmd
[
j
])
<=
0
&&
ackpak
[
i
].
senttime
>
0
)
{
ackpak
[
i
].
senttime
--
;
// hurry up
}
}
}
void
Net_ConnectionTimeout
(
INT32
node
)
{
// Don't timeout several times
...
...
@@ -501,11 +366,6 @@ void Net_AckTicker(void)
// This is something like node open flag
if
(
nodes
[
i
].
firstacktosend
)
{
// We haven't sent a packet for a long time
// Acknowledge packet if needed
if
(
nodes
[
i
].
lasttimeacktosend_sent
+
ACKTOSENDTIMEOUT
<
I_GetTime
())
Net_SendAcks
(
i
);
if
(
!
(
nodes
[
i
].
flags
&
NF_CLOSE
)
&&
nodes
[
i
].
lasttimepacketreceived
+
connectiontimeout
<
I_GetTime
())
{
...
...
@@ -519,37 +379,12 @@ void Net_AckTicker(void)
// (the higher layer doesn't have room, or something else ....)
void
Net_UnAcknowledgePacket
(
INT32
node
)
{
INT32
hm1
=
(
nodes
[
node
].
acktosend_head
-
1
+
MAXACKTOSEND
)
%
MAXACKTOSEND
;
DEBFILE
(
va
(
"UnAcknowledge node %d
\n
"
,
node
));
if
(
!
node
)
return
;
if
(
nodes
[
node
].
acktosend
[
hm1
]
==
netbuffer
->
ack
)
{
nodes
[
node
].
acktosend
[
hm1
]
=
0
;
nodes
[
node
].
acktosend_head
=
(
UINT8
)
hm1
;
}
else
if
(
nodes
[
node
].
firstacktosend
==
netbuffer
->
ack
)
{
nodes
[
node
].
firstacktosend
--
;
if
(
!
nodes
[
node
].
firstacktosend
)
nodes
[
node
].
firstacktosend
=
UINT8_MAX
;
}
else
{
while
(
nodes
[
node
].
firstacktosend
!=
netbuffer
->
ack
)
{
nodes
[
node
].
acktosend_tail
=
(
UINT8
)
((
nodes
[
node
].
acktosend_tail
-
1
+
MAXACKTOSEND
)
%
MAXACKTOSEND
);
nodes
[
node
].
acktosend
[
nodes
[
node
].
acktosend_tail
]
=
nodes
[
node
].
firstacktosend
;
nodes
[
node
].
firstacktosend
--
;
if
(
!
nodes
[
node
].
firstacktosend
)
nodes
[
node
].
firstacktosend
=
UINT8_MAX
;
}
nodes
[
node
].
firstacktosend
++
;
if
(
!
nodes
[
node
].
firstacktosend
)
nodes
[
node
].
firstacktosend
=
1
;
}
nodes
[
node
].
firstacktosend
--
;
if
(
!
nodes
[
node
].
firstacktosend
)
nodes
[
node
].
firstacktosend
=
UINT8_MAX
;
}
/** Checks if all acks have been received
...
...
@@ -592,7 +427,6 @@ void Net_WaitAllAckReceived(UINT32 timeout)
static
void
InitNode
(
node_t
*
node
)
{
node
->
acktosend_head
=
node
->
acktosend_tail
=
0
;
node
->
firstacktosend
=
0
;
node
->
nextacknum
=
1
;
node
->
remotefirstack
=
0
;
...
...
@@ -651,11 +485,11 @@ void Net_CloseConnection(INT32 node)
nodes
[
node
].
flags
|=
NF_CLOSE
;
// try to Send ack back (two army problem)
if
(
GetAcktosend
(
node
))
if
(
nodes
[
node
].
firstacktosend
)
{
Net_SendAcks
(
node
);
Net_SendAcks
(
node
);
// send a PT_NOTHING back to acknowledge the packet
netbuffer
->
packettype
=
PT_NOTHING
;
HSendPacket
(
node
,
false
,
0
,
0
);
}
// check if we are waiting for an ack from this node
...
...
@@ -991,7 +825,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
netbuffer
->
ackreturn
=
0
;
if
(
reliable
)
{
if
(
!
GetFreeAcknum
(
&
netbuffer
->
ack
,
false
))
if
(
!
GetFreeAcknum
(
&
netbuffer
->
ack
))
return
false
;
}
else
...
...
@@ -1057,7 +891,6 @@ boolean HGetPacket(void)
while
(
true
)
{
//nodejustjoined = I_NetGet();
int
goodpacket
;
I_NetGet
();
if
(
doomcom
->
remotenode
==
-
1
)
// No packet received
...
...
@@ -1103,22 +936,12 @@ boolean HGetPacket(void)
}*/
// Proceed the ack and ackreturn field
goodpacket
=
Processackpak
();
if
(
goodpacket
!=
0
)
{
// resend the ACK in case the previous ACK didn't reach the client.
// prevents the client's netbuffer from locking up.
if
(
goodpacket
==
1
)
Net_SendAcks
(
doomcom
->
remotenode
);
if
(
!
Processackpak
())
continue
;
// discarded (duplicated)
}
// A packet with just ackreturn
if
(
netbuffer
->
packettype
==
PT_NOTHING
)
{
GotAcks
();
continue
;
}
break
;
}
...
...
This diff is collapsed.
Click to expand it.
src/netcode/d_net.h
View file @
61340986
...
...
@@ -60,7 +60,6 @@ extern netnode_t netnodes[MAXNETNODES];
extern
boolean
serverrunning
;
INT32
Net_GetFreeAcks
(
boolean
urgent
);
void
Net_AckTicker
(
void
);
// If reliable return true if packet sent, 0 else
...
...
This diff is collapsed.
Click to expand it.
src/p_mobj.c
View file @
61340986
...
...
@@ -6660,12 +6660,12 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
if (scale < 1) {
P_SetScale(thing, thing->target->scale, true);
thing->old_scale = thing->target->old_scale;
thing->flags2 |= (MF2_DONTDRAW|MF2_JUSTATTACKED); //Hide and indicate we're hidden
} else {
P_SetScale(thing, scale, true);
thing->old_scale = FixedMul(thing->target->old_scale, thing->target->player->shieldscale);
//Only unhide if we were hidden by the above code
if (thing->flags2 & MF2_JUSTATTACKED)
thing->flags2 &= ~(MF2_DONTDRAW|MF2_JUSTATTACKED);
...
...
@@ -6794,6 +6794,12 @@ void P_RunOverlays(void)
else
zoffs = 0;
// hide the overlay as well if we're part of a hidden shield
if ((mo->target->flags2 & (MF2_JUSTATTACKED|MF2_DONTDRAW)) == (MF2_JUSTATTACKED|MF2_DONTDRAW))
mo->flags2 |= (MF2_DONTDRAW|MF2_JUSTATTACKED);
else if (mo->flags2 & MF2_JUSTATTACKED)
mo->flags2 &= ~(MF2_DONTDRAW|MF2_JUSTATTACKED);
P_UnsetThingPosition(mo);
mo->x = mo->target->x;
mo->y = mo->target->y;
...
...
This diff is collapsed.
Click to expand it.