rendered paste body{
hunk ./Vanilla/include/packets.h 129
+#define CP_PLANET 38 /* synchronizes planet info */
hunk ./Vanilla/include/packets.h 570
+
+struct planet_cpacket
+{
+ char type; /* CP_PLANET */
+ char pnum;
+ char owner;
+ char info;
+ int armies;
+};
hunk ./Vanilla/ntserv/socket.c 86
+static void handlePlanReq(struct planet_cpacket *packet);
hunk ./Vanilla/ntserv/socket.c 165
+ { sizeof(struct planet_cpacket), handlePlanReq }, /* CP_PLANET */
hunk ./Vanilla/ntserv/socket.c 1319
+
+static void handlePlanReq(struct planet_cpacket *packet)
+{
+#define PLFLAGMASK (PLREPAIR|PLFUEL|PLAGRI|PLHOME|PLCOUP|PLCORE)
+
+ struct planet *l;
+ struct planet_spacket *pl;
+
+ if (!F_check_planets) return;
+
+ l = &planets[packet->pnum];
+
+ if (l->pl_info & me->p_team) {
+ if ( l->pl_info != packet->info
+ || l->pl_armies != packet->armies
+ || l->pl_owner != packet->owner ) {
+ pl->type=SP_PLANET;
+ pl->pnum=l->pl_no;
+ pl->info=l->pl_info;
+ pl->flags=htons((short) (l->pl_flags & PLFLAGMASK));
+ pl->armies=htonl(l->pl_armies);
+ pl->owner=l->pl_owner;
+ sendClientPacket(pl);
+ }
+ }
+}