D1st0rt wrote: |
unless you know how to forge a packet from someone else |
Anonymous wrote: |
you CAN take the ball when another player is holding it... It's a subgame bug and won't work in ASSS. |
Code: Show/Hide h->postRR(generatePowerballRequest(pb->hosttime, id));//this is what //happens after the tell(makegrabball(int)); Below are the functions clientMessage *generatePowerballRequest (Uint32 timestamp, BYTE ball) { clientMessage *ret = new clientMessage(6); if (ret == NULL) return NULL; char *msg = ret->msg; /* Field Length Description 0 1 Type byte 1 1 Ball ident 2 4 Timestamp */ msg[0] = 0x20; msg[1] = ball; *(Uint32*)&msg[2] = timestamp; return ret; } void Host::postRR(clientMessage *cm) { if (cm) { post(cm->msg, cm->len, true); delete cm; cm = NULL; } } void Host::post(char *msg, Uint32 len, bool reliable) { char buffer[PACKET_MAX_LENGTH]; if (len > CHUNK_SIZE + 12) { // Chunk it if (len > 1000) { for (Uint32 i = 0; i < len; i += CHUNK_SIZE) { buffer[0] = 0x00; buffer[1] = 0x0A; *(Uint32*)&buffer[2] = len; Uint32 remaining = len - i; if (remaining > CHUNK_SIZE) { // Chunk body memcpy(buffer + 6, msg + i, CHUNK_SIZE); post(buffer, CHUNK_SIZE + 6, true); } else { // Chunk tail memcpy(buffer + 6, msg + i, remaining); post(buffer, remaining + 6, true); } } } else { buffer[0] = 0x00; buffer[1] = 0x08; for (Uint32 i = 0; i < len; i += (CHUNK_SIZE + 4)) { Uint32 remaining = (len - i); if (remaining > (CHUNK_SIZE + 4)) { // Chunk body memcpy(buffer + 2, msg + i, CHUNK_SIZE + 4); post(buffer, CHUNK_SIZE + 6, true); } else { // Chunk tail buffer[1] = 0x09; memcpy(buffer + 2, msg + i, remaining); post(buffer, remaining + 2, true); break; } } } } else { // We're dealing with byte-sized messages now if (reliable) { // Stamp reliable header buffer[0] = 0x00; buffer[1] = 0x03; *(Uint32*)&buffer[2] = localStep; memcpy(buffer + 6, msg, len); msg = buffer; len += 6; if (queue(msg, len) == false) return; } if (clustering) { // Append to cluster list clusterMessage *m = new clusterMessage(msg, len); if (m) clustered.append(m); else send(msg, len); } else { // Send right away send(msg, len); } } } |