Help! How to hook a method with a parameter of PhotonMessageInfo?

libModz

Platinian On Fire
Hi, this is the method I'm trying to hook...

void OnRequestRespawn(PhotonPlayer, PhotonMessageInfo)

Previously it used to be like this...

void OnRequestRespawn(PhotonPlayer)

I was able to use it fine in the last update no problems, but now they've added this extra parameter and I've no clue what it does or how to use it. Thanks.
 
C++:
struct PhotonMessageInfo
{
    void *player;
    int  timestamp;
    void *view;
};
void (*OnRequestSpawn)(void *instance, void *PhotonPlayer, PhotonMessageInfo Info);
PhotonMessageInfo info = {PhotonPlayer, Num, PhotonView};
 
C++:
struct PhotonMessageInfo
{
    void *player;
    int  timestamp;
    void *view;
};
void (*OnRequestSpawn)(void *instance, void *PhotonPlayer, PhotonMessageInfo Info);
PhotonMessageInfo info = {PhotonPlayer, Num, PhotonView};

Thanks but I'm not sure what the value of "num" needs to be for this to work, unfortunately it's crashing the game
 
This is the code I have but it's just crashing the game. Idk what I'm doing wrong

C++:
void (*old_RoomMaster_Update)(void *instance);
void RoomMaster_Update(void *instance) {
    if(instance!=nullptr) {
        void *photonView = *(void **) ((uint64_t) instance + 0xC);
        if(RespawnAll) {
            if(PhotonNetwork_get_player!=nullptr && PhotonNetwork_get_PlayerList!=nullptr) {
                auto PhotonPlayers = PhotonNetwork_get_PlayerList();
                for (int i = 0; i < PhotonPlayers->getLength(); ++i) {
                    auto PhotonPlayer = PhotonPlayers->getPointer()[i];
                    if(PhotonPlayer!=nullptr) {
                        PhotonMessageInfo info = {PhotonNetwork_get_player(), 3059293, photonView};
                        RoomMaster_OnRequestRespawn(instance, PhotonPlayer, info);
                        RespawnAll=false;
                    }
                }
            }
        }
    }
    old_RoomMaster_Update(instance);
}
 
Снимок экрана 2023-09-24 095313.png
 
Back
Top Bottom