예제 #1
0
	protected UInt64 ComputeSettingsHash()
	{
		using( BitWriter writer = GetPooledWriter() )
		{
			// TODO: cozeroff
			//writer.WriteString(AlpacaConstant.ALPACA_PROTOCOL_VERSION);

			writer.Packed<Int32>( _commonSettings.customChannel.Length );
			foreach( CustomChannelSettings c in _commonSettings.customChannel )
			{
				// TODO: cozeroff
				//writer.WriteString( c.name );
				writer.Packed<Int32>( (Int32)c.type );
			}

			// we do not write the Entity's here because it is allowed for the client and server to have different prefabs.
			// eventually, we should do a more advanced check, since the prefabs do need to have matching Conducts.
			writer.Packed<Int32>( _commonSettings.messageBufferSize );
			writer.Packed<UInt32>( _commonSettings.maxEventCount );
			writer.Packed<Int32>( _commonSettings.lagCompensationHistory );
			writer.Packed<Int32>( (Int32)_commonSettings.stringHashSize );
			writer.Packed<Int32>( (Int32)_commonSettings.logLevel );
			writer.Packed<bool>( _commonSettings.enableTimeResync );
			writer.Packed<bool>( _commonSettings.enableEncryption );
			writer.Packed<bool>( _commonSettings.signKeyExchange );
			writer.AlignToByte();

			return writer.GetStableHash64();
		}
	}