LibRPC: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
Line 28: Line 28:
===Function structure===
===Function structure===
===='F' type function====
===='F' type function====
F type functions are those functions to be called through a name, ( unlike to be called through other methods see 'G' type functions ).
F type functions are those functions to be called through a name, ( unlike to be called through other methods see 'G' type functions ). The function name is encoded from offset 7.
{| class="wikitable"  
{| class="wikitable"  
|-
|-
Line 55: Line 55:
| ...
| ...
|}
|}
*Offset relative to this buffer and not relative to ServerData ( complete buffer. )


===='G' type function====
===='G' type function====

Revision as of 19:09, 16 February 2023

Library used to execute functions or script send from server. Available with npc v1.6 beta onwards.

ServerData Identifier

LibRPC when loaded works on server data whose first four bytes is the following:

Offset Type Value
0 Integer 0x40000000

ServerData structure

Offset Type Value
4 Character 'F' or 'G' Function

Function structure

'F' type function

F type functions are those functions to be called through a name, ( unlike to be called through other methods see 'G' type functions ). The function name is encoded from offset 7.

Offset* Type Value
0 Character 'F'
1-4 Unsigned Integer size of the function buffer
5-6 unsigned short length of the function name
7 - 7+len(funcname)-1 characters Function Name
7+len - ... ... ...
  • Offset relative to this buffer and not relative to ServerData ( complete buffer. )

'G' type function

Offset* Type Value
0 Character 'G'
1-4 Unsigned Integer size of the buffer
5 Character 'G' or 'F'
... ... ...