Skip to content

Commit adad477

Browse files
authored
Add login system
The commit brings the login and logo rendering systems. Also, it's exposed an example of depth-buffer usage.
1 parent 59ff3a0 commit adad477

File tree

93 files changed

+2079
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2079
-0
lines changed
35.5 KB
Binary file not shown.
33.1 KB
Binary file not shown.
46.6 KB
Binary file not shown.

sp_login/_compile.lua

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
local _writeScript = function ( responseData, errno, filepath )
2+
if errno > 0 then
3+
outputDebugString ( "Произошла ошибка " .. errno, 2 )
4+
return
5+
end
6+
7+
local file = fileCreate ( filepath )
8+
if file then
9+
fileWrite ( file, responseData )
10+
fileClose ( file )
11+
else
12+
outputDebugString ( "Файл не создается!", 2 )
13+
end
14+
end
15+
16+
function compileScript ( filepath )
17+
local filename = gettok ( filepath, 1, 46 )
18+
19+
local file = fileOpen ( filepath, true )
20+
if file then
21+
local content = fileRead ( file, fileGetSize ( file ) )
22+
fileClose ( file )
23+
fetchRemote ( "http://luac.mtasa.com/?compile=1&debug=0&blockdecompile=1&encrypt=1", _writeScript, content, true, filename .. ".tct" )
24+
end
25+
end
26+
27+
function compileAllScripts ( )
28+
local xml = xmlLoadFile ( "meta.xml" )
29+
if xml == false then
30+
outputDebugString ( "Meta.xml не был найден!", 2 )
31+
return
32+
end
33+
34+
local node
35+
local index = 0
36+
local _next = function ( )
37+
node = xmlFindChild ( xml, "script", index )
38+
index = index + 1
39+
return node
40+
end
41+
42+
local num = 0
43+
while _next ( ) do
44+
if xmlNodeGetAttribute ( node, "special" ) == false then
45+
local filepath = xmlNodeGetAttribute ( node, "src" )
46+
compileScript ( filepath )
47+
num = num + 1
48+
end
49+
end
50+
51+
outputDebugString ( "Собрано " .. num .. " скриптов" )
52+
end
53+
54+
addCommandHandler ( "compile",
55+
function ( )
56+
compileAllScripts ( )
57+
end
58+
)

0 commit comments

Comments
 (0)