LibRPC Examples: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"> The new version of LibRPC (of this article) is about to be released </poem> New functions Fa, RFCa was added to library for raw calling of functions with a specified environment class or instance. Earlier the 'this' was always the roottable. By using "compilestring", one do not need Fa and RFCa. ==The Problem== <source> F("MyFunction")(p1, p2, ... ) </source>...")
 
Line 8: Line 8:
F("MyFunction")(p1, p2, ... )
F("MyFunction")(p1, p2, ... )
</source>
</source>
On serverside, it is equivalent to <source>MyFunction.call(getroottable(), p1, p2, ... )</source>
<poem>
Suppose i want to call<source inline=true>MyFunction.call(m, p1, p2, ... )</source> where m is a table other than roottable. Then it was not possible.  
On serverside, it is equivalent to <source>MyFunction.call(getroottable(), p1, p2, ... )</source></poem>
<poem>Suppose i want to call<source inline=true>MyFunction.call(m, p1, p2, ... )</source> where m is a table other than roottable. Then it was '''not possible'''.  
It is for this reason that new function Fa is introduced.
It is for this reason that new function Fa is introduced.
</poem>

Revision as of 00:09, 8 June 2023

The new version of LibRPC (of this article) is about to be released

New functions Fa, RFCa was added to library for raw calling of functions with a specified environment class or instance. Earlier the 'this' was always the roottable. By using "compilestring", one do not need Fa and RFCa.

The Problem

F("MyFunction")(p1, p2, ... )
On serverside, it is equivalent to
MyFunction.call(getroottable(), p1, p2, ... )

Suppose i want to callMyFunction.call(m, p1, p2, ... ) where m is a table other than roottable. Then it was not possible.
It is for this reason that new function Fa is introduced.