Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making a catch-all DoXForPlayer #6

Closed
oscar-broman opened this issue Jan 5, 2015 · 4 comments
Closed

Making a catch-all DoXForPlayer #6

oscar-broman opened this issue Jan 5, 2015 · 4 comments

Comments

@oscar-broman
Copy link
Contributor

What about hooking the RakNet broadcast method? That way, it could be customized who the next packets get sent to.

This would give a lot of flexibility to Pawn scripters.

For example:

// This would enable/disable the functionality
native SetExclusiveBroadcast(toggle);
// This would add a player to the list of who will receive the packet
native BroadCastToPlayer(playerid, toggle = true);

public OnPlayerConnect(playerid) {
    SetExclusiveBroadcast(true);
    BroadCastToPlayer(playerid);
    SetGravity(0.0);
    SetExclusiveBroadcast(false);

    return 1;
}
@JernejL
Copy link

JernejL commented Jan 6, 2015

I like this oscar's idea, it's not bad at all, it has some niche but very cool uses.

@ghost
Copy link

ghost commented Mar 3, 2015

Hm..

Just an idiot question :D
Now I know how to hook RakServer::RPC, it's very easy.

BroadCastToPlayer would add given players into a vector, and while SetExclusiveBroadcast is true, only that players would get RPC's whose in that vector.

I hope it would work.

@ghost ghost closed this as completed Dec 2, 2016
@oscar-broman
Copy link
Contributor Author

Is this possible now?

@ghost
Copy link

ghost commented Dec 2, 2016

I'll look after but now I think it's now closer to possible like it was before.

E: Theroticaly, it's yes.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants