Network Problem with the tilesets fixed.

origin
stpohle 22 years ago
parent a9bb0cd752
commit 7f6c40c57b

@ -1,4 +1,4 @@
$Id: ChangeLog,v 1.45 2003/12/24 03:25:59 stpohle Exp $ $Id: ChangeLog,v 1.46 2003/12/28 19:07:37 stpohle Exp $
- wrote new OpenGameCache Server for this game and - wrote new OpenGameCache Server for this game and
other games. This server is working almost the same other games. This server is working almost the same
@ -12,11 +12,14 @@ $Id: ChangeLog,v 1.45 2003/12/24 03:25:59 stpohle Exp $
- Menuhandling complete rewritten and changed. - Menuhandling complete rewritten and changed.
GUI created for menus: lists, buttons, check boxes GUI created for menus: lists, buttons, check boxes
labels and other things created. labels and other things created.
-new menugraphics made by DJ Mirage.
new menugraphics made by DJ Mirage. -mapmenu written by Patty
-the bad response form the game to users action
should be fixed.
- FullScreen switching from within the game - FullScreen switching from within the game
by pressing F8 by pressing (F8 Works for some Reason only
in Windows)
- AI Players can join network games. - AI Players can join network games.

@ -1,10 +1,10 @@
$Id: TODO,v 1.27 2003/12/28 05:47:50 stpohle Exp $ $Id: TODO,v 1.28 2003/12/28 19:07:37 stpohle Exp $
* tileset name and so on won't be send right.
* check if the player is on a field with * check if the player is on a field with
an running explosion an running explosion
* Multiplayer: playerselection get mixed up somehow.
- multiplayer broadcast in the local network - multiplayer broadcast in the local network
ip: 10.*.*.* and 192.168.*.* ip: 10.*.*.* and 192.168.*.*

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.64 2003/12/28 04:51:25 stpohle Exp $ /* $Id: game.c,v 1.65 2003/12/28 19:07:38 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -360,7 +360,7 @@ game_start ()
}; };
/* shor result of the game */ /* show result of the game */
void game_showresult () { void game_showresult () {
SDL_Rect dest, SDL_Rect dest,
src; src;

@ -1,4 +1,4 @@
/* $Id: map.c,v 1.16 2003/12/28 04:51:25 stpohle Exp $ */ /* $Id: map.c,v 1.17 2003/12/28 19:07:38 stpohle Exp $ */
/* map handling, like generate and load maps. */ /* map handling, like generate and load maps. */
#include "bomberclone.h" #include "bomberclone.h"
@ -198,8 +198,6 @@ map_set_player_way1 (int pl)
p.x = s_random (map.size.x - 2) + 1; p.x = s_random (map.size.x - 2) + 1;
p.y = s_random (map.size.y - 2) + 1; p.y = s_random (map.size.y - 2) + 1;
d_printf ("map_set_player_way2 (%d) : %d,%d\n", pl, p.x, p.y);
/* check if there is no block */ /* check if there is no block */
if (map.field[p.x][p.y].type != FT_nothing) if (map.field[p.x][p.y].type != FT_nothing)
return; return;
@ -253,8 +251,6 @@ map_set_player_way2 (int pl)
p.x = s_random (map.size.x - 2) + 1; p.x = s_random (map.size.x - 2) + 1;
p.y = s_random (map.size.y - 2) + 1; p.y = s_random (map.size.y - 2) + 1;
d_printf ("map_set_player_way2 (%d) : %d,%d\n", pl, p.x, p.y);
/* check if there is no block */ /* check if there is no block */
if (map.field[p.x][p.y].type != FT_nothing) if (map.field[p.x][p.y].type != FT_nothing)
return; return;
@ -358,6 +354,8 @@ map_set_playerposition (int usermap)
} }
if (maxtry) if (maxtry)
d_fatal ("Not All Player could been set\n"); d_fatal ("Not All Player could been set\n");
d_printf ("map_set_playerposition\n");
}; };
#undef PLX #undef PLX
@ -399,21 +397,23 @@ map_random ()
void void
init_map_tileset () init_map_tileset ()
{ {
switch (map.map_selection) { if (GT_MP_PTPM || GT_SP) {
case (0): switch (map.map_selection) {
map_new (map.map); case (0):
break; map_new (map.map);
case (1): break;
map_random (); case (1):
map_new (map.map); map_random ();
break; map_new (map.map);
case (2): break;
map_new (NULL); case (2):
break; map_new (NULL);
} break;
if (map.random_tileset) if (map.random_tileset)
tileset_random (); tileset_random ();
}
}
} }
@ -490,4 +490,4 @@ map_load (FILE * fmap)
map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block; map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block;
fclose (fmap); fclose (fmap);
} };

@ -126,6 +126,8 @@ multiplayer_firstrun ()
* We will host a network game * We will host a network game
*/ */
void host_multiplayer_game () { void host_multiplayer_game () {
int i;
if (bman.firewall) { if (bman.firewall) {
return; return;
} }
@ -145,7 +147,7 @@ void host_multiplayer_game () {
send_ogc_update (); /* send the information that we started an server */ send_ogc_update (); /* send the information that we started an server */
multiplayer_game (); multiplayer_game ();
net_send_servermode ();
network_shutdown (); network_shutdown ();
}; };
@ -160,9 +162,11 @@ void multiplayer_game () {
if (bman.p_nr != -1 && (GS_WAITRUNNING || bman.state == GS_update)) { if (bman.p_nr != -1 && (GS_WAITRUNNING || bman.state == GS_update)) {
bman.state = GS_update; bman.state = GS_update;
net_new_game (); net_new_game ();
if (GT_MP_PTPM)
net_send_servermode ();
game_start (); game_start ();
if (GT_MP_PTPM) {
net_send_mapinfo (); // maybe we have to make a pause
net_send_servermode (); // between mapinfo and servermode
}
net_transmit_gamedata (); net_transmit_gamedata ();
if (bman.state == GS_ready || bman.state == GS_running) { if (bman.state == GS_ready || bman.state == GS_running) {
@ -221,6 +225,8 @@ join_multiplayer_game ()
i = NETF_firewall; i = NETF_firewall;
else else
i = 0; i = 0;
bman.p_nr = -1;
send_joingame (&players[0].net.addr, bman.playername); send_joingame (&players[0].net.addr, bman.playername);
/* go into the normal multiplayer loop */ /* go into the normal multiplayer loop */

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.47 2003/12/26 16:55:35 stpohle Exp $ */ /* $Id: network.c,v 1.48 2003/12/28 19:07:38 stpohle Exp $ */
/* /*
network routines. network routines.
*/ */
@ -136,9 +136,12 @@ network_shutdown ()
{ {
int i; int i;
d_printf ("network_shutdown\n");
if (GT_MP_PTPM) { if (GT_MP_PTPM) {
for (i = 1; i < MAX_PLAYERS; i++) d_printf ("Server Quit Send information\n");
if (players[i].net.addr.host[0] != 0) for (i = 0; i < MAX_PLAYERS; i++)
if (i != bman.p_servnr && players[i].net.addr.host[0] != 0)
send_quit (&players[i].net.addr, NULL, NULL); send_quit (&players[i].net.addr, NULL, NULL);
} }
else if (players[bman.p_servnr].net.addr.host[0] != 0) else if (players[bman.p_servnr].net.addr.host[0] != 0)
@ -737,7 +740,8 @@ net_new_game ()
players[p].state = 0; players[p].state = 0;
} }
players[bman.p_nr].state &= (0xFF - PSF_net); // we are the local player if (bman.p_nr != -1)
players[bman.p_nr].state &= (0xFF - PSF_net); // we are the local player
bman.last_ex_nr = 1; bman.last_ex_nr = 1;
}; };

@ -855,6 +855,7 @@ send_quit (_net_addr * addr, char *plhost, char * plport)
send_pkg ((struct pkg *) &q_dat, addr); send_pkg ((struct pkg *) &q_dat, addr);
}; };
void void
do_quit (struct pkg_quit *q_dat, _net_addr * addr) do_quit (struct pkg_quit *q_dat, _net_addr * addr)
{ {
@ -1190,7 +1191,7 @@ send_mapinfo (_net_addr * addr)
strcpy (map_pkg.tileset, map.tileset); strcpy (map_pkg.tileset, map.tileset);
map_pkg.map_selection = map.map_selection; map_pkg.map_selection = map.map_selection;
strcpy (map_pkg.mapname, map.map); strcpy (map_pkg.mapname, map.map);
d_printf ("send_mapinfo: Tileset: %s\n", map.tileset);
send_pkg ((struct pkg *) &map_pkg, addr); send_pkg ((struct pkg *) &map_pkg, addr);
}; };

Loading…
Cancel
Save