> For the complete documentation index, see [llms.txt](https://m-ahmed310.gitbook.io/fignet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://m-ahmed310.gitbook.io/fignet/getting-started.md).

# Getting Started

## Setting up standalone server

Install .NET core template of FigNet from nuget.org (<https://www.nuget.org/packages/fignet.core.template>) or run command below in power shell

```bash
dotnet new --install fignet.core.template
```

Create a new project and Hit play.

![create a new project](https://2818635545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mi5m6nRO5vqi3KSpWcd%2F-Mkkm4JBzigOiPU9t7zM%2F-MklA5frHnL4ORL_Ubnp%2Ffignettemplate.png?alt=media\&token=45fa53fa-c6f0-45e2-a198-e65f1654ed20)

![template structure](https://2818635545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mi5m6nRO5vqi3KSpWcd%2F-MklAO6PqJHlMoinT8BS%2F-MklAoFD7wCX1x5fLQPi%2Fprojectstructure.png?alt=media\&token=a88c414d-64ed-4293-a427-aa1afa552a08)

| Folders Structure |                                                         |
| ----------------- | ------------------------------------------------------- |
| lib               | Contains FigNet assemblies                              |
| Messages          | Contains network operations (messages) and handlers     |
| Misc              | Contains default logger, serializer and utility scripts |
| Modules           | Contains tell a joke module (added to server as plugin) |

## Unity Client

Create new a project and import [FigNet](https://assetstore.unity.com/packages/tools/network/fignet-207935) from asset store

* Go to Player Settings and set API Compatibility Level to **NET 4.x.**
* Open Demo scene (Assets/FigNetSample/Demo) and Hit play&#x20;

<div align="center"><img src="https://2818635545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mi5m6nRO5vqi3KSpWcd%2F-MklDdOhbyCC6AfbF-Wx%2F-MklHMOUqE9rw-22P6py%2Funitypackages.png?alt=media&amp;token=231b3c84-a953-4218-a762-de79ba97ab6e" alt="Available FigNet Providers"></div>

![Demo in action](https://2818635545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mi5m6nRO5vqi3KSpWcd%2F-MklKLrK-6Y7wj-TxI9v%2F-MkldCDfFUkBpQTa5Isd%2Ffignet-demo.gif?alt=media\&token=9c66de63-149c-455d-8efa-610f39a29f83)

![Project structure and Scene setup](https://2818635545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mi5m6nRO5vqi3KSpWcd%2F-MkleavUUdHdO8PngDd-%2F-MklifWMshwfYQCTwBdO%2Fdemo-setup.png?alt=media\&token=d3091ad7-e973-4df4-8c9e-95448c09389b)

1. **FigNetProviderLoader**.cs is used to load provider in above case LiteNetLibProvider
2. **ClientManager**.cs is the entry point of client application, it keeps IClientSocket running
3. **ConnectionManager**.cs it receives network events of IClientSocket by Implemention IClientSocketListner &#x20;

## Unity Embedded server

&#x20;Import FigNetCore.package in your project.

* Go to Player Settings and set API Compatibility Level to **NET 4.x.**
* Attach ServerManager.cs to empty gameobject&#x20;

{% hint style="info" %}
**ServerManager.cs:** creates a IServerSocket instance based on setting in ServerConfig.xml
{% endhint %}
