This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 305
Temporarily Blocking Connections
TheYellowArchitect edited this page Feb 3, 2021
·
3 revisions
Sometimes, when a match starts, you don't want people being able to join the server, even when other players leave. You are able to tell the server to no longer accept connections as seen below:
NetWorker server = new UdpServer(32);
server.Connect();
// ...
// Don't allow any more connections to this server, but don't kick any current connections
((IServer)server).StopAcceptingConnections();
Obviously we needed to give you a way to be able to start accepting connections again otherwise that would be kinda rude. So we went ahead and made the following function for you to begin accepting connections again.
Note that this is a continuation of the above example
// Start allowing for connections to this server again
((IServer)server).StartAcceptingConnections();
Lastly, you may have forgotten or don't know if you stopped allowing connections, so we made this handy boolean for you to check against!
Note that this is a continuation of the above example
if (!((IServer)server).AcceptingConnections)
{
// Connections are currently not allowed for this server
}
Getting Started
Network Contract Wizard (NCW)
Remote Procedure Calls (RPCs)
Unity Integration
Basic Network Samples
Scene Navigation
Master Server
Netcoding Design Patterns
Troubleshooting
Miscellaneous
-
Connection Cycle Events
-
Rewinding
-
Network Logging
-
Working with Multiple Sockets
-
Modify Master and Standalone servers
-
NAT Hole Punching
-
UDP LAN Discovery
-
Offline Mode
-
Ping Pong
-
Lobby System
-
Upgrading Forge Remastered to Develop branch or different version
-
Forge Networking Classic to Remastered Migration Guide
-
Script to easily use Forge Networking from sources
-
Run Two Unity Instances with Shared Assets for Easiest Dedicated Client Workflow