Git Product home page Git Product logo

clumsyunitywrapper's Introduction

About

This is a Unity integration for the incredibly useful Clumsy network conditions simulation tool.

Installation

Install the package from its git URL or from a local copy.

Quickstart

  1. Create a ClumsyConfiguration asset using the Assets > Create > Clumsy > Configuration menu.

  1. Open the Clumsy window using the Window > Clumsy > Clumsy menu:

  1. Toggle the Enabled button and pick (using the dropdown) the ClumsyConfiguration that you created earlier:

  1. Modify the configuration according to your needs.

  2. Enter Play mode. An external clumsy.exe window should spawn (minimized).

  3. If you wish to modify the configuration during Play mode, untoggle the Enabled button, make your modifications, and toggle it to relaunch Clumsy with the new config.

  4. The external window/process will be destroyed when Play mode is exited.

Preferences

  • Custom Installation Directory: This package comes with a bundled version of Clumsy, but you can specify another version. Although at the moment this package only works with a specific fork.
  • Window Style: The external Clumsy window can be launched minimized or completely hidden.

API

Some projects might not be compatible with the auto-start workflow, ex if the connection ports aren't constant.

In that case the filter string can contain parameters in curly brackets, ex udp and (udp.DstPort == {port} or udp.SrcPort == {port}).

The user can provide those arguments at runtime using the Runner.Instance.SetParameter function call. Clumsy will automatically start once all the parameters in the filter string have been provided (this behavior is opt-out).

Additionally Clumsy can be controlled manually with the Runner.Instance.SetConfiguration, Runner.Instance.Start, and Runner.Instance.Stop function calls.

Logging

The CLUMSY_LOG scripting define symbol can help trace the flow of all the above.

Start workflows

In summary there's a few different ways to launch Clumsy:

  1. Enable Auto Start in the configuration: Will launch automatically when entering Play mode.
  2. Disable Auto Start in the configuration: Call Runner.Instance.Start manually.
  3. The configuration's Filter contains parameters that need to be set at runtime:
    1. Runner.Instance.SetParameter with parameter autoStart = true: Will launch automatically once all parameters have been provided.
    2. Runner.Instance.SetParameter with parameter autoStart = false: Call Runner.Instance.Start manually after providing the parameters.

Clumsy fork

A fork was necessary to apply a small patch. The patch ensures command line arguments are processed even when Clumsy launches in a minimized or hidden window.

clumsyunitywrapper's People

Contributors

ohmnivore avatar

Stargazers

Mat avatar  avatar

Watchers

 avatar

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.