Unlock instant, AI-driven research and patent intelligence for your innovation.

Lua script file management method by using package system

A technology of script files and management methods, applied in the field of lua script file management, can solve the problems such as limitations that cannot be used directly, no association relationship, unfavorable program logic relationship, etc., to ensure the efficiency of memory usage and execution, and maintain compatibility. Effect

Active Publication Date: 2014-12-10
ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 2. Different lua scripts need to be able to communicate with each other and must maintain a certain degree of independence
[0005] Lua itself provides a certain mechanism to manage multiple lua script files, but it has serious limitations that prevent it from being directly used in game products:
[0006] 1. Although lua itself provides a module mechanism, which can ensure that a script file is loaded once, objects with the same name in different files will conflict with each other;
[0007] 2. There is no obvious relationship between different files, which is not conducive to the organization of program logic relationships

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Lua script file management method by using package system
  • Lua script file management method by using package system
  • Lua script file management method by using package system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0034] The technical solution of the present invention utilizes a package mechanism to manage each lua script file, and each different lua script file corresponds to a package, wherein the package is a container for object names in a program, and the object is a data structure in the program or the entity of the function. Each package is identified by a number (ID). In a preferred embodiment, the package ID is an integer greater than or equal to 0, that is, the number starts to increase from 1.

[0035] Each package has its own independent name space, that is, the mapping table of object names and objects. The present invention also includes a unified filename-to-package package table, which is a key-value type mapping table for mapping from script filenames to corresponding packages, and is used to retrieve packages in the present invention .

[0036] In the present invention, the packages are configured to be independent of each other, but a one-way link can be established...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a Lua script file management method by using a package system. In the method, each Lua script file corresponds to a package and each package is allocated with an unique identification (ID) and provided with a parents table for storing IDs of packages contained in the current package and a name table for storing names of objects cited by the current package; and the packages are further configured to mutual independence among the packages and one-way connections called 'include' are created among the packages through a specific application program interface (API). Compared with the prior art, the method provided by the invention has the advantages that the memory use efficiency and the execution efficiency are guaranteed, objects with the same names in different files cannot conflict mutually, different Lua script files can be communicated by data sharing through a specific mechanism, and the compatibility is still remained in grammar level.

Description

technical field [0001] The invention relates to a script language, in particular to a lua script file management method using a package mechanism. Background technique [0002] On the server side and client side of online games, it is usually necessary to apply lua scripting technology. These lua codes are usually distributed in a large number of lua scripts, so these lua scripts need a mechanism to manage them. This mechanism needs to meet the following requirements: [0003] 1. Can manage multiple lua scripts, these lua scripts must be loaded in the same lua virtual machine for communication; [0004] 2. Different lua scripts need to be able to communicate with each other and must maintain a certain degree of independence. [0005] Lua itself provides a certain mechanism to manage multiple lua script files, but it has serious limitations that prevent it from being directly used in game products: [0006] 1. Although lua itself provides a module mechanism, which can ens...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F17/30
Inventor 王斌
Owner ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD