MCPcopy Create free account
hub / github.com/assaultcube/AC / netblockpaste

Function netblockpaste

source/src/editing.cpp:442–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440const int MAXNETBLOCKSQR = MAXGZMSGSIZE / sizeof(sqr);
441
442void 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
459void netblockpastexy(ucharbuf *p, int bx, int by, int bxs, int bys, int light)
460{

Callers 4

editundoFunction · 0.85
editredoFunction · 0.85
loopvjFunction · 0.85
loopvFunction · 0.85

Calls 8

putuintFunction · 0.85
putgzbufFunction · 0.85
putintFunction · 0.85
sendpackettoservFunction · 0.85
finalizeMethod · 0.80
putMethod · 0.45
lengthMethod · 0.45
getbufMethod · 0.45

Tested by

no test coverage detected