| 440 | const int MAXNETBLOCKSQR = MAXGZMSGSIZE / sizeof(sqr); |
| 441 | |
| 442 | void netblockpaste(const block &b, int bx, int by, bool light) // transmit block to be pasted at bx,by |
| 443 | { |
| 444 | ASSERT(b.xs * b.ys <= MAXNETBLOCKSQR); |
| 445 | vector<uchar> t, tmp; |
| 446 | putuint(t, bx); |
| 447 | putuint(t, by); |
| 448 | putuint(t, b.xs); |
| 449 | putuint(t, b.ys); |
| 450 | putuint(t, light ? 1 : 0); |
| 451 | tmp.put((uchar *)((&b)+1), b.xs * b.ys * (int)sizeof(sqr)); |
| 452 | putgzbuf(t, tmp); |
| 453 | packetbuf p(t.length() + 10, ENET_PACKET_FLAG_RELIABLE); |
| 454 | putint(p, SV_EDITBLOCK); |
| 455 | p.put(t.getbuf(), t.length()); |
| 456 | sendpackettoserv(1, p.finalize()); |
| 457 | } |
| 458 | |
| 459 | void netblockpastexy(ucharbuf *p, int bx, int by, int bxs, int bys, int light) |
| 460 | { |