Core Function SSRead

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> SSRead( <message buffer>, <data type> ) </pre> === Description === Read data from a message. === Parameters === ==== <message buffer> ==== The message buffer to read f...")
 
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
SSRead( <message buffer>, <data type> )
+
SSRead( <client/server>, <data type> )
 
</pre>
 
</pre>
  
 
=== Description ===
 
=== Description ===
  
Read data from a message.
+
Read data from a client/server.
  
 
=== Parameters ===
 
=== Parameters ===
  
==== <message buffer> ====
+
==== <client/server> ====
  
The message buffer to read from.
+
The client or server object to read data from.
  
==== <data type> ====
+
==== <data-type> ====
  
 
The type of data to read from the message buffer valid options are:
 
The type of data to read from the message buffer valid options are:
Line 19: Line 19:
 
<pre>
 
<pre>
 
[CODE] [TYPE]
 
[CODE] [TYPE]
"v" Binary (Array of bytes) // This returns a binary variable)
+
"v" Binary (Reads an Int32 for size then reads that many bytes)
"b" Byte
+
"V" Binary (Reads from current positoin to end of the buffer)
 +
"b" Byte (signed)
 +
"B" Byte (unsigned)
 
"s" Int16
 
"s" Int16
 
"i" Int32
 
"i" Int32
Line 36: Line 38:
 
Success: Returns the data as requested.  
 
Success: Returns the data as requested.  
  
Failure: Returns 0.  
+
Failure: Returns null.  
  
 
=== Remarks ===
 
=== Remarks ===

Latest revision as of 06:22, 15 June 2015

SSRead( <client/server>, <data type> )

Contents

Description

Read data from a client/server.

Parameters

<client/server>

The client or server object to read data from.

<data-type>

The type of data to read from the message buffer valid options are:

[CODE]		[TYPE]
"v"		Binary (Reads an Int32 for size then reads that many bytes)
"V"		Binary (Reads from current positoin to end of the buffer)
"b"		Byte (signed)
"B"		Byte (unsigned)
"s"		Int16
"i"		Int32
"l"		Int64
"S"		UInt16
"I"		UInt32
"L"		UInt64
"f"		Float
"d"		Double
"p"		String

Return Value

Success: Returns the data as requested.

Failure: Returns null.

Remarks

This is NOT a generic socket toolset; You can't use this to connect to anything instead it is used to connect Sputnik clients with Sputnik servers in a very easy to use way.

Example

See the Listen() and Connect() for examples

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox