CN105260224A - LUA script expansion system and operation method thereof - Google Patents

LUA script expansion system and operation method thereof Download PDF

Info

Publication number
CN105260224A
CN105260224A CN201510820935.9A CN201510820935A CN105260224A CN 105260224 A CN105260224 A CN 105260224A CN 201510820935 A CN201510820935 A CN 201510820935A CN 105260224 A CN105260224 A CN 105260224A
Authority
CN
China
Prior art keywords
lua
script
ones extend
ones
lua script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510820935.9A
Other languages
Chinese (zh)
Inventor
赵新锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENGQU INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd
Original Assignee
SHENGQU INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENGQU INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd filed Critical SHENGQU INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd
Priority to CN201510820935.9A priority Critical patent/CN105260224A/en
Publication of CN105260224A publication Critical patent/CN105260224A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides an LUA script expansion system and an operation method thereof. The LUA script expansion system packages an LUA script system and provides an interface facing objects. According to the LUA script expansion system and the operation method thereof, the LUA script expansion system packages the LUA script system, the LUA script system can be embedded into the LUA script expansion system, dependence on other libraries is not needed, and development efficiency is improved; the friendly interface facing the objects is provided, the details of the LUA script system does not need to be known, the software development burden is reduced, and development efficiency is improved.

Description

