mirror of https://github.com/Askill/r_place.git
adedd reconnect to client
This commit is contained in:
parent
9668282ec3
commit
750678ed82
|
|
@ -0,0 +1,16 @@
|
|||
#FFFFFF
|
||||
#E4E4E4
|
||||
#888888
|
||||
#222222
|
||||
#FFA7D1
|
||||
#E50000
|
||||
#E59500
|
||||
#A06A42
|
||||
#E5D900
|
||||
#94E044
|
||||
#02BE01
|
||||
#00D3DD
|
||||
#0083C7
|
||||
#0000EA
|
||||
#CF6EE4
|
||||
#820080
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<template>
|
||||
<canvas id="main_canvas" height="1000" width="1000"> </canvas>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h3 {
|
||||
margin: 40px 0 0;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
canvas { border: 1px solid black; }
|
||||
</style>
|
||||
|
|
@ -59,8 +59,9 @@ def closest_match(rgb, color_map):
|
|||
return min(range(len(rgb_colors)), key=lambda i: eucleadian_distance(rgb, color_map[i]))
|
||||
|
||||
async def sender(img):
|
||||
while True:
|
||||
try:
|
||||
async with websockets.connect("ws://localhost:8080/set", timeout=60) as websocket:
|
||||
|
||||
while True:
|
||||
rx = random.randint(0, 999)
|
||||
ry = random.randint(0, 999)
|
||||
|
|
@ -75,7 +76,8 @@ async def sender(img):
|
|||
succ = await websocket.recv()
|
||||
if succ != "0":
|
||||
print(message, "was not set")
|
||||
|
||||
except:
|
||||
print("reconnecting")
|
||||
|
||||
|
||||
async def client():
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
Loading…
Reference in New Issue