Releases: Panakotta00/FicsIt-Networks
0.3.31
Game Update Support
This patch introduces fixes for FIN to work with the latest game update.
It also fixes a bunch of issues with the new Runtime and adds a few new features.
Change Log:
- Adds
FINRestartAllComputers
Console Command - Adds
FINLocateComputer <UUID | Internal Name>
Console Commands - Lua
- Fixes computer crash at game load because Global Serialization failure
- Fixes
computer.reset()
- Fixes
computer.stop()
0.3.30
Another Hotfix
Change Log:
- Fix Crash trying to place various modules on dedicated server
- Fix various game freezes related
computer.promote()
- Fix performance problems in lua runtime
- Fix Game Crash on using
computer.panic()
and various other error handling related crashes
0.3.29
Hotifx
Change Log:
- Lua
- Re-Adds FileSystem API
0.3.28
Lua Runtime Overhaul
The Lua runtime code got an massive overhaul and modularizing different systems.
The main purpose is to pave the way for FIVS and Microcontrollers.
This effectively rewrite also improves on some systems like the event system and timeouts.
When having multiple tasks waiting for events, the lua runtime will not busy wait anymore, instead its a proper runtime stop till the timeout is reached or an event occured. Improving performance on code that waits for events or sleeps.
Also the Lua Tick Timeout mechanism got an improvement. You may have encountered a "tried to yield across C-call boundary" error when working with functions like gsub or xpcall.
Instead of the error occuring, the runtime will give your code a second chance. It will give you at least (currently) 2500 Lua instructions and at least 1s to reach a yieldable runtime state. If you fail to do so, the runtime will error with an bit more expressive error message.
Since this behaviour is aware if your runtime "happens to be not yieldable" when the default hook is reached, and adjust accordingly, you should encounter the issue a lot less often.
Besides these changes to the Runtime, especially internally, the Syntax Highlighter has been fully rewritten and should now support all of Lua syntax, most notably correct block comments and string blocks.
Change Log:
- New Lua Syntax Highlighter
- Lua
- Runtime Overhaul
- Futures can provide timeout value which may cause runtime to sleep
- Tick Hooks are smarter and give you a second chance in the case the first hook triggered in non-yieldable code
- Event API
- Adds
loop
function
- Adds
0.3.27
Hotfix
This update simply provides some Hotfixes.
Change Log:
- Lua
- Persistency Failure Message adjustmen
- event.pull() return value fixes (hopefully)
- some crash fixes
- findClasses warning is more explicit
0.3.26
Hotfix
Change Log:
- Lua
- Fixes return values of coroutine.resume in the case of coroutine.yield
- Introduces new Bugs
0.3.25
Advanced Event Handling
This update introduces advanced new ways of working with Signals/Events!
These new features heavily rely on the new additions from the last couple updates like futures and event filters.
Event Duplication & Handling
Events only get processed for these advanced features when you call event.pull()
.
event.pull()
will operate like usual, but it will additionally internally duplicate the event data and process them for the new features.
That means when the user wants to use these new features, he has to let them be processed by looping and calling event.pull()
.
To make this easier for people that dont need to low level access event.pull()
provides (and further stuff like, yielding and task scheduling),
there is now an helper function event.loop()
which will be the equivalent to:
while true do
local e = event.pull(0)
future.run()
if not e then
computer.skip()
end
end
Event Listeners
You can now globally register Event Listeners. These are functions associated with an event filter. When the computer receives a signal it will check if the event matches the event filter. If this is the case, it will create a a new task based on the function you passed to the registration, and as function parameters you get the event parameters.
To register an Event Listener you have to use the global event.registerListener(EventListener, function)
function.
local btn = ...
local switch = ...
event.registerListener({sender=btn}, function(event, sender, p1, p2, ...)
print("Event1: ", event, sender, p1, p2, ...)
end)
event.registerListener(event.filter{sender=switch} + event.filter{State=true}, function()
print("Event2")
end)
event.loop()
Event One-Shots
You can also now create futures that resolve only once a signal that matches the given event filter is matched.
This essentially allows you to easily halt program execution and wait for user input. The future it self will return the event parameters.
You can use the event.waitFor(EventFilter) -> Future
function to create such future.
local okbtn = ...
local cancelbtn = ...
print("Are you sure you want to continue?")
local ok, cancel = future.first(event.waitFor{sender=okbtn}, event.waitFor{sender=cancelbtn})
if ok then
print("Then lets continue!")
else
print("Cancel the continuation...")
end
Event Queues
Event Queues allow you to record and filter events that occur in its life-time.
You can create an Event Queue using the global event.queue(EventFilter) -> EventQueu
function.
The queue will from then on record all events that occur and that match the given filter. Its always best to use a filter that lets through as few events as your actually need. For memory and performance reasons. The queue is hard limited to 250 entries.
You can then use the pull([timeout])
and waitFor(EventFilter)
member functions. These functions operate similar to their global counter parts, but instead of operating on the global event system, these here operate on the event queue.
Its important to mention that waitFor
will pull as many events as it can until it finds a event that matches its filter. So its not reccomended to run two or more waitFor
or pull
at the same time.
The pull
function is essentially a shorthand for the following function:
function queue:pull(timeout)
local _, e = future.first(self:waitFor{}, future.sleep(timeout)):await()
if e then
return table.unpack(e)
end
end
Change Log
- Lua
- Futures can now be closed (cancelled)
event
Library- Added
registerListener
function - Added
waitFor
function - Added
queue
function - Added
loop
function
- Added
- Added
EventQueue
Type- Added
pull
function - Added
waitFor
function
- Added
- Removes some more bugs
- Added new bugs
0.3.24
Event Filters
This update mainly introduces Event Filters.
These event Filters are special structs that you can use to filter event parameters.
local f1 = event.filter{sender=someSender, event="SomeEvent", values={someParameterName="someExpectedValue"}}
local f2 = event.fitler{sender=someOtherSender}
local f3 = f1 * f2 -- an AND link (both filters have to match)
local f4 = f1 + f2 -- an OR link (one of the filters has to match)
local f5 = -f1 -- an negation link (the filter is not allowed to match)
local f5 = f3 + f4 * f5 -- you can essentially express complex conditions this way
while true do
local e = {event.pull()}
if f1:matches(table.unpack(e)) then
print("The event matches f1")
end
if f5:matches(table.unpack(e)) then
print("The event matches the complex filter f5")
end
end
Change Log:
- New Event-Filters
- Improved GPU Screen Size caching and evaluation
- Lua
event
Library- Added
filter
function
- Added
- Reflection
- Added "EventFilter" Struct
- Added Multiplication Operator (AND)
- Added Addition Operator (OR)
- Added Negation Operator (NOT)
- Added Bitwise AND Operator
- Added Bitwise OR Operator
- Added Bitwise NOT Operator
- Added
matches
Function
- Added "EventFilter" Struct
- Various Multiplayer Bug Fixes
- Other Bug Fixes
- Added new Bugs for you to find :3
v0.3.23
Futures Update
This update overhauls the already existing futures and expands upon them with an async/await system.
This update also makes all reflection functions to return their values.
Previously "Sync-Only" functions and properties returned a future that you had to :await()
to get the value you actually wanted.
Now, these functions and properties will await automatically.
A new global future
API has been added that makes working futures easier.
To create your own futures from functions you can also use the global async(function() ... end)
function.
This system also allows us to finally add a default sleep
function!
There will be an detailed docmentation later once the next steps of the new APIs are done.
Change Log:
- Reflection:
- Sync-Only functions now auto-await
- Lua
- Added global
async
function - Added global
sleep
function - Added global
future
Library- Added
sleep
function - Added
async
function - Added
join
function - Added
addTask
function - Added
tasks
table field - Added
run
function - Added
loop
function
- Added
- Added global
- Some more bug-fixes
- Add new bug-fixes
v0.3.22
Dedicated Server Support
Change List:
- Windows Dedicated Server Support
- Linux Dedicated Servver Support
- Multiplayer Bug Fixes
- New
-FINGenDocAndQuit
command line argument - New
-FINOverwriteFS
and-FINKeepFS
command line arguments - FileSystem
- Some major inernal changes
- Removed
tmpfs
- Reflection API
Inventory
- Removed multiple warnings due to previous issues with item updates.
- Added
canSplitAtIndex
function - Added
splitAtIndex
function
TrainPlatform
- Added
getAllConnectedPlatforms
function
- Added
- Some more Bug Fixes
- Added new Bugs