question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ApprovalCheck function might need update on your Wiki

See original GitHub issue

Question

Description

I have downloaded your latest release and try to create a server and a client from scratch based on your Wiki.

    private void ApprovalCheck(byte[] connectionData, uint clientId, Action<uint, bool, Vector3, Quaternion> callback)
    {
        //Your logic here
        bool approve = true;
        //If approve is true, the connection gets added. If it's false. The client gets disconnected
        callback(clientId, approve, new Vector3(0,0,0), Quaternion.identity);
    }

However, the following line

NetworkingManager.singleton.ConnectionApprovalCallback = ApprovalCheck;

complains that “No overload for ApprovalCheck matches delegate 'Action<byte[], uint, NetworkingManager.ConnectionApprovedDelegate>”

Could you give me some hint how to resolve this issue?

Your Environment

  • Unity Version: {2018.2.10f1}
  • MLAPI Version (2.1.0}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
TwoTenPvPcommented, Oct 10, 2018

I pulled the default of 64 out of my arse. You can set it to 1 if you want. Lower numbers process messages in larger batches. (Ex: set it to 1, and it will process ALL pending messages once a second). Higher rates will spread the load over frames. Lower numbers thus give higher latency.

64 is nice because it high enough to have low latency and will spread the messages out quite nicley. But it’s also not absurdly high, thus not wasting frame cycles. If your server runs at 1000 fps. There is no point doing network IO in every frame. 64 is still really good in that case.

Just remember, having a high value is only effective up to the framerate. The tickrate becomes this: Math.Min(FRAMERATE, TICKRATE);

Thus, if you run 1 FPS and set the tickrate to 1000. It will still work as if you set the tickrate to 1.

The reason the tickrate option exists is to be able to control the rate without changing the framerate. Changing the framerate could mess with drawing, physics and other things.

Also, the server and client can have different values.

0reactions
IoannisKaragianniscommented, Oct 10, 2018

I’m sorry for bothering you, but I’m trying to evaluate the new MLAPI in terms of latency. I need some help on the SendTickrate, ReceiveTickrate and EventTickrate. Assuming we have an update loop of 60Hz, how should I set the above-mentioned variables in a reasonable manner? Should they all have the same value, e.g.: 50? Does the network manager need to be configured in the exact same way with respect to those variables for the server and the client? How did you come up with the default 64?

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

ApprovalCheck function might need update on your Wiki
I have downloaded your latest release and try to create a server and a client from scratch based on your Wiki. private void...
Read more >
artwork_approval_compatibility_r...
When you are first updated to version 5.75 and you click on the Artwork tab on any order or estimate, you will see...
Read more >
Pipeline deployment approvals - Azure DevOps
Use approvals to determine when a deployment stage can run.
Read more >
Security through templates - Azure Pipelines
When a pipeline doesn't extend from the require template, the check will fail and the run will stop. You will see that your...
Read more >
Australian Classification Board
The Australian Classification Board (ACB or CB) is an Australian government statutory body responsible for the classification and censorship of films, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found