forked from organization/boundstone
-
Notifications
You must be signed in to change notification settings - Fork 1
/
boundstone.v
43 lines (41 loc) · 1.15 KB
/
boundstone.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// import sync
import bstone
import vraklib
import term
import os
import sync
// mut running := true
// TODO: serversettings
fn main() {
println('Hellauuu')
// Data share
// channel or sth here
mut ch1 := chan vraklib.OpenSessionData{}
mut ch2 := chan vraklib.HandleEncapsulatedData{}
mut ch3 := chan vraklib.PutPacketData{}
// raklib = vraklib.VRakLib { address: address }
address := '0.0.0.0:19132'
mut raklib := vraklib.new_vraklib(address)
raklib.start(ch1, ch2, ch3)
mut server := bstone.new_server(address: address) // or { panic(err) }
server.start()
// go raklib.start(ch1, ch2, ch3)
// start terminal
// available colors are: black,blue,yellow,green,cyan,gray,bright_blue,bright_green,bright_red,bright_black,bright_cyan
term.clear()
// width, height := term.get_terminal_size()
// term.hide_cursor()
// term.set_cursor_position(x: 0, y: height)
println(term.bg_black(term.red(term.bold('■ boundstone MCPE v0.0.2 ■'))))
// TODO dynamic version string
mut read_line := os.input('> ')
for {
if read_line == 'stop' {
break
} else {
read_line = os.input('> ')
}
}
println(term.warn_message('Shutting down..'))
server.stop()
}