rahix
22328f313d
Add fallback when uuid is not available
...
If the `uuid` module does not exist, fall back to a primitive ID
generation mechanism based on just math.random(). The fallback
mechanism provides the same amount of entropy so we can be sure this
won't degrade quality of the identifiers.
5 years ago
rahix
e2da98fbf4
Fallback to os.clock() if computer.uptime() is not available
...
To be compatible with systems that don't have computer.uptime(), use
os.clock() as a fallback. The time is only used for timeout
calculations.
5 years ago
rahix
67cbb5badc
Move serialization import into network implementation
...
The (default) network implementation is the only place where
`serialization` is used. Thus, move the import into its constructor so
we don't unnecessarily load the module unconditionally.
5 years ago
rahix
0d852d7aac
Make cleanup more robust
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
af97600952
Actually include bit32
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
13b8fe9cea
Use bit32 for Lua 5.2 compatibility
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b44f63a1bb
Use bit32 for lua 5.2 compat
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c27e889d45
Cancel listeners when closing
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
11babfad9e
Cleanup
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
2b935b87e4
Add timeout to call_sync
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
253e04ff5d
Implement batch register
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e8ec24dacc
Small refactor
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
50ae923ef7
Add late installed listeners
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c33fdd41a6
Implement listen cancelling
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
719201e950
Implement listening
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
8fb07e22cc
Implement close()
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
1a9422af7d
Better errors and return codes
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c6f019f271
No reannouncing self
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
28a52cfd7d
Only announce if bc has names
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b9c3674755
Actually make bc timeout
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
9f10348b58
Implement finalize
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
1b73d0d04c
Make get and call_sync error
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
0eed392d6e
Fix pull-filters
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
888ad288af
Implement call_sync
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e4f19c3e20
Implement simple verb calling
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
da6c36922b
Add get and pull
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
7063e7445d
Basic network
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
e328ae0ab9
Improve table hierarchy
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
f9a14ecaeb
Implement set and call
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
3508870c7f
A new beginning
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
b205779a29
Rewrite attempt 1
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
3c4920489a
Cleanup
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
c3ce5b0ac8
Fix some variables being non-local
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
rahix
fa0c331f8e
Make testable version work in-game
...
Signed-off-by: Rahix <rahix@rahix.de>
7 years ago
Rahix
4dd809ba03
Add cleanup function
7 years ago
Rahix
20c8c7426f
Make oc-basecontrol more robust
...
- Allow init without params
- Remove errors, instead indicate failures with return values
- Add has_noun and has_verb
- Allow late init of listeners
9 years ago
Rahix
45904104f7
Add remote listening cancelling
9 years ago
Rahix
06d37428b6
Implement noun listening
...
- Replace queue with list
9 years ago
Rahix
5beb83ba9e
First part of rewrite
...
- Fix serializer to work outside OC
9 years ago
Rahix
b17d044bb5
Initial
9 years ago