Files
chuanqi-server-instance/LogicServer/data/language/LangCode.txt
aixianling 00ee9dd8ea init
2024-12-16 13:51:31 +08:00

32 lines
952 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--#ifndef _LANGUAGE_INCLUDED_
--#define _LANGUAGE_INCLUDED_
--[[
miros 2011-04-10
加入Lang变量是否已经定义的判断。
由于每个脚本和配置都包含这个文件导致脚本内存开销极大。仅语言包自身就占据2M-3M内存
加之有数百个NPC将导致语言包占据数百兆内存也严重影响配置和脚本的加载效率。
目前的解决方案是在程序中单独读取语言包配置并导出到每个脚本中作为userdata并设置__index
原方法关联读取函数。使得整个游戏中针对脚本加载数据以及加载的NPC脚本都不会再次读取语言配
置,从而减少内存使用并加快启动速度!
]]
if not OldLang then
--简体
--#if LANGUAGE == zh-CN
--#include "Zh-CN\Zh-CN.txt" once
OldLang = zh_CN
--#endif
--选择繁体
--#if LANGUAGE == zh-TW
--#include "Zh-TW\Zh-CN.txt" once
OldLang = zh_CN
--#endif
end
--#endif