Commit 4d86e3b6 authored by Roman Haefeli's avatar Roman Haefeli
Browse files

WIP: add room namespace to entities

parent 7078c1e4
......@@ -58,7 +58,7 @@ protocol version mismatch.
Once the procol version is agreed upon, the client registers its given name, which
can be any string configured by the user:
C: /s/tpf/register/name ZHdK
C: /s/tpf/register/client <room> <nick>
S: /s/tpf/register/done
If the server responds with:
......
#N canvas 719 165 350 402 10;
#N canvas 545 139 350 402 10;
#X declare -path netpd-server/includes;
#X declare -path osc;
#N canvas 719 374 558 410 tpf.communication 0;
......@@ -83,113 +83,72 @@
#X connect 27 0 26 0;
#X connect 28 0 20 0;
#X restore 13 132 pd tpf.communication;
#N canvas 902 132 375 575 register/name 0;
#X obj 130 391 s \$0.to;
#N canvas 902 297 375 575 register/name 0;
#X obj 130 350 s \$0.to;
#X obj 7 11 r \$0.from;
#X obj 7 31 routeOSC /register/name;
#X msg 49 370 /register/done;
#X msg 49 329 /register/done;
#X obj 7 52 list prepend;
#X obj 87 52 r \$0.client;
#N canvas 0 50 333 404 prevent_duplicates 0;
#X obj 80 81 text search \$0.clients 1;
#X obj 80 101 == -1;
#X obj 23 62 unpack f s;
#X obj 23 174 == -1;
#X obj 23 154 text search \$0.clients 0;
#X obj 23 214 &&;
#X obj 23 234 sel 1;
#X text 66 233 bang if neither id nor name is found;
#X obj 23 194 t a a;
#X obj 91 255 sel 0;
#X msg 91 275 id already in use;
#X obj 80 124 t a a;
#X msg 176 201 name already in use;
#X obj 176 183 sel 0;
#X obj 23 14 inlet;
#X obj 23 359 outlet;
#X obj 91 307 outlet;
#X connect 0 0 1 0;
#X connect 1 0 11 0;
#X connect 2 0 4 0;
#X connect 2 1 0 0;
#X connect 3 0 8 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 15 0;
#X connect 8 0 5 0;
#X connect 8 1 9 0;
#X connect 9 0 10 0;
#X connect 10 0 16 0;
#X connect 11 0 5 1;
#X connect 11 1 13 0;
#X connect 12 0 16 0;
#X connect 13 0 12 0;
#X connect 14 0 2 0;
#X restore 7 123 pd prevent_duplicates;
#X obj 130 148 list prepend /register/error;
#X obj 130 168 list trim;
#X obj 7 96 t a a;
#X obj 7 143 list append;
#X obj 91 291 loadbang;
#X obj 54 332 text set \$0.clients;
#X msg 91 311 1e+06;
#X obj 7 513 s \$0.add.connection;
#X obj 7 492 f;
#X msg 22 473 \$1;
#X obj 7 163 t b b a a b;
#X obj 54 252 list append;
#X obj 70 188 text size \$0.clients;
#X obj 70 208 == 0;
#X msg 45 429 /updated/clients;
#X obj 45 449 s \$0.broadcast;
#X obj 22 350 t b b;
#X obj 139 217 r SERVER;
#X obj 139 237 route ip;
#X obj 54 272 list append;
#X msg 139 257 symbol \$1.\$2.\$3.\$4;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 3 0 0 0;
#X connect 4 0 9 0;
#X connect 5 0 4 1;
#X connect 6 0 10 0;
#X connect 6 1 7 0;
#X connect 7 0 8 0;
#X connect 8 0 0 0;
#X connect 9 0 6 0;
#X connect 9 1 10 1;
#X connect 10 0 17 0;
#X connect 11 0 13 0;
#X connect 13 0 12 1;
#X connect 15 0 14 0;
#X connect 16 0 15 1;
#X connect 17 0 15 0;
#X connect 17 1 23 0;
#X connect 17 2 16 0;
#X connect 17 3 18 0;
#X connect 17 4 19 0;
#X connect 18 0 26 0;
#X connect 19 0 20 0;
#X connect 20 0 18 1;
#X connect 21 0 22 0;
#X connect 23 0 21 0;
#X connect 23 1 3 0;
#X connect 24 0 25 0;
#X connect 25 0 27 0;
#X connect 26 0 12 0;
#X connect 27 0 26 1;
#X obj 91 250 loadbang;
#X obj 54 291 text set \$0.clients;
#X msg 91 270 1e+06;
#X obj 7 472 s \$0.add.connection;
#X obj 7 451 f;
#X obj 7 122 t b b a a b;
#X obj 54 211 list append;
#X obj 70 147 text size \$0.clients;
#X obj 70 167 == 0;
#X msg 22 384 /updated/clients;
#X obj 22 404 s \$0.broadcast;
#X obj 22 309 t b b;
#X obj 139 176 r SERVER;
#X obj 139 196 route ip;
#X obj 54 231 list append;
#X msg 139 216 symbol \$1.\$2.\$3.\$4;
#X obj 7 31 routeOSC /register/client;
#X msg 7 85 list \$2 \$1 \$3;
#X text 134 234 <room> <id> <nick> <ip>;
#X text 102 87 <room> <id> <nick>;
#X text 158 52 <id>;
#X text 164 31 <room> <nick>;
#X msg 39 430 \$2;
#X connect 1 0 21 0;
#X connect 2 0 0 0;
#X connect 3 0 22 0;
#X connect 4 0 3 1;
#X connect 5 0 7 0;
#X connect 7 0 6 1;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
#X connect 10 1 16 0;
#X connect 10 2 27 0;
#X connect 10 3 11 0;
#X connect 10 4 12 0;
#X connect 11 0 19 0;
#X connect 12 0 13 0;
#X connect 13 0 11 1;
#X connect 14 0 15 0;
#X connect 16 0 14 0;
#X connect 16 1 2 0;
#X connect 17 0 18 0;
#X connect 18 0 20 0;
#X connect 19 0 6 0;
#X connect 20 0 19 1;
#X connect 21 0 3 0;
#X connect 22 0 10 0;
#X connect 27 0 9 1;
#X restore 13 172 pd register/name;
#N canvas 595 213 337 132 protol/version 0;
#N canvas 595 279 337 132 protol/version 0;
#X obj 17 15 r \$0.from;
#X obj 17 75 s \$0.to;
#X obj 17 35 routeOSC /protocol/version;
#X msg 17 55 /protocol/version 1 0;
#X msg 17 55 /protocol/version 2 0;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X restore 13 152 pd protol/version;
#X obj 13 50 text define \$0.clients;
#N canvas 699 381 494 446 unregister/name 0;
#N canvas 699 381 494 467 unregister/name 0;
#X text 11 9 We want disconnceting clients to automatically unregister
by IP and port.;
#X obj 14 50 r SERVER;
......@@ -201,7 +160,6 @@ by IP and port.;
#X obj 99 272 text delete \$0.clients;
#X obj 15 228 sel -1;
#X obj 14 71 route num_of_clients socket;
#X obj 15 202 text search \$0.clients 0;
#X obj 15 183 t a a;
#X obj 48 401 f;
#X obj 48 422 s \$0.del.connection;
......@@ -213,29 +171,30 @@ by IP and port.;
#X msg 65 360 /updated/clients;
#X obj 65 380 s \$0.broadcast;
#X obj 48 253 t b b b a;
#X obj 15 202 text search \$0.clients 1;
#X connect 1 0 9 0;
#X connect 2 0 3 1;
#X connect 2 1 3 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 6 0 11 0;
#X connect 8 1 21 0;
#X connect 6 0 10 0;
#X connect 8 1 20 0;
#X connect 9 0 2 0;
#X connect 9 1 6 1;
#X connect 10 0 8 0;
#X connect 11 0 10 0;
#X connect 11 1 12 1;
#X connect 12 0 13 0;
#X connect 15 0 16 0;
#X connect 15 0 17 0;
#X connect 16 0 14 1;
#X connect 17 0 14 2;
#X connect 18 0 14 0;
#X connect 19 0 20 0;
#X connect 21 0 12 0;
#X connect 21 1 19 0;
#X connect 21 2 18 0;
#X connect 21 3 7 0;
#X connect 10 0 21 0;
#X connect 10 1 11 1;
#X connect 11 0 12 0;
#X connect 14 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 13 1;
#X connect 16 0 13 2;
#X connect 17 0 13 0;
#X connect 18 0 19 0;
#X connect 20 0 11 0;
#X connect 20 1 18 0;
#X connect 20 2 17 0;
#X connect 20 3 7 0;
#X connect 21 0 8 0;
#X restore 13 191 pd unregister/name;
#X obj 13 71 text define \$0.connections;
#N canvas 764 216 666 598 manage.connections 0;
......@@ -372,7 +331,7 @@ by IP and port.;
#X connect 43 1 20 0;
#X connect 44 0 45 0;
#X restore 13 210 pd manage.connections;
#N canvas 520 75 483 394 client.list 0;
#N canvas 520 106 395 439 client.list 0;
#X obj 12 33 r \$0.from;
#X obj 12 53 routeOSC /refresh/clients;
#X obj 31 103 text size \$0.clients;
......@@ -383,12 +342,15 @@ by IP and port.;
#X msg 74 147 0;
#X obj 31 206 text get \$0.clients;
#X obj 12 73 t b b b;
#X obj 31 249 list trim;
#X obj 12 296 s \$0.to;
#X obj 31 229 list prepend /clients;
#X msg 12 270 /clients/end;
#X msg 114 268 /clients/begin;
#X obj 31 309 list trim;
#X obj 12 356 s \$0.to;
#X obj 31 289 list prepend /clients;
#X msg 12 330 /clients/end;
#X msg 114 328 /clients/begin;
#X obj 31 123 t a b;
#X obj 31 229 list trim;
#X obj 31 260 route dummy;
#X obj 135 230 r \$0.room;
#X connect 0 0 1 0;
#X connect 1 0 9 0;
#X connect 2 0 15 0;
......@@ -398,7 +360,7 @@ by IP and port.;
#X connect 5 1 6 0;
#X connect 6 0 4 1;
#X connect 7 0 4 1;
#X connect 8 0 12 0;
#X connect 8 0 16 0;
#X connect 9 0 13 0;
#X connect 9 1 2 0;
#X connect 9 2 14 0;
......@@ -408,8 +370,11 @@ by IP and port.;
#X connect 14 0 11 0;
#X connect 15 0 3 0;
#X connect 15 1 7 0;
#X connect 16 0 17 0;
#X connect 17 0 12 0;
#X connect 18 0 17 1;
#X restore 13 229 pd client.list;
#N canvas 520 75 432 493 mylink.list 0;
#N canvas 520 106 432 493 mylink.list 0;
#X obj 12 13 r \$0.from;
#X obj 31 123 until;
#X obj 31 143 f;
......@@ -476,7 +441,7 @@ by IP and port.;
#X connect 27 1 5 0;
#X restore 13 248 pd mylink.list;
#X obj 13 91 text define \$0.params;
#N canvas 101 124 599 378 params 0;
#N canvas 101 124 690 442 params 0;
#X obj 12 13 r \$0.from;
#X obj 12 33 routeOSC /params;
#X obj 12 53 routeOSC /end /begin;
......@@ -496,47 +461,53 @@ by IP and port.;
#X obj 370 165 f;
#X msg 410 145 0;
#X obj 370 215 text get \$0.params;
#X obj 370 239 list prepend /params;
#X obj 370 259 list trim;
#X msg 389 296 /params/begin;
#X msg 351 320 /params/end;
#X obj 351 353 s \$0.to;
#X obj 370 279 list prepend /params;
#X obj 370 299 list trim;
#X msg 389 336 /params/begin;
#X msg 351 360 /params/end;
#X obj 351 393 s \$0.to;
#X obj 370 185 t a a;
#X obj 421 178 + 1;
#N canvas 173 124 359 338 update.params 0;
#X obj 17 287 text set \$0.params;
#X obj 17 264 list;
#X obj 52 242 loadbang;
#X msg 52 262 8e+06;
#N canvas 173 256 359 441 update.params 0;
#X obj 17 327 text set \$0.params;
#X obj 17 304 list;
#X obj 52 282 loadbang;
#X msg 52 302 8e+06;
#X obj 17 17 inlet;
#X obj 17 100 text search \$0.params 0;
#X obj 17 58 t a a;
#X obj 17 88 t a a;
#X obj 17 37 list;
#X obj 17 80 list split 1;
#X obj 17 121 sel -1;
#X obj 50 222 text set \$0.params;
#X obj 120 181 loadbang;
#X msg 120 201 1;
#X obj 50 144 t b a;
#X obj 50 164 list append;
#X obj 17 161 sel -1;
#X obj 50 262 text set \$0.params;
#X obj 120 221 loadbang;
#X obj 50 184 t b a;
#X obj 50 204 list append;
#X obj 17 61 list prepend;
#X obj 86 35 r \$0.room;
#X obj 17 110 list split 2;
#X obj 17 140 text search \$0.params 0 1;
#X msg 120 241 3;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 0 1;
#X connect 4 0 7 0;
#X connect 5 0 9 0;
#X connect 6 0 8 0;
#X connect 6 1 1 1;
#X connect 7 0 6 0;
#X connect 8 0 5 0;
#X connect 8 1 14 1;
#X connect 9 0 1 0;
#X connect 9 1 13 0;
#X connect 11 0 12 0;
#X connect 12 0 10 2;
#X connect 13 0 14 0;
#X connect 13 1 10 1;
#X connect 14 0 10 0;
#X connect 4 0 6 0;
#X connect 5 0 14 0;
#X connect 5 1 1 1;
#X connect 6 0 12 0;
#X connect 7 0 1 0;
#X connect 7 1 10 0;
#X connect 9 0 16 0;
#X connect 10 0 11 0;
#X connect 10 1 8 1;
#X connect 11 0 8 0;
#X connect 12 0 5 0;
#X connect 13 0 12 1;
#X connect 14 0 15 0;
#X connect 14 1 11 1;
#X connect 15 0 7 0;
#X connect 16 0 8 2;
#X restore 129 172 pd update.params;
#X obj 370 248 route dummy;
#X obj 457 247 r \$0.room;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 5 0;
......@@ -560,7 +531,7 @@ by IP and port.;
#X connect 15 0 16 0;
#X connect 16 0 24 0;
#X connect 17 0 16 1;
#X connect 18 0 19 0;
#X connect 18 0 27 0;
#X connect 19 0 20 0;
#X connect 20 0 23 0;
#X connect 21 0 23 0;
......@@ -568,6 +539,8 @@ by IP and port.;
#X connect 24 0 18 0;
#X connect 24 1 25 0;
#X connect 25 0 16 1;
#X connect 27 0 19 0;
#X connect 28 0 27 1;
#X restore 13 267 pd params;
#N canvas 938 512 355 291 reset/all 0;
#X obj 29 21 r \$0.from;
......@@ -592,3 +565,16 @@ by IP and port.;
#X obj 13 341 netpd-server/netpd-server;
#X obj 13 363 declare -path netpd-server/includes;
#X obj 12 13 declare -path osc;
#X obj 185 146 r \$0.client;
#X obj 185 169 text search \$0.clients 1;
#X obj 185 214 text get \$0.clients;
#X msg 185 192 \$1 0 1;
#X obj 185 237 s \$0.room;
#X obj 180 307 print -------------;
#X obj 195 268 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X connect 15 0 16 0;
#X connect 16 0 18 0;
#X connect 17 0 19 0;
#X connect 18 0 17 0;
#X connect 21 0 20 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment