leonardssh / rage-rpc

A universal, asynchronous RPC implementation for RAGE Multiplayer
https://rage.mp
MIT License
12 stars 7 forks source link

PROCEDURE_NOT_FOUND #2

Open mo3g666 opened 2 years ago

mo3g666 commented 2 years ago

Hello, I am using your template in my project and when calling an rpc event in CEF from the server side, a PROCEDURE_NOT_FOUND error occurs.

If I try to call an event from CEF on the server, then the event is called, but the Promise is not returned.

When trying to trigger events and return a Promise from the server to the client and vice versa, everything works fine.

CEF is collected via Vue-CLI

mo3g666 commented 2 years ago

So, I tried to call the callBrowsers function from the client to the browser and got the same error. If I call this function on a specific browser using callBrowser, then everything works fine and promise is returned.

PROCEDURE_NOT_FOUND (TEST_EVENT)
Stack trace: 
         _callBrowsers (index.js:8:8994)
leonardssh commented 2 years ago

Can you provide more reproduction details?

kwert1k887 commented 3 months ago

Good afternoon, I have the same error ts + reaction PROCEDURE_NOT_FOUND (HUD-SetLocation) here is the code on the client:

showLocation(street: string, zone: string, greenZone: boolean) {
        rpc.callBrowsers('HUD-SetLocation', { street, zone, greenZone })
    } 
private update() {
        const { position } = mp.players.local;

        this.street = this.getStreetName(position);
        this.zone = this.getZoneName(position);

        hud.showLocation(this.street, this.zone, greenZone.playerWithin);
    } 

code on the cef react:

import React, { Component } from 'react';
import classNames from 'classnames';
import rpc from 'rage-rpc';

type State = typeof initialState;

const initialState = {
    улица: 'Улица Роуб',
    zone: 'Ла Пуерта',
    greenZone: false,
    position: {
        bottom: 0,
        слева: 0
    }
};

export default class Location extends Component<{}, State> {
    readonly state = initialState;

    componentDidMount() {
        rpc.register('HUD-SetLocation', (data) => this.setState(data));

        this.getDistToMinimap();
        this.getCurrentLocation();
    }

    componentWillUnmount() {
        rpc.unregister('HUD-SetLocation');
    }