Git Product home page Git Product logo

rage-rpc's Issues

PlayerMp & BrowserMp is not assignable

Current Behavior:

At the moment, properties from ProcedureListenerInfo cannot be used in the rage environment because they are hardcoded and do not have all the required properties and methods.

https://github.com/LeonardSSH/rage-rpc/blob/928742602a99dfbeda577e687f072166cd0d073d/types/index.d.ts#L1-L10

image

Possible solution:

  • replace PlayerMp with a generic type, with default any, and let the developer pass as argument the corresponding interface for type-safe.
export declare type ProcedureListener<T = any, K = any> = (args: any, info: ProcedureListenerInfo<T, K>) => any;

export declare interface ProcedureListenerInfo<T = any, K = any> {
	environment: string;
	id?: string;
	player?: T;
	browser?: K;
}
function myFunction({ player /* :any */ }: rpc.ProcedureListenerInfo) { ... }

// should be

function myFunction({ player /* :PlayerMp */  }: rpc.ProcedureListenerInfo<PlayerMp>) { ... }

PROCEDURE_NOT_FOUND

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.