A kind of LUA ones extend system and operation method thereof
Technical field
The present invention relates to computer application field, especially a kind of LUA ones extend system and operation method thereof.
Background technology
Along with the rise of mobile Internet, cell phone software development technique is rapidly developed, mobile software is if APP, game etc. are in order to realize the agility automatically upgrading and develop, often will call LUA script system, the server field of game also needs to use LUA script system to develop the functions such as configuration, task, AI.
Usually, the development technique exploitations such as mobile software application C++, JAVA, but these traditional development technique have following shortcoming:
1, development efficiency is low, is not quick enough, and traditional development technique is run after needing compiling to connect, and not easily debugs after makeing mistakes, and mobile Internet often requires that function iteration is rapid, and traditional development technique is difficult to the demand adapting to iteratively faster.
2, common mobile software upgrading, user must download new installation kit, reinstalls.If there is bug, so the program of user can not be repaired immediately.
3, script system can solve two problems above greatly, but the API of script system is process type, but not the Subject-oriented that developer is familiar with.
4, the API of script system is obscure loaded down with trivial details, once mistake in, and misarrangement difficulty.
5, also can use script system in game server, directly use script system API that system can be caused to be difficult to safeguard.
Summary of the invention
The object of the present invention is to provide a kind of LUA ones extend system and operation method thereof, to overcome the above problems, improve software development efficiency.
In order to achieve the above object, the invention provides a kind of LUA ones extend system and operation method thereof, wherein, described LUA ones extend system in package LUA script system, and object-oriented interface is provided.
Preferably, in above-mentioned LUA ones extend system, the dofile operation of the described LUA script system of described LUA ones extend system in package, directly to call the script file of described LUA script system.
Preferably, in above-mentioned LUA ones extend system, the described LUA ones extend system in package dosting interface of described LUA script system, directly to call the script sentence of described LUA script system.
Preferably, in above-mentioned LUA ones extend system, the described LUA ones extend system in package function interface of described LUA script system, directly to call the script function of described LUA script system.
Preferably, in above-mentioned LUA ones extend system, a function in described LUA ones extend system can use multiple parameter simultaneously.
Preferably, in above-mentioned LUA ones extend system, a function of described LUA ones extend system uses nine parameters at most simultaneously.
Preferably, in above-mentioned LUA ones extend system, described LUA ones extend system uses C++ exploitation, provides OO C++ interface.
Preferably, in above-mentioned LUA ones extend system, described LUA ones extend system uses C++ Generic programming, supports general type and the STL type of C++.
Preferably, in above-mentioned LUA ones extend system, the class of C++ and interface are imported to the interface of described LUA script system by described LUA ones extend system, make described LUA script system invokes application DLL (dynamic link library) API.
Preferably, in above-mentioned LUA ones extend system, described LUA ones extend system provides heat more new interface, to realize run duration heavy duty LUA script system.
Present invention also offers a kind of operation method of LUA ones extend system described above, comprising:
Use described LUA ones extend system call LUA script system; And
Use described LUA ones extend system call Object-Oriented Systems.
Preferably, in the operation method of above-mentioned LUA ones extend system, described LUA ones extend system call LUA script system is used to comprise:
Prepare LUA script system kit;
Introduce the class libraries of described LUA ones extend system;
The store path of the script file of setting LUA script system;
Obtain and arrange the global variable of described script file;
Perform the script sentence of described LUA script system;
Perform the script file of described LUA script system;
Call the script function of described LUA script system.
Preferably, in the operation method of above-mentioned LUA ones extend system, in the process of script function calling described LUA script system, support general shape parameter, and multiple parameter can be supported simultaneously.
Preferably, in the operation method of above-mentioned LUA ones extend system, in the process of script function calling described LUA script system, nine parameters can be supported at most simultaneously.
Preferably, in the operation method of above-mentioned LUA ones extend system, in the process of script function calling described LUA script system, can specify rreturn value type, described rreturn value type comprises general type.
Preferably, in the operation method of above-mentioned LUA ones extend system, described LUA ones extend system call Object-Oriented Systems is used to comprise:
Prepare LUA script system kit;
Introduce the class libraries of described LUA ones extend system;
The store path of the script file of setting LUA script system;
Write and need to import to the C++ class in described LUA script system;
Described C++ class is imported in described LUA script system;
The function of described C++ class is imported in described LUA script system.
Preferably, in the operation method of above-mentioned LUA ones extend system, also comprise: the C++ function importing the overall situation in described LUA script system.
In a kind of LUA ones extend system provided by the invention and operation method thereof, described LUA ones extend system in package LUA script system, directly can embed described LUA script system and without the need to relying on other class libraries, improve development efficiency.And friendly object-oriented interface is provided, without the need to understanding the minor details of described LUA script system, alleviating software development burden, improve development efficiency.
Accompanying drawing explanation
Fig. 1 is that the process flow diagram of LUA ones extend system call LUA script system in the embodiment of the present invention uses;
Fig. 2 is the process flow diagram using LUA ones extend system call Object-Oriented Systems in the embodiment of the present invention.
Embodiment
Below in conjunction with schematic diagram, the specific embodiment of the present invention is described in more detail.According to following description and claims, advantages and features of the invention will be clearer.It should be noted that, accompanying drawing all adopts the form that simplifies very much and all uses non-ratio accurately, only in order to object that is convenient, the aid illustration embodiment of the present invention lucidly.
Embodiments provide a kind of LUA ones extend system and operation method thereof, wherein, described LUA ones extend system in package LUA script system, and object-oriented interface is provided.
Concrete, in the present embodiment, described LUA ones extend system uses C++ exploitation, provides OO C++ interface.Therefore, described LUA ones extend system uses C++ Generic programming, supports general type and the STL type of C++.Further, customization type also can be supported by the general type ability of described LUA ones extend system.Further, described LUA ones extend system uses C++ exploitation, not relying on other class libraries, realizing Cross-border congestion management when calling.Both can use in Android, IOS system of mobile terminal, also can use on the Windows of PC, linux system.Friendly OO C++ interface being provided, making the API without the need to understanding described LUA script system also can realize calling described LUA script system.
The dofile operation of the described LUA script system of described LUA ones extend system in package, directly calling the script file of described LUA script system.Described LUA ones extend system also encapsulates the dosting interface of described LUA script system, directly to call the script sentence of described LUA script system.
Further, described LUA ones extend system also encapsulates the function interface of described LUA script system, namely encapsulates the interface of the script function calling described LUA script system, directly to call the script function of described LUA script system.
Concrete, a function in described LUA ones extend system can use multiple parameter simultaneously.Because in C++, each function supports at most nine parameters, and therefore, a function of described LUA ones extend system also uses nine parameters at most simultaneously.
Further, the class of C++ and interface are imported to the interface of described LUA script system by described LUA ones extend system, make described LUA script system invokes application DLL (dynamic link library) API.Also just say, C++ programming language not only can be utilized to call described LUA script system, the class sum functions of C++ can also be called under LUA script system.Concrete, the class sum functions of the C++ class that described LUA script system is imported by described LUA ones extend system and interface interchange C++.
Described LUA ones extend system additionally provides heat more new interface, to realize the described LUA script system of run duration heavy duty.That is, in game server software, under can be implemented in non-stop-machine situation, systemic-function is upgraded.
Present invention also offers a kind of operation method of LUA ones extend system, comprise two parts: Part I comprises the described LUA ones extend system call LUA script system of use, Part II comprises the described LUA ones extend system call Object-Oriented Systems of use.
Concrete, as shown in Figure 1, use described LUA ones extend system call LUA script system to comprise the following steps:
S11: prepare LUA script system kit.
S12: the class libraries introducing described LUA ones extend system.
The store path of the script file of S13: setting LUA script system.
Concrete, set described script file store path in an operating system.Described operating system includes but not limited to Android, IOS system of mobile terminal, and the Windows of PC, linux system.
In the present embodiment, described script store path is in an operating system set by the add_package_path interface in described LUA ones extend system.
S14: the global variable obtaining and arrange described script file.
In the present embodiment, obtained the global variable of described script file by the get_global_variable interface in described LUA ones extend system, the global variable of described script file is set by set_global_variable interface.
S15: the script sentence performing described LUA script system.
In the present embodiment, the script sentence of described LUA script system is performed by the run_string in described LUA ones extend system.
S16: the script file performing described LUA script system.
Concrete, the script file of described LUA script system is performed by the load_file in described LUA ones extend system.
S17: the script function calling described LUA script system.
Concrete, the script function of described LUA script system is called by the call interface in described LUA ones extend system.
Described call interface can support general type parameter and general shape parameter, and can support multiple parameter simultaneously, can support at most 9 parameters, and namely these 9 parameters can be general type parameters, also can be general shape parameter.
As shown in Figure 2, described LUA ones extend system call Object-Oriented Systems is used to comprise the following steps:
S21: prepare LUA script system kit.
S22: the class libraries introducing described LUA ones extend system.
The store path of the script file of S23: setting LUA script system.
Concrete, set described script file store path in an operating system.Described operating system includes but not limited to Android, IOS system of mobile terminal, and the Windows of PC, linux system.
In the present embodiment, described script store path is in an operating system set by the add_package_path interface in described LUA ones extend system.
S24: write and need to import to the C++ class in described LUA script system.
S25: import described C++ class in described LUA script system.
The C++ class that the needs write in steps for importing S24 in described LUA script system import.
Described C++ class is imported by the fflua_register_t interface in described LUA ones extend system.
S26: the function importing described C++ class in described LUA script system.
The function of described C++ class is imported by the def interface of fflua_register_t in described LUA ones extend system.
Further, the C++ function of the overall situation can also be imported by described def interface.
The title of total interface is in the present embodiment unique, and in other embodiments of the invention, programming personnel can as required or the title of these interfaces of hobby self-defining, not repeat them here.
To sum up, in a kind of LUA ones extend system provided in the embodiment of the present invention and operation method thereof, described LUA ones extend system in package LUA script system, directly can embed described LUA script system and without the need to relying on other class libraries, improve development efficiency.And friendly object-oriented interface is provided, without the need to understanding the minor details of described LUA script system, alleviating software development burden, improve development efficiency.
Above are only the preferred embodiments of the present invention, any restriction is not played to the present invention.Any person of ordinary skill in the field; in the scope not departing from technical scheme of the present invention; the technical scheme disclose the present invention and technology contents make the variations such as any type of equivalent replacement or amendment; all belong to the content not departing from technical scheme of the present invention, still belong within protection scope of the present invention.

