This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Most of this came from the blog article here: | |
-- https://lettier.github.io/posts/2016-04-26-lets-make-a-ntp-client-in-c.html | |
-- For reference, the packet structure looks like: | |
--[[ | |
typedef struct | |
{ | |
unsigned li : 2; // Only two bits. Leap indicator. | |
unsigned vn : 3; // Only three bits. Version number of the protocol. | |
unsigned mode : 3; // Only three bits. Mode. Client will pick mode 3 for client. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local saga = require('lib.saga') | |
local function switch_scene(self, next_scene) | |
-- Unload the current scene (if there is one) | |
if self.scene then | |
local proxy_id = '#' .. self.scene | |
print('Unloading proxy: ' .. proxy_id) | |
msg.post(proxy_id, 'disable') | |
msg.post(proxy_id, 'final') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
local traceback = debug.traceback | |
local yield = coroutine.yield | |
local resume = coroutine.resume | |
local create = coroutine.create | |
local status = coroutine.status | |
function M.create(f, ...) | |
local co = create(f) |