LogoLogo
HomeOnline DashboardAPIDiscordForums
SDK 0.5.2
SDK 0.5.2
  • Welcome
  • Overview
    • What is coherence?
    • How does coherence work?
    • Features and Roadmap
    • Requirements
  • Get Started
    • Install coherence
    • Scene setup
    • Prefab setup
    • Build and run
    • Baking and code generation
    • Create a free account
    • Deploy replication server
    • Share builds
  • Authority and communication
    • How authority works
    • Authority transfer
    • Commands
    • Client messages
    • Server-side and input queues
    • Animations
  • Persistence
    • Overview
    • Configuring persistence
    • Storage
    • Example – A global counter
  • Optimization
    • Overview
    • Simulation frequency
    • Areas of interest
    • World size
    • Level of detail
    • Interpolation
    • Extrapolation
  • Connected entities
    • Overview
    • Entity references
    • Parent-child relationships
  • Simulators
    • Overview
    • Client vs. simulator logic
    • Build and deploy
    • Simulator load balancing
  • Tutorial project
    • Get the Tutorial Project
    • Start Tutorial
      • 1. Transforms
      • 2. Physics
      • 3. Persistence
      • 4. Animation and Variables
      • 5. AI Navigation
      • 6. Network Commands
      • 7. Network Teams (draft)
  • Game Services
    • Game account
    • Key-value store
    • Matchmaking
  • Developer Portal
    • Overview
    • Dashboard
    • Resource Usage
    • Replicator and Simulator Configuration
    • Enabling Game Services
  • API reference
    • Network SDK
      • CoherenceSync
      • MonoBridge
      • LiveQuery
      • Archetype
      • Sample UI
      • Settings Window
      • Custom Bindings
    • Cloud API
      • API tokens and keys
      • Server discovery
      • Game account
      • Key-value store
      • Matchmaking
    • Replication Server
    • Simulation Server
  • Schema reference
    • Overview
    • Specification
    • Field Settings
    • Archetypes and LOD-ing
  • Resources
    • Downloads
    • SDK Update Guide
    • Video Tutorials
    • Glossary
    • CLI Utilities
    • Helper Scripts
    • Troubleshooting
  • Community
    • Discord
  • Additional information
    • Pricing
    • SLA
    • Unreal Engine support
    • WebGL
    • Peer-to-Peer (P2P)
    • Known Issues
    • Changelog
Powered by GitBook
On this page
  • protocol-code-generator
  • replication-server
  • simulation-server
  • persistence-client
  • General flags

Was this helpful?

Export as PDF
  1. Resources

CLI Utilities

Last updated 4 years ago

Was this helpful?

protocol-code-generator

This tool has built in help that you can access like this:

protocol-code-generator --help

If you want information about a special command, instead do:

protocol-code-generator --help generate

Flags

-d, --schema=STRING

The schema file (.schema)

-o, --output=STRING

Output file

--output-dir=STRING

Output directory (can only be used together with --split)

-c, --code=STRING

-e, --ecs=STRING

--sync=STRING

When running the schema generator, it needs to know the location of the schema file and what kind of code it should generate.

It will emit the generated code to stdout, so you have to that to a text file in order to save it (for example using the > operator). Here's an example of how it can look:

protocol-code-generator generate --code csharp --ecs unity --schema ./coherence.schema > ./generated/schema.cs

The emitted file should be placed somewhere inside your Unity project.

replication-server

The replication server also has general and specific help.

replication-server --help

replication-server --help serve

Flags

--port=32001

The port to listen to

--stats-port=32000

The port to listen for stats scrapers

--dump

Write network packets to capture files (.packets)

--frequency=20

The server update frequency

--schema=STRING

The schema file (.schema)

--entities=STRING

Entity snapshot (.yaml)

--parent-replicator=STRING

Host address for parent replicator connection

--use-world-partitioner

If set, the binary_partitioner is used

--disconnect-timeout=5000

Disconnect timeout (in milliseconds)

--debug-streams

Use debug streams

--max-entities=65536

Maximum number of entities allowed

--min-query-distance=0.1

Minimum distance for query change

To start the server, you need to give it the location of the schema, like this:

replication-server serve --schema ../Assets/coherence/coherence.schema

In the example above we're running the server from the coherence-bin directory right at the root of your project.

You can also define other parameters like min-query-distance (the minimum distance the LiveQuery needs to move for the replicator to recognize a change), frequency, ip and port number.

replication-server serve --min-query-distance 10 --port 32001 --frequency 320 --schema "C:\Users\tadej\Desktop\work\coherence\gamejam-stellar\Assets\Schemas\stellar.schema"

simulation-server

You can run coherence simulation server using

./sim_x86_64 --coherence-simulation-server

persistence-client

The persistence client has general and specific help.

persistence-client serve --help

persistence-client --help serve

Flags

--save-file-name="world.save" .

The name of the persistent save file

--save-folder="."

The folder where the save file is written

--save-frequency=30

The frequency in which the save file is written, in seconds

--host="127.0.0.1:32001"

The host:port to connect to

--dump

Write network packets to capture files (.packets)

--frequency=20

The server update frequency

--schema=STRING

The schema file (.schema)

--disconnect-timeout=5000

Disconnect timeout (in milliseconds)

--debug-streams

Use debug streams

--query-world-position="0,0,0"

Position of the center of the entity query

--query-radius=10000

Radius of entity query

General flags

--log-level=LOG-LEVEL-STRING

Log level

--log-file=LOG-FILE-STRING

Log output file

--panic-on-error

Enable/disable panic on error

pipe