Class ClientServerBootstrap
Inheritance
ClientServerBootstrap
Syntax
[Preserve]
public class ClientServerBootstrap : ICustomBootstrap
Fields
AutoConnectPort
The default port to use for auto connection. The default value is zero, which means do not auto connect.
If this is set to a valid port any call to CreateClientWorld
- including CreateDefaultWorlds
and Initialize
-
will try to connect to the specified port and address - assuming DefaultConnectAddress
is valid.
Any call to CreateServerWorld
- including CreateDefaultWorlds
and Initialize
- will listen on the specified
port and listen address.
Declaration
public static ushort AutoConnectPort
Field Value
DefaultConnectAddress
The default address to connect to when using auto connect (AutoConnectPort
is not zero).
If this valud is NetworkEndPoint.AnyIpv4
auto connect will not be used even if the port is specified.
This is to allow auto listen without auto connect.
The address specified in the Multiplayer PlayMode Tools takes precedence over this when running in the editor,
if that address is not valid or you are running in a player DefaultConnectAddress
will be used instead.
An invalid DefaultConnectAddress
will disable auto connect even if the address in Multiplayer PlayMode Tools is valid.
Declaration
public static NetworkEndPoint DefaultConnectAddress
Field Value
DefaultListenAddress
The default address to listen on when using auto connect (AutoConnectPort
is not zero).
Declaration
public static NetworkEndPoint DefaultListenAddress
Field Value
Properties
DefaultWorldSystems
Declaration
public static List<Type> DefaultWorldSystems { get; }
Property Value
ExplicitDefaultWorldSystems
Declaration
public static List<Type> ExplicitDefaultWorldSystems { get; }
Property Value
RequestedPlayType
Declaration
public static ClientServerBootstrap.PlayType RequestedPlayType { get; }
Property Value
Methods
CreateClientWorld(World, String, World)
Declaration
public static World CreateClientWorld(World defaultWorld, string name, World worldToUse = null)
Parameters
Returns
CreateDefaultClientServerWorlds(World)
Utility method for creating the default client and server worlds based on the settings
in the playmode tools in the editor or client / server defined in a player.
Can be used in custom implementations of Initialize
.
Declaration
public virtual void CreateDefaultClientServerWorlds(World defaultWorld)
Parameters
Type |
Name |
Description |
World |
defaultWorld |
|
CreateDefaultWorld(String, World)
Utility method for creating the default way when bootstrapping. Can be used in
custom implementations of Initialize
to generate systems lists and populate the
default world. If the world
parameter specified that world will be used and
populated with systems instead of creating a new one.
Declaration
public World CreateDefaultWorld(string defaultWorldName, World world = null)
Parameters
Type |
Name |
Description |
String |
defaultWorldName |
|
World |
world |
|
Returns
CreateServerWorld(World, String, World)
Declaration
public static World CreateServerWorld(World defaultWorld, string name, World worldToUse = null)
Parameters
Returns
GenerateSystemLists(IReadOnlyList<Type>)
Declaration
protected static void GenerateSystemLists(IReadOnlyList<Type> systems)
Parameters
GetSystemAttribute<T>(Type)
Declaration
protected static T GetSystemAttribute<T>(Type systemType)
where T : Attribute
Parameters
Type |
Name |
Description |
Type |
systemType |
|
Returns
Type Parameters
Initialize(String)
Declaration
public virtual bool Initialize(string defaultWorldName)
Parameters
Type |
Name |
Description |
String |
defaultWorldName |
|
Returns
Implements
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.