Fixed: network.h: NET_CANSEND fixed, didn\'t checked right for the server

origin
stpohle 22 years ago
parent 8a4fea083b
commit a3cb861a30

@ -1,10 +1,19 @@
$Id: ChangeLog,v 1.52 2004/01/07 23:47:32 patty21 Exp $ $Id: ChangeLog,v 1.53 2004/01/22 20:54:58 stpohle Exp $
- Added: Kick Bombs special - Added: Kick Bombs special
- Fixed: Network initialization at quit removed - Fixed: Network initialization at quit removed
- Fixed: packets.c: do/send_playermove tunnelto wasn't
converted into network arch.
- Fixed: packets.h: pkg_playermove speed changed to Sint16
- Fixed: gfxpixelimage.c colors on bigendian Systems Red
and Blue mask was switched
- Fixed: network.h: NET_CANSEND fixed, didn't checked right
for the server
Version 0.11.0 Version 0.11.0

@ -1,4 +1,9 @@
$Id: TODO,v 1.35 2004/01/06 20:49:57 stpohle Exp $ $Id: TODO,v 1.36 2004/01/22 20:55:16 stpohle Exp $
* start settings for Speed, Ticking time of the bombs.
How many bombs and so on.
* bug: which creates just some explosions on the field.
- support for more player on one keyboard - support for more player on one keyboard

@ -1,4 +1,4 @@
/* $Id: network.h,v 1.9 2004/01/03 02:12:33 stpohle Exp $ /* $Id: network.h,v 1.10 2004/01/22 20:55:23 stpohle Exp $
* network.h file... for everything what have to do with the network stuff * network.h file... for everything what have to do with the network stuff
*/ */
@ -27,7 +27,8 @@
#define GS_WAITRUNNING (bman.state == GS_wait || bman.state == GS_ready || bman.state == GS_running) #define GS_WAITRUNNING (bman.state == GS_wait || bman.state == GS_ready || bman.state == GS_running)
#define GS_RUNNING (bman.state == GS_ready || bman.state == GS_running) #define GS_RUNNING (bman.state == GS_ready || bman.state == GS_running)
#define NET_CANSEND(__pl) (( __pl == 0 || GT_MP_PTPM || (players[__pl].net.flags & NETF_firewall) == 0)) /* check if we can send to the player */
#define NET_CANSEND(__pl) ( __pl == bman.p_servnr || GT_MP_PTPM || (((players[__pl].net.flags & NETF_firewall) == 0) && !bman.firewall))
/* Little / Big Endian Convert */ /* Little / Big Endian Convert */
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN

@ -157,7 +157,7 @@ struct pkg_playermove {
signed char p_nr; signed char p_nr;
signed char m; signed char m;
signed char d; signed char d;
signed char speed; Sint16 speed;
Sint16 tunnelto; Sint16 tunnelto;
_point pos; _point pos;
}; };

@ -68,7 +68,7 @@ void d_fatal (char *fmt,...) {
void debug_ingameinfo() { void debug_ingameinfo() {
int i, j; int i;
float fl; float fl;
char text[255]; char text[255];
@ -83,11 +83,7 @@ void debug_ingameinfo() {
sprintf (text, "P:"); sprintf (text, "P:");
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
if (PS_IS_playing (players[i].state)) { if (PS_IS_playing (players[i].state)) {
for (j = 0, fl = 0.0f; j < PI_max; j++) sprintf (text, "%s Pos:%f,%f ", text, players[i].pos.x, players[i].pos.y);
if (fl < players[i].ill[j].to)
fl = players[i].ill[j].to;
sprintf (text, "%s TO:%2.2f ", text, fl);
} }
font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10); font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10);

@ -1,4 +1,4 @@
/* $Id: gfxpixelimage.c,v 1.6 2004/01/03 23:57:13 stpohle Exp $ */ /* $Id: gfxpixelimage.c,v 1.7 2004/01/22 20:55:39 stpohle Exp $ */
/* gfx pixel manipulation and image manipulation */ /* gfx pixel manipulation and image manipulation */
#include "bomberclone.h" #include "bomberclone.h"
@ -43,7 +43,6 @@ getpixel (SDL_Surface * surface, int x, int y)
case 3: case 3:
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
return p[0] << 16 | p[1] << 8 | p[2]; return p[0] << 16 | p[1] << 8 | p[2];
else else
return p[0] | p[1] << 8 | p[2] << 16; return p[0] | p[1] << 8 | p[2] << 16;
case 4: case 4:
@ -213,11 +212,10 @@ scale_image (SDL_Surface *orginal, int newx, int newy)
short int ypattern[SCALE_MAXRES]; short int ypattern[SCALE_MAXRES];
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0xff000000; rmask = 0x0000ff00;
gmask = 0x00ff0000; gmask = 0x00ff0000;
bmask = 0x0000ff00; bmask = 0xff000000;
amask = 0x000000ff; amask = 0x000000ff;
#else /* */ #else /* */
rmask = 0x00ff0000; rmask = 0x00ff0000;
gmask = 0x0000ff00; gmask = 0x0000ff00;
@ -302,9 +300,9 @@ makegray_image (SDL_Surface * org)
gray; gray;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0xff000000; rmask = 0x0000ff00;
gmask = 0x00ff0000; gmask = 0x00ff0000;
bmask = 0x0000ff00; bmask = 0xff000000;
amask = 0x000000ff; amask = 0x000000ff;
#else #else
rmask = 0x00ff0000; rmask = 0x00ff0000;

@ -667,6 +667,7 @@ send_ill (_net_addr * addr, int p_nr, _player * pl)
send_pkg ((struct pkg *) &ill, addr); send_pkg ((struct pkg *) &ill, addr);
}; };
/*** /***
*** Packettype: playermove *** Packettype: playermove
***/ ***/
@ -685,7 +686,7 @@ send_playermove (_net_addr * addr, int p_nr, _player * pl)
p_dat.d = pl->d; p_dat.d = pl->d;
p_dat.p_nr = p_nr; p_dat.p_nr = p_nr;
p_dat.speed = HTON16 (FTOI16(pl->speed)); p_dat.speed = HTON16 (FTOI16(pl->speed));
p_dat.tunnelto = HTON16 (pl->tunnelto); p_dat.tunnelto = HTON16 (FTOI16 (pl->tunnelto));
send_pkg ((struct pkg *) &p_dat, addr); send_pkg ((struct pkg *) &p_dat, addr);
}; };

Loading…
Cancel
Save