Skip to content

Instantly share code, notes, and snippets.

@Troxid
Troxid / crossout.py
Created March 16, 2019 22:32
Crossout as a Service
import BaseHTTPServer
port = 9999
class HttpHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-Type', 'text/plain')
self.end_headers()
import akka.typed._
import akka.typed.ScalaDSL._
import akka.typed.AskPattern._
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.concurrent.Await
sealed trait PingPong
from enum import Enum
State = Enum("State", "Locked Unlocked Working")
Event = Enum("Event", "Push Coin Nop")
class Turnstile():
def __init__(self):
struct Server{
out_buffer: Vec<String>,
in_buffer: Vec<String>,
...
}
impl Server {
fn send(&mut self, msg: String){
self.in_buffer.push(msg);
}