Mirror/doc/articles/Events/Server.md
Paul Pacheco 35fee94d56
docs: switch to docfx for documentation (#1026)
* Moved doc files to docfx folder

* load csproj

* doc generation

* Run docfx

* Add docfx

* Deploy docs to mirror-networking.com

* use deploy phase

* deploy whole generated site

* Fixed the semantic release command

* Is last \ required?

* show debug log

* using lftp for site deploy

* Testing lftp

* Show current folder

* try -e command option

* Show me the files

* use plain ftp

* use choco install instead of cinst

* fix ssl certificate validation

* fix username

* Upload site to xmldocs folder

* no need to archive docs

* No need for debug output

* Fix file permissions

* show me .htaccess

* Show me contents

* Wipe out folder to fix permissions

* Set file permissions

* Fix file permissions

* complete toc list

* Migrated intro page

* Remove old docs

* Update link to docs

* Add link to github

* Only update docs for stuff in master

* This is a powershell command

* Update doc/articles/Concepts/Communications/RemoteActions.md

* Update doc/articles/Concepts/VisibilityCustom.md

* Update doc/articles/Concepts/Authority.md

* Update doc/articles/Concepts/GameObjects/SpawnObjectCustom.md

* Update doc/articles/Concepts/Authority.md

* Update doc/articles/Classes/SyncVars.md

* No need to run semver twice
2019-08-24 10:20:33 -05:00

22 lines
1.5 KiB
Markdown

# Server Events Overview
General description of Server Events
- **OnServerConnect**
Called on the server when a new client connects.
Miror calls this on the Server when a Client connects to the Server. Use an override to tell the NetworkManager what to do when a client connects to the server.
- **OnServerDisconnect**
Called on the server when a client disconnects.
This is called on the Server when a Client disconnects from the Server. Use an override to decide what should happen when a disconnection is detected.
- **OnServerAddPlayer**
Called on the server when a client adds a new player with ClientScene.AddPlayer.
The default implementation for this function creates a new player object from the playerPrefab.
- **OnServerRemovePlayer**
Called on the server when a client removes a player.
The default implementation of this function destroys the corresponding player object.
__Note__: OnServerRemovePlayer is only called if a RemovePlayer message is received, and a RemovePlayer message is only sent if ClientScene.RemovePlayer() is called. ClientScene.RemovePlayer() is never called by Mirror code. You must call it yourself to receive OnServerRemovePlayer in your NetworkManager.
- **OnServerSceneChanged**
Called on the server when a Scene is completed loaded, when the Scene load was initiated by the server with ServerChangeScene().
- **OnServerError**
Called on the server when a network error occurs for a client connection.