diff --git a/lib/coopnet/README.md b/lib/coopnet/README.md new file mode 100644 index 00000000..d0d2257e --- /dev/null +++ b/lib/coopnet/README.md @@ -0,0 +1 @@ +Source code for coopnet is available at https://github.com/Isaac0-dev/coopnet diff --git a/lib/coopnet/linux/libcoopnet.a b/lib/coopnet/linux/libcoopnet.a index 5625c083..161180ba 100644 Binary files a/lib/coopnet/linux/libcoopnet.a and b/lib/coopnet/linux/libcoopnet.a differ diff --git a/lib/coopnet/win64/libcoopnet.a b/lib/coopnet/win64/libcoopnet.a index 2362238a..1613bb7c 100644 Binary files a/lib/coopnet/win64/libcoopnet.a and b/lib/coopnet/win64/libcoopnet.a differ diff --git a/src/pc/network/packets/packet_player.c b/src/pc/network/packets/packet_player.c index b1efee43..47168aa2 100644 --- a/src/pc/network/packets/packet_player.c +++ b/src/pc/network/packets/packet_player.c @@ -1,4 +1,5 @@ #include +#include #include "../network.h" #include "object_fields.h" #include "object_constants.h" @@ -244,6 +245,18 @@ void network_receive_player(struct Packet* p) { struct MarioState* m = &gMarioStates[np->localIndex]; if (m == NULL || m->marioObj == NULL) { return; } + if (gNetworkType == NT_SERVER && *((u32*)(p->buffer + p->cursor + offsetof(struct PacketPlayerData, action))) == ACT_DEBUG_FREE_MOVE) { +#ifdef DEVELOPMENT + if (m->action != ACT_DEBUG_FREE_MOVE) { + construct_player_popup(np, DLANG(NOTIF, DEBUG_FLY), NULL); + } +#else + network_send_kick(np->localIndex, EKT_KICKED); + network_player_disconnected(np->localIndex); + return; +#endif + } + // prevent receiving player from other area bool levelAreaMismatch = ((gNetworkPlayerLocal == NULL) || np->currCourseNum != gNetworkPlayerLocal->currCourseNum @@ -395,19 +408,6 @@ void network_receive_player(struct Packet* p) { // Player's position is valid since it's updated and in the same area as the local player np->currPositionValid = true; -#ifndef DEVELOPMENT - if (gNetworkType == NT_SERVER) { - if (m->action == ACT_DEBUG_FREE_MOVE) { - network_send_kick(np->localIndex, EKT_CLOSE_CONNECTION); - network_player_disconnected(np->localIndex); - } - } -#else - if (m->action == ACT_DEBUG_FREE_MOVE && oldData.action != ACT_DEBUG_FREE_MOVE) { - construct_player_popup(np, DLANG(NOTIF, DEBUG_FLY), NULL); - } -#endif - if (np->currLevelNum == LEVEL_BOWSER_3 && m->action == ACT_JUMBO_STAR_CUTSCENE && gMarioStates[0].action != ACT_JUMBO_STAR_CUTSCENE) { set_mario_action((struct MarioState*) &gMarioStates[0], ACT_JUMBO_STAR_CUTSCENE, 0); }