Skip to content

Commit

Permalink
fix: NS call SpawnObjects. No NetMan dependency for spawning objects (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
uweeby committed Jul 18, 2020
1 parent 684d20f commit e1bb8de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions Assets/Mirror/Runtime/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ async Task SetupServer()
public async Task StartServer()
{
await SetupServer();

server.SpawnObjects();
}

/// <summary>
Expand Down Expand Up @@ -158,9 +156,6 @@ public async Task StartHost()
// host version is enough.
void FinishStartHost()
{
// server scene was loaded. now spawn all the objects
server.SpawnObjects();

// connect client and call OnStartClient AFTER server scene was
// loaded and all objects were spawned.
// DO NOT do this earlier. it would cause race conditions where a
Expand Down
1 change: 1 addition & 0 deletions Assets/Mirror/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public async Task ListenAsync()
// before OnStartServer() because this all runs in one thread
// and we don't start processing connects until Update.
Started.Invoke();
SpawnObjects();

_ = AcceptAsync();
}
Expand Down

0 comments on commit e1bb8de

Please sign in to comment.