September 7, 20169 yr Helo Maarten, There's some coding error in SL_G1000.lua in line 26 (missing bracket ')' ): -- "Slave Server" example LUA plug-in, by Pete Dowson, October 2009 -- To make the Server FS act as a slave, following the Client FS acting as Master -- The SOCKET module is built into FSUIPC, but is not active until "required" local socket = require("socket") -- Set the host name to the name of the PC running this Server local host = "localhost" -- The port must match the port selected in the client and not clash with others. local port = "34568" local function processdata(data) -- decode string, format is lvarname,lvarvalue,isstring (0 or 1) local index1 = 1 local index2 = string.find(data, ",") local lvarname = string.sub(data, index1, index2 - 1) index1 = index2 + 1 index2 = string.find(data, ",", index1) local lvarvalue = string.sub(data, index1, index2 - 1) local lvarisstring = string.sub(data, index2 + 1) if lvarisstring == "1" then for i = 1, 6 do if (string.len(lvarvalue) >= i then ////here exactly - error when parsing/// ipc.writeLvar("SLX_StringValue" .. i, string.byte(lvarvalue, i) else ipc.writeLvar("SLX_StringValue" .. i, 0) end end else ipc.writeLvar("SLX_" .. lvarname, tonumber(lvarvalue)) end ipc.writeLvar("SLX_" .. lvarname .. "_Set", 1) end local server = assert(socket.bind(host, port)) local ack = "<EOF>" while 1 do print("slx_fs9gps_server: waiting for client connection...") local control if (server ~= nil) control = server:accept() else control = nil if control ~= nil then print("slx_fs9gps_server: client connected!") while 1 do local data = control:receive() if data == nil then print("slx_fs9gps_server: client disconnected") -- ipc.control(65794) -- Pause FS break end else local index = string.find(data, "<EOF>") if index ~= nill then data = string.sub(data, 1, index - 1) if data == "ping" then assert(control:send("ping<EOF>")) else assert(control:send(ack)) processdata(data) end end end end end end Best wishes, Darek Czarnecki Dariusz
September 7, 20169 yr Hi Darek, Well spotted! Fortunately this .lua file is not yet used. Some GPS variables are missing in the SimConnect API and I will use this .lua file (together with the SLX_G1000.CAB gauge) to workaround this issue when I have made some more progress with the implementation of the G1000 PFD and MFD. thanks, Maarten Maarten Boelens ([m][a:][R][t][ʏ][n]) Developer of SimLauncherX
September 7, 20169 yr Author Sounds clear for me You're doing a fantastic job. Thanks for Your tremendous work, I really appreciate that a lot. All the best, Darek Czarnecki Dariusz
Create an account or sign in to comment