Claims (17)

1. a LUA ones extend system, is characterized in that, described LUA ones extend system in package LUA script system, and provides object-oriented interface.
2. LUA ones extend system as claimed in claim 1, is characterized in that, the dofile operation of described LUA script system of described LUA ones extend system in package, directly to call the script file of described LUA script system.
3. LUA ones extend system as claimed in claim 1, is characterized in that, the described LUA ones extend system in package dosting interface of described LUA script system, directly to call the script sentence of described LUA script system.
4. LUA ones extend system as claimed in claim 1, is characterized in that, the described LUA ones extend system in package function interface of described LUA script system, directly to call the script function of described LUA script system.
5. LUA ones extend system as claimed in claim 4, is characterized in that, a function in described LUA ones extend system can use multiple parameter simultaneously.
6. LUA ones extend system as claimed in claim 5, it is characterized in that, a function of described LUA ones extend system uses nine parameters at most simultaneously.
7. LUA ones extend system as claimed in claim 1, is characterized in that, described LUA ones extend system uses C++ exploitation, provides OO C++ interface.
8. LUA ones extend system as claimed in claim 7, is characterized in that, described LUA ones extend system uses C++ Generic programming, supports general type and the STL type of C++.
9. LUA ones extend system as claimed in claim 1, it is characterized in that, the class of C++ and interface are imported to the interface of described LUA script system by described LUA ones extend system, make described LUA script system invokes application DLL (dynamic link library) API.
10. LUA ones extend system as claimed in claim 1, it is characterized in that, described LUA ones extend system provides heat more new interface, to realize run duration heavy duty LUA script system.
11. 1 kinds, as the operation method of LUA ones extend system as described in any one in claim 1-10, is characterized in that, comprising:
Use described LUA ones extend system call LUA script system; And
Use described LUA ones extend system call Object-Oriented Systems.
The operation method of 12. LUA ones extend systems as claimed in claim 11, is characterized in that, uses described LUA ones extend system call LUA script system to comprise:
Prepare LUA script system kit;
Introduce the class libraries of described LUA ones extend system;
The store path of the script file of setting LUA script system;
Obtain and arrange the global variable of described script file;
Perform the script sentence of described LUA script system;
Perform the script file of described LUA script system;
Call the script function of described LUA script system.
The operation method of 13. LUA ones extend systems as claimed in claim 12, is characterized in that, in the process of script function calling described LUA script system, supports general shape parameter, and can support multiple parameter simultaneously.
The operation method of 14. LUA ones extend systems as claimed in claim 13, is characterized in that, in the process of script function calling described LUA script system, can support nine parameters at most simultaneously.
The operation method of 15. LUA ones extend systems as claimed in claim 12, is characterized in that, in the process of script function calling described LUA script system, can specify rreturn value type, described rreturn value type comprises general type.
The operation method of 16. LUA ones extend systems as claimed in claim 11, is characterized in that, uses described LUA ones extend system call Object-Oriented Systems to comprise:
Prepare LUA script system kit;
Introduce the class libraries of described LUA ones extend system;
The store path of the script file of setting LUA script system;
Write and need to import to the C++ class in described LUA script system;
Described C++ class is imported in described LUA script system;
The function of described C++ class is imported in described LUA script system.
The operation method of 17. LUA ones extend systems as claimed in claim 16, is characterized in that, also comprise: the C++ function importing the overall situation in described LUA script system.
CN201510820935.9A 2015-11-23 2015-11-23 LUA script expansion system and operation method thereof Pending CN105260224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510820935.9A CN105260224A (en) 2015-11-23 2015-11-23 LUA script expansion system and operation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510820935.9A CN105260224A (en) 2015-11-23 2015-11-23 LUA script expansion system and operation method thereof

Publications (1)

Publication Number Publication Date
CN105260224A true CN105260224A (en) 2016-01-20

Family

ID=55099927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510820935.9A Pending CN105260224A (en) 2015-11-23 2015-11-23 LUA script expansion system and operation method thereof

Country Status (1)

Country Link
CN (1) CN105260224A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106647642A (en) * 2016-12-08 2017-05-10 上海维宏电子科技股份有限公司 Method for calling user-defined subprograms by extended M subprograms in numerical control system
CN109992260A (en) * 2019-04-17 2019-07-09 安徽省希灵科技服务有限公司 A kind of auxiliary system for developing software based on Lua scripting language
CN111258588A (en) * 2020-02-26 2020-06-09 杭州优稳自动化系统有限公司 Script execution speed increasing method and device for controlling engineering software

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106647642A (en) * 2016-12-08 2017-05-10 上海维宏电子科技股份有限公司 Method for calling user-defined subprograms by extended M subprograms in numerical control system
CN109992260A (en) * 2019-04-17 2019-07-09 安徽省希灵科技服务有限公司 A kind of auxiliary system for developing software based on Lua scripting language
CN111258588A (en) * 2020-02-26 2020-06-09 杭州优稳自动化系统有限公司 Script execution speed increasing method and device for controlling engineering software

Similar Documents

Publication Publication Date Title
CN110442327B (en) Application program construction method, device and server
CN103744709B (en) patch loading method and device
CN109491695A (en) A kind of increment updating method of integrated Android application
CN103177210B (en) A kind of method implanting dynamic stain analysis module in Android
WO2017185606A1 (en) Overlay mechanism-based apk development method and system
CN104375849B (en) Load the method and device of kernel
US9819758B2 (en) Remote debugging into mobile web applications across devices
US8443084B2 (en) Enhanced upgrade path
CN104636147A (en) Cross-platform mobile application implementation method and cross-platform mobile application implementation system
CN105204913A (en) Method and system for running Linux application on Android operating system and system
CN102289378A (en) Method for automatically generating APP (Application)
CN103365668B (en) A kind of dynamic link library loads and the method, apparatus of link
CN105975816A (en) Method and system for code protection based on virtual technology under mobile terminal
CN102799437B (en) A kind of compilation script automatic generation method and automatically generating device
WO2016078263A1 (en) Upgrading control device and terminal, terminal upgrading method and system, and storage medium
CN103970563A (en) Dynamic Android class loading method
CN105094878B (en) A kind of method and apparatus of integrated system library file
WO2018032653A1 (en) Function implementing method and apparatus for java card application
CN109344619A (en) The hot restorative procedure and device of application program
CN104267981A (en) Method and device for loading application layout on desktop
CN104090765A (en) Method and device for switching from mobile game to webgame
CN101719074A (en) patch-realizing method and device
CN105373381A (en) Method and system for making launchers of mobile terminal
CN103443763A (en) ISA bridging including support for call to overidding virtual functions
CN103793248A (en) Method and device for upgrading application program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160120