Code: Show/Hide void PAttach(Player *p, byte *pkt2, int n)
{ int pid2 = ((struct SimplePacket*)pkt2)->d1; Arena *arena = p->arena; struct SimplePacket pkt = { S2C_TURRET, p->pid, pid2 }; Player *to; if (!arena) return; to = (pid2 == -1) ? NULL : pd->PidToPlayer(pid2); if (to && to->status != S_PLAYING) { lm->LogP(L_MALICIOUS, "game", p, "tried to attach to bad pid %d", pid2); return; } if (pid2 == -1 || ( p->arena == to->arena && p->p_freq == to->p_freq) ) { p->p_attached = pid2; net->SendToArena(arena, NULL, (byte*)&pkt, 5, NET_RELIABLE); } } |
Helicon wrote: |
I really want to make these modifications without affecting the other arenas in the zone. |
Grelminar wrote: |
You'll want to write a module that adds a packet handler for C2S_ATTACHTO. ... In order for this to work, your custom module will have to be loaded _before_ the game module, so it can affect the packet that game sees. |
Code: Show/Hide core:net loads
Our module loads Our module does "net->AddPacket(C2S_GREEN, PFoobar);" game:game loads game:game does "net->AddPacket(C2S_GREEN, PGreen);" |