level 3
💧后🌈
楼主
function start()
local mysql = require "luasql.mysql"
local file=io.input("./conf/realms.conf")
local str=io.read("*a")
file:close()
local t = {}
for v in string.gmatch(str,"\"([A-Za-z0-9_.]+)\"") do --看不懂
table.insert(t,v) --看不懂
end
envt = assert(mysql.mysql())
conn = assert(envt:connect(t[10],t[8],t[9],t[7],t[11])) --尤其这段看不懂
conn:execute"SET NAMES utf8"
end
realms.conf代码如下:
<LogonServer Address = "127.0.0.1" Port = "17991" Name = "Default Logon" RealmCount = "1">
<MonitorServer Address = "0.0.0.0" Port = "54082" Enable = "0">
<WorldDatabase Hostname = "127.0.0.1" Username = "root" Password = "123456" Name = "game" Port = "3306">
<Realm1 Name = "test"
Address = "10.1.1.100:60816"
Icon = "PVP"
Population = "1.0"
TimeZone = "1">
2016年03月23日 01点03分
1
local mysql = require "luasql.mysql"
local file=io.input("./conf/realms.conf")
local str=io.read("*a")
file:close()
local t = {}
for v in string.gmatch(str,"\"([A-Za-z0-9_.]+)\"") do --看不懂
table.insert(t,v) --看不懂
end
envt = assert(mysql.mysql())
conn = assert(envt:connect(t[10],t[8],t[9],t[7],t[11])) --尤其这段看不懂
conn:execute"SET NAMES utf8"
end
realms.conf代码如下:
<LogonServer Address = "127.0.0.1" Port = "17991" Name = "Default Logon" RealmCount = "1">
<MonitorServer Address = "0.0.0.0" Port = "54082" Enable = "0">
<WorldDatabase Hostname = "127.0.0.1" Username = "root" Password = "123456" Name = "game" Port = "3306">
<Realm1 Name = "test"
Address = "10.1.1.100:60816"
Icon = "PVP"
Population = "1.0"
TimeZone = "1">