msg to apply patch on server

msg to apply patch on server

type Modeler.Shared.modeler = {
  scene: Scene.scene;
  address: string;
  clients: list(channel(Central.Modelers.sync.message))
} ;

@server SHF : Fresh.next(int) = Fresh.server((i -> i : int));

@server `Modeler.Shared` = {{

  empty(server_id, address) : Modeler.Shared.modeler =
    { scene=Scene.empty(SHF, server_id); ~address; clients=List.empty };

  add_client(modsha, client) : Modeler.Shared.modeler =
    do Session.send(client, { load=modsha.scene });
    { modsha with clients=List.cons(client, modsha.clients) };

  apply_patch(modsha, patch) : Modeler.Shared.modeler =
    do Log.info("Modeler.Shared", "a patch as been apply for address '{modsha.address}'");
    { modsha with scene=Scene.apply_patch(modsha.scene, patch) };

}}

type Central.Modelers.state = { my_id: int; files: stringmap(Modeler.Shared.modeler) };
type Central.Modelers.message =
  { register; scene_url: string; sync_channel: channel(Central.Modelers.sync.message); client_id: int }
/ { apply_patch; patch: Scene.patch; address: string };

type Central.Modelers.sync.message = { load: Scene.scene };

@server `Central.Modelers` = {{
  empty() : Central.Modelers.state = { my_id=SHF(); files=StringMap.empty };

  find_file(state, address) = StringMap.get(address, state.files);

  get_file(state, address) : Modeler.Shared.modeler = match find_file(state, address) with
    | {some=hit} -> hit
    | {none} ->
      scene = Scene.empty(SHF, state.my_id);
      scene = Scene.add_object(scene, Scene.cube(scene, (0.0, 0.0, -3.0)));
      scene = Scene.add_object(scene, Scene.cube(scene, (3.0, 0.0, 0.0)));
      scene = Scene.add_object(scene, Scene.cube(scene, (6.0, 0.0, 0.0)));
      { `Modeler.Shared`.empty(state.my_id, address) with ~scene }
    end;

  update_file(state, address, f) : Central.Modelers.state =
    modsha = get_file(state, address);
    { state with files=StringMap.add(address, f(modsha), state.files) };

  apply_patch(state, address, patch) : Central.Modelers.state =
    f(modsha) = `Modeler.Shared`.apply_patch(modsha, patch);
    update_file(state, address, f);

}}

@server central_modelers : channel(Central.Modelers.message) =
  on_message(state : Central.Modelers.state, message) = match message with
    | { register; ~scene_url; ~sync_channel; ~client_id } ->
      do Log.info("CM", "register for url '{scene_url}'");
      state =
        up(modsha) = `Modeler.Shared`.add_client(modsha, sync_channel);
        `Central.Modelers`.update_file(state, scene_url, up);
      { set=state }
    | { apply_patch; ~patch; ~address } ->
      state = `Central.Modelers`.apply_patch(state, address, patch);
      { set=state }
    end;
  Session.make_dynamic(`Central.Modelers`.empty(), on_message);

type Modeler.Shared.modeler = {
  scene: Scene.scene;
  address: string;
  clients: list(channel(Central.Modelers.sync.message))
} ;

@server SHF : Fresh.next(int) = Fresh.server((i -> i : int));

@server `Modeler.Shared` = {{

  empty(server_id, address) : Modeler.Shared.modeler =
    { scene=Scene.empty(SHF, server_id); ~address; clients=List.empty };

  add_client(modsha, client) : Modeler.Shared.modeler =
    do Session.send(client, { load=modsha.scene });
    { modsha with clients=List.cons(client, modsha.clients) };

  apply_patch(modsha, patch) : Modeler.Shared.modeler =
    do Log.info("Modeler.Shared", "a patch as been apply for address '{modsha.address}'");
    { modsha with scene=Scene.apply_patch(modsha.scene, patch) };

}}

type Central.Modelers.state = { my_id: int; files: stringmap(Modeler.Shared.modeler) };
type Central.Modelers.message = { register; scene_url: string; sync_channel: channel(Central.Modelers.sync.message); client_id: int };

type Central.Modelers.sync.message = { load: Scene.scene };

@server `Central.Modelers` = {{
  empty() : Central.Modelers.state = { my_id=SHF(); files=StringMap.empty };

  find_file(state, address) = StringMap.get(address, state.files);

  get_file(state, address) : Modeler.Shared.modeler = match find_file(state, address) with
    | {some=hit} -> hit
    | {none} ->
      scene = Scene.empty(SHF, state.my_id);
      scene = Scene.add_object(scene, Scene.cube(scene, (0.0, 0.0, -3.0)));
      scene = Scene.add_object(scene, Scene.cube(scene, (3.0, 0.0, 0.0)));
      scene = Scene.add_object(scene, Scene.cube(scene, (6.0, 0.0, 0.0)));
      { `Modeler.Shared`.empty(state.my_id, address) with ~scene }
    end;

  update_file(state, address, f) : Central.Modelers.state =
    modsha = get_file(state, address);
    { state with files=StringMap.add(address, f(modsha), state.files) };

  apply_patch(state, address, patch) : Central.Modelers.state =
    f(modsha) = `Modeler.Shared`.apply_patch(modsha, patch);
    update_file(state, address, f);

}}

@server central_modelers : channel(Central.Modelers.message) =
  on_message(state : Central.Modelers.state, message) = match message with
    | { register; ~scene_url; ~sync_channel; ~client_id } ->
      do Log.info("CM", "register for url '{scene_url}'");
      state =
        up(modsha) = `Modeler.Shared`.add_client(modsha, sync_channel);
        `Central.Modelers`.update_file(state, scene_url, up);
      { set=state };
  Session.make_dynamic(`Central.Modelers`.empty(), on_message);


move post_form() into scope of newpost()

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/thoughtpolice/opaque.git/'


wibbles

wibbles


manage fixed 2

manage fixed 2

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/arithehun/frc.git/'


* tests/opa/parsing/parser.opa: support

* tests/opa/parsing/parser.opa: support

  char = parser
  | x = { Rule.alphanum_char } -> x
  | x = "-" -> x
  // was "{" but bad I think
  | x = "\{" -> x
  | x = "}" -> x

error: pathspec 'tests/opa/parsing/parser.opa' did not match any file(s) known to git


new rss

new rss


broadcast entry changes to all clients

broadcast entry changes to all clients


* tests/opa/parsing/comments.opa: fixed

* tests/opa/parsing/comments.opa: fixed

// one line comment
/*
  multi line comment
*/

/**
 * I assure you, this function does lots of useful things!
 * @return 0
**/
zero() = 0

error: pathspec 'tests/opa/parsing/comments.opa' did not match any file(s) known to git


* tests/opa/visual/local.opa: support

* tests/opa/visual/local.opa: support

function foo() {
   x = 1
   y = 2
   x + y
}

error: pathspec 'tests/opa/visual/local.opa' did not match any file(s) known to git


events fix

events fix


change network to only run upskirt once, and broadcast that change to all clients


mod tool fixed

mod tool fixed


do not rehighlight page twice

do not rehighlight page twice


make login page use new layout

make login page use new layout


address changed

address changed


* tests/opa/visual/xml.opa: support

* tests/opa/visual/xml.opa: support

x =
 <>

this is a title

this is some div

 this is some span
 text
 </>

function foo() {
  2
}

error: pathspec 'tests/opa/visual/xml.opa' did not match any file(s) known to git


* tests/opa/parsing/grouping.opa: support

x = (1 + 2) * 3
x =
  if i_like_pascal then begin
    "begin end rocks"
  end else (
    "i like parens better"
  )

error: pathspec 'tests/opa/parsing/grouping.opa' did not match any file(s) known to git


mod fixed 2

mod fixed 2


contacts fix

contacts fix


wobble

wobble


shorten the input textbox a wee bit

shorten the input textbox a wee bit


added example in Opa language

added example in Opa language

Server.start(Server.http,
    { title: "Hello, World.",
      page: function() { <>Hello, World.</> } })

error: pathspec 'hello-opa/hello-world.opa' did not match any file(s) known to git


* tests/opa/parsing/bindings_line.opa: support

error: pathspec 'tests/opa/parsing/bindings_line.opa' did not match any file(s) known to git


* tests/opa/parsing/integers.opa: new file

x = 10 // 10 in base 10
x = 0xA // 10 in base 16, any case works (0Xa, 0XA, Oxa)
x = 0o12 // 10 in base 8
x = 0b1010 // 10 in base 2

error: pathspec 'tests/opa/parsing/integers.opa' did not match any file(s) known to git