mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-26 22:13:01 +00:00
library update
This commit is contained in:
parent
eb6183e87a
commit
d10e7c758e
4 changed files with 14 additions and 13 deletions
1
lib/coopnet/README.md
Normal file
1
lib/coopnet/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Source code for coopnet is available at https://github.com/Isaac0-dev/coopnet
|
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,5 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include "../network.h"
|
#include "../network.h"
|
||||||
#include "object_fields.h"
|
#include "object_fields.h"
|
||||||
#include "object_constants.h"
|
#include "object_constants.h"
|
||||||
|
@ -244,6 +245,18 @@ void network_receive_player(struct Packet* p) {
|
||||||
struct MarioState* m = &gMarioStates[np->localIndex];
|
struct MarioState* m = &gMarioStates[np->localIndex];
|
||||||
if (m == NULL || m->marioObj == NULL) { return; }
|
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
|
// prevent receiving player from other area
|
||||||
bool levelAreaMismatch = ((gNetworkPlayerLocal == NULL)
|
bool levelAreaMismatch = ((gNetworkPlayerLocal == NULL)
|
||||||
|| np->currCourseNum != gNetworkPlayerLocal->currCourseNum
|
|| 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
|
// Player's position is valid since it's updated and in the same area as the local player
|
||||||
np->currPositionValid = true;
|
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) {
|
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);
|
set_mario_action((struct MarioState*) &gMarioStates[0], ACT_JUMBO_STAR_CUTSCENE, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue