@@ -21,18 +21,9 @@ public class NetworkConfig
2121 /// </summary>
2222 public ushort ProtocolVersion = 0 ;
2323 /// <summary>
24- /// The transport to be used
25- /// </summary>
26- public DefaultTransport Transport = DefaultTransport . UNET ;
27- /// <summary>
2824 /// The transport hosts the sever uses
2925 /// </summary>
30- public IUDPTransport NetworkTransport = null ;
31- /// <summary>
32- /// Channels used by the NetworkedTransport
33- /// </summary>
34- [ HideInInspector ]
35- public List < Channel > Channels = new List < Channel > ( ) ;
26+ public Transport NetworkTransport = null ;
3627 /// <summary>
3728 /// A list of SceneNames that can be used during networked games.
3829 /// </summary>
@@ -50,10 +41,6 @@ public class NetworkConfig
5041 [ HideInInspector ]
5142 internal ulong PlayerPrefabHash ;
5243 /// <summary>
53- /// The size of the receive message buffer. This is the max message size including any MLAPI overheads.
54- /// </summary>
55- public int MessageBufferSize = 1024 ;
56- /// <summary>
5744 /// Amount of times per second the receive queue is emptied and all messages inside are processed.
5845 /// </summary>
5946 public int ReceiveTickrate = 64 ;
@@ -76,18 +63,6 @@ public class NetworkConfig
7663 /// </summary>
7764 public int MaxBehaviourUpdatesPerTick = - 1 ;
7865 /// <summary>
79- /// The max amount of Clients that can connect.
80- /// </summary>
81- public int MaxConnections = 100 ;
82- /// <summary>
83- /// The port for the NetworkTransport to use when connecting
84- /// </summary>
85- public int ConnectPort = 7777 ;
86- /// <summary>
87- /// The address to connect to
88- /// </summary>
89- public string ConnectAddress = "127.0.0.1" ;
90- /// <summary>
9166 /// The amount of seconds to wait for handshake to complete before timing out a client
9267 /// </summary>
9368 public int ClientConnectionBufferTimeout = 10 ;
@@ -130,7 +105,6 @@ public class NetworkConfig
130105 /// <summary>
131106 /// Wheter or not to enable the ECDHE key exchange to allow for encryption and authentication of messages
132107 /// </summary>
133- [ Header ( "Cryptography" ) ]
134108 public bool EnableEncryption = false ;
135109 /// <summary>
136110 /// Wheter or not to enable signed diffie hellman key exchange.
@@ -173,7 +147,6 @@ public byte[] ServerX509CertificateBytes
173147
174148 private void Sort ( )
175149 {
176- Channels = Channels . OrderBy ( x => x . Name ) . ToList ( ) ;
177150 RegisteredScenes . Sort ( ) ;
178151 }
179152
@@ -189,29 +162,18 @@ public string ToBase64()
189162 using ( PooledBitWriter writer = PooledBitWriter . Get ( stream ) )
190163 {
191164 writer . WriteUInt16Packed ( config . ProtocolVersion ) ;
192- writer . WriteBits ( ( byte ) config . Transport , 5 ) ;
193-
194- writer . WriteUInt16Packed ( ( ushort ) config . Channels . Count ) ;
195- for ( int i = 0 ; i < config . Channels . Count ; i ++ )
196- {
197- writer . WriteString ( config . Channels [ i ] . Name ) ;
198- writer . WriteBits ( ( byte ) config . Channels [ i ] . Type , 5 ) ;
199- }
200165
201166 writer . WriteUInt16Packed ( ( ushort ) config . RegisteredScenes . Count ) ;
167+
202168 for ( int i = 0 ; i < config . RegisteredScenes . Count ; i ++ )
203169 {
204170 writer . WriteString ( config . RegisteredScenes [ i ] ) ;
205171 }
206172
207- writer . WriteInt32Packed ( config . MessageBufferSize ) ;
208173 writer . WriteInt32Packed ( config . ReceiveTickrate ) ;
209174 writer . WriteInt32Packed ( config . MaxReceiveEventsPerTickRate ) ;
210175 writer . WriteInt32Packed ( config . SendTickrate ) ;
211176 writer . WriteInt32Packed ( config . EventTickrate ) ;
212- writer . WriteInt32Packed ( config . MaxConnections ) ;
213- writer . WriteInt32Packed ( config . ConnectPort ) ;
214- writer . WriteString ( config . ConnectAddress ) ;
215177 writer . WriteInt32Packed ( config . ClientConnectionBufferTimeout ) ;
216178 writer . WriteBool ( config . ConnectionApproval ) ;
217179 writer . WriteInt32Packed ( config . SecondsHistory ) ;
@@ -241,37 +203,20 @@ public void FromBase64(string base64)
241203 {
242204 using ( PooledBitReader reader = PooledBitReader . Get ( stream ) )
243205 {
244-
245206 config . ProtocolVersion = reader . ReadUInt16Packed ( ) ;
246- config . Transport = ( DefaultTransport ) reader . ReadBits ( 5 ) ;
247-
248- ushort channelCount = reader . ReadUInt16Packed ( ) ;
249- config . Channels . Clear ( ) ;
250- for ( int i = 0 ; i < channelCount ; i ++ )
251- {
252- Channel channel = new Channel ( )
253- {
254- Name = reader . ReadString ( ) . ToString ( ) ,
255- Type = ( ChannelType ) reader . ReadBits ( 5 )
256- } ;
257- config . Channels . Add ( channel ) ;
258- }
259207
260208 ushort sceneCount = reader . ReadUInt16Packed ( ) ;
261209 config . RegisteredScenes . Clear ( ) ;
210+
262211 for ( int i = 0 ; i < sceneCount ; i ++ )
263212 {
264213 config . RegisteredScenes . Add ( reader . ReadString ( ) . ToString ( ) ) ;
265214 }
266215
267- config . MessageBufferSize = reader . ReadInt32Packed ( ) ;
268216 config . ReceiveTickrate = reader . ReadInt32Packed ( ) ;
269217 config . MaxReceiveEventsPerTickRate = reader . ReadInt32Packed ( ) ;
270218 config . SendTickrate = reader . ReadInt32Packed ( ) ;
271219 config . EventTickrate = reader . ReadInt32Packed ( ) ;
272- config . MaxConnections = reader . ReadInt32Packed ( ) ;
273- config . ConnectPort = reader . ReadInt32Packed ( ) ;
274- config . ConnectAddress = reader . ReadString ( ) . ToString ( ) ;
275220 config . ClientConnectionBufferTimeout = reader . ReadInt32Packed ( ) ;
276221 config . ConnectionApproval = reader . ReadBool ( ) ;
277222 config . SecondsHistory = reader . ReadInt32Packed ( ) ;
@@ -307,12 +252,6 @@ public ulong GetConfig(bool cache = true)
307252 writer . WriteUInt16Packed ( ProtocolVersion ) ;
308253 writer . WriteString ( MLAPIConstants . MLAPI_PROTOCOL_VERSION ) ;
309254
310- for ( int i = 0 ; i < Channels . Count ; i ++ )
311- {
312- writer . WriteString ( Channels [ i ] . Name ) ;
313- writer . WriteByte ( ( byte ) Channels [ i ] . Type ) ;
314- }
315-
316255 for ( int i = 0 ; i < RegisteredScenes . Count ; i ++ )
317256 {
318257 writer . WriteString ( RegisteredScenes [ i ] ) ;
0 commit comments