Skip to content

Commit d10e7c7

Browse files
committed
library update
1 parent eb6183e commit d10e7c7

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

lib/coopnet/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Source code for coopnet is available at https://github.com/Isaac0-dev/coopnet

lib/coopnet/linux/libcoopnet.a

44.5 KB
Binary file not shown.

lib/coopnet/win64/libcoopnet.a

237 KB
Binary file not shown.

src/pc/network/packets/packet_player.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include <stddef.h>
23
#include "../network.h"
34
#include "object_fields.h"
45
#include "object_constants.h"
@@ -244,6 +245,18 @@ void network_receive_player(struct Packet* p) {
244245
struct MarioState* m = &gMarioStates[np->localIndex];
245246
if (m == NULL || m->marioObj == NULL) { return; }
246247

248+
if (gNetworkType == NT_SERVER && *((u32*)(p->buffer + p->cursor + offsetof(struct PacketPlayerData, action))) == ACT_DEBUG_FREE_MOVE) {
249+
#ifdef DEVELOPMENT
250+
if (m->action != ACT_DEBUG_FREE_MOVE) {
251+
construct_player_popup(np, DLANG(NOTIF, DEBUG_FLY), NULL);
252+
}
253+
#else
254+
network_send_kick(np->localIndex, EKT_KICKED);
255+
network_player_disconnected(np->localIndex);
256+
return;
257+
#endif
258+
}
259+
247260
// prevent receiving player from other area
248261
bool levelAreaMismatch = ((gNetworkPlayerLocal == NULL)
249262
|| np->currCourseNum != gNetworkPlayerLocal->currCourseNum
@@ -395,19 +408,6 @@ void network_receive_player(struct Packet* p) {
395408
// Player's position is valid since it's updated and in the same area as the local player
396409
np->currPositionValid = true;
397410

398-
#ifndef DEVELOPMENT
399-
if (gNetworkType == NT_SERVER) {
400-
if (m->action == ACT_DEBUG_FREE_MOVE) {
401-
network_send_kick(np->localIndex, EKT_CLOSE_CONNECTION);
402-
network_player_disconnected(np->localIndex);
403-
}
404-
}
405-
#else
406-
if (m->action == ACT_DEBUG_FREE_MOVE && oldData.action != ACT_DEBUG_FREE_MOVE) {
407-
construct_player_popup(np, DLANG(NOTIF, DEBUG_FLY), NULL);
408-
}
409-
#endif
410-
411411
if (np->currLevelNum == LEVEL_BOWSER_3 && m->action == ACT_JUMBO_STAR_CUTSCENE && gMarioStates[0].action != ACT_JUMBO_STAR_CUTSCENE) {
412412
set_mario_action((struct MarioState*) &gMarioStates[0], ACT_JUMBO_STAR_CUTSCENE, 0);
413413
}

0 commit comments

Comments
 (0)