ReadByte: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome|desc=This will read a byte from the blob of onServerData.|params=<source lang="lua">( data )</source><poem> ::data : The blob obtained from onServerData </poem>| example=<source lang="lua"> function OnServerData( data ) { local a = ReadByte(data); print("I received byte " + a + " from server\n"); } </source>| retvals=The function returns the integer on success. On failure throw error.| relfuncs=*ReadInt *ReadFloat *ReadString *OnSe...")
 
No edit summary
 
Line 9: Line 9:
}
}
</source>|
</source>|
retvals=The function returns the integer on success. On failure throw error.|
retvals=The function returns the byte on success. On failure throw error.|
relfuncs=*[[ReadInt]]
relfuncs=*[[ReadInt]]
*[[ReadFloat]]
*[[ReadFloat]]
*[[ReadString]]
*[[ReadString]]
*[[OnServerData]]}}
*[[OnServerData]]}}

Latest revision as of 17:45, 24 June 2023


Description:
This will read a byte from the blob of onServerData.


Parameters:

( data )

data : The blob obtained from onServerData


Return Values:
The function returns the byte on success. On failure throw error.


Example

function OnServerData( data )
{
    local a = ReadByte(data);
    print("I received byte " + a + " from server\n");
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.