Server/Network/PacketWriter.cs
/// <summary>
/// Writes a fixed-length little-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.
/// </summary>
Writes a fixed-length little-endian unicode string value to the underlying stream. To fit (size), the string content is either truncated or padded with null characters.
Writes a fixed - length little - endian unicode string value to the underlying stream . To fit ( size ) the string content is either truncated or padded with null characters .
public void WriteLittleUniFixed( string value, int size )
		{
			if ( value == null )
			{
				Console.WriteLine( "Network: Attempted to WriteLittleUniFixed() with null value" );
				value = String.Empty;
			}
			size *= 2;
			int length = value.Length;
			m_Stream.SetLength( m_Stream.Length + size );
			if ( ( length * 2 ) >= size )
				m_Stream.Position += Encoding.Unicode.GetBytes( value, 0, length, m_Stream.GetBuffer(), (int)m_Stream.Position );
			else
			{
				Encoding.Unicode.GetBytes( value, 0, length, m_Stream.GetBuffer(), (int)m_Stream.Position );
				m_Stream.Position += size;
			}
		}
public void WriteLittleUniFixed ( string value , int size ) { if ( value == null ) { Console . WriteLine ( " " ) ; value = String . Empty ; } size *= 2 ; int length = value . Length ; m_Stream . SetLength ( m_Stream . Length + size ) ; if ( ( length * 2 ) >= size ) m_Stream . Position += Encoding . Unicode . GetBytes ( value , 0 , length , m_Stream . GetBuffer ( ) , ( int ) m_Stream . Position ) ; else { Encoding . Unicode . GetBytes ( value , 0 , length , m_Stream . GetBuffer ( ) , ( int ) m_Stream . Position ) ; m_Stream . Position += size ; } }
Writes a fixed-length little-endian unicode string value to the underlying stream.
Writes a fixed - length little - endian unicode string value to the underlying stream .
/*size *= 2;

			byte[] buffer = Encoding.Unicode.GetBytes( value );

			if ( buffer.Length >= size )
			{
				m_Stream.Write( buffer, 0, size );
			}
			else
			{
				m_Stream.Write( buffer, 0, buffer.Length );
				Fill( size - buffer.Length );
			}*/
value
string
size
int