mia389 Posted August 4, 2011 Posted August 4, 2011 Great to hear speed. I have been away for a couple of weeks. Does this mean I will not have to edit all my missions and clients will just have to install a mod now?
Speed Posted August 4, 2011 Author Posted August 4, 2011 Great to hear speed. I have been away for a couple of weeks. Does this mean I will not have to edit all my missions and clients will just have to install a mod now? You have to edit the missions (takes about 20-40 mins each), but as always, only the host needs to have the mod installed. Nothing runs on the client, so nothing is required on a client. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Druid_ Posted August 4, 2011 Posted August 4, 2011 Nice one Speed. It may be quite some time before we see the next patch so in the meantime this will help the MP environment greatly. i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Speed Posted August 4, 2011 Author Posted August 4, 2011 Ok, for the new mod, I've now figured out how to put Luasocket into an unprotected Lua environment. Does anyone have a simple programming example where data is sent and can be accessed by another Lua environment on the same machine? Everything I've seen is using ports, which makes me think that it is going between two different computers, but bearing in mind that I know nothing about network programming, maybe you have to use ports even when you're not sending data over a network? Even if I can't get rid of the daemon altogether, with Luasocket I can pass large quantities of data at least, such as the mission events table, and speed up communication between unprotected environments. Maybe I can make safe functions that will pass data into and out of protected environments. Still need some experimentation, but if I an get a simple data transfer going between unprotected environments, that should be enough for me to figure out if I can make it work between protected environments. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
GGTharos Posted August 4, 2011 Posted August 4, 2011 All TCP/IP and UDP/IP communication uses ports. There is no choice in the matter, it is how the protocols function. Choose a port number above 1024 (the lower 1024 are reserved for system services) that does not conflict with other things. Eg: 10308 is used by DCS/FC. BT has its own range of ports, etc. In general, you should be save with almost anything above 10000 (Max is 2^16 ... ) [sIGPIC][/sIGPIC] Reminder: SAM = Speed Bump :D I used to play flight sims like you, but then I took a slammer to the knee - Yoda
miguelaco Posted August 4, 2011 Posted August 4, 2011 Everything I've seen is using ports, which makes me think that it is going between two different computers, but bearing in mind that I know nothing about network programming, maybe you have to use ports even when you're not sending data over a network? It is ok. You can use TCP or UDP locally. Just use localhost or 127.0.0.1 as destination address and you're done.
ivanwfr Posted August 4, 2011 Posted August 4, 2011 I'm not sure but just in case it's what you're looking for, here is the simplest way to transmit something from one process to another on a single system: -- socket_send.lua {{{ local host,port = "localhost", 15001 local socket = require("socket.core") local ip = socket.dns.toip(host) local udp = socket.udp() local cmd = "" for i=1, 5 do cmd = "line #"..i udp:sendto(cmd, ip, port) end cmd = "quit" udp:sendto(cmd, ip, port) udp:close() -- }}} -- socket_receive.lua {{{ local host,port = "localhost", 15001 local socket = require("socket.core") local ip = socket.dns.toip(host) local udp = socket.udp() udp:setsockname(ip, port) local cmd = "" while cmd ~= "quit" do cmd, err = udp:receive() if err then print( string.format("err=[%s]", err) ) else print( string.format("cmd=[%s]", cmd) ) end end udp:close() 1
Speed Posted August 4, 2011 Author Posted August 4, 2011 I'm not sure but just in case it's what you're looking for, here is the simplest way to transmit something from one process to another on a single system: Thanks! I'll try out some variations of this tonight. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Speed Posted August 22, 2011 Author Posted August 22, 2011 (edited) How could I be so blind? I guess I was busy with real life stuff, but that still doesn't excuse it. RIGHT THERE under the main scripting folder is a new file, called "MissionScripting.lua". DOH! I just had figured that this new environment had been defined in C or something... anyway, I still don't get how it's done. Somehow, MissionScripting.lua has access to many things in the server/main environment (but not everything?), and only passes down classes?? Anyway, I can bring the equivalent of the print function back into the mission scripting environment by doing this: Original MissionScripting.lua --Classes dofile('Scripts/Common/LuaClass.lua') class(Object) class(Unit, Object) class(Group) class(Controller) New MissionScripting.lua: --Classes dofile('Scripts/Common/LuaClass.lua') class(Object) class(Unit, Object) class(Group) class(Controller) output = { mprint = print } class(output) Now, there will be a class in the Mission Scripting environment called "output" with a member function called "mprint" that does the same thing as print. Tested and verified: 00056.774 DEBUG wWorld::initMissionScripting: testing from unit scripted action? I tried this: class(trigger) to bring back the function "trigger.setUserFlag", and it didn't work- "trigger" is nil (not defined). Additionally, to bring back os.time I tried: safe_os = { time = os.time } class(safe_os) And os is nil. Anyone understand what the heck is going on here? Anyway, I have no intention of trying to bring back an unsecured function in a mod to MissionScripting.lua, I've moved beyond that now. But I may use this (or a simpler method) to bring back a version of print. Edited August 22, 2011 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
WildFire Posted August 22, 2011 Posted August 22, 2011 You read this crap likes it english. I swear it looks like greek to me.
Speed Posted August 22, 2011 Author Posted August 22, 2011 (edited) You read this crap likes it english. I swear it looks like greek to me. I would imagine that it looks like Greek, as even your English isn't that good... haha, just poking fun. Not saying mine is any better or worse. ;) Edited August 22, 2011 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Ripcord Posted August 22, 2011 Posted August 22, 2011 If he is at all like me, then his english is fine - only his typing is crappy. [sIGPIC][/sIGPIC]
WildFire Posted August 23, 2011 Posted August 23, 2011 haha, yeah rip, exactly. I was trolling entirely too much and as post count goes up grammar goes down. Go figure..
Ripcord Posted November 12, 2011 Posted November 12, 2011 Speed, when I saw the new patch was out, I purposes searched and dug up this thread. Want to know if there is any change or new developments in writing scripts or saving any data from mission to mission. [sIGPIC][/sIGPIC]
Recommended Posts