You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/melee Modified Files: mcontrol.cpp mcontrol.h mgame.cpp mmain.cpp Log Message: Index: mcontrol.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcontrol.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mcontrol.h 12 Mar 2004 20:14:58 -0000 1.9 --- mcontrol.h 18 Mar 2004 23:38:38 -0000 1.10 *************** *** 11,89 **** class Control : public Presence { ! public: ! ! virtual bool die(); // controls CANNOT arbitrarily be killed off, because the deal with networking directly ! ! bool temporary; //true if this control will delete itself when it's ship dies ! unsigned char target_sign_color; ! int already;//this pertains to network traffic - see comment above calculate() in mcontrol.cpp ! int channel; ! ! ! ! //points at the current ship being controlled ! Ship *ship; ! //keys currently pressed ! KeyCode keys; ! //name of instance ! char *iname; ! //number of targets ! // int num_targets; ! //array of targets ! // SpaceObject **target; ! //index (into the array, target) of the currently active target) ! // int active_target; ! SpaceObject *target; ! int index; ! bool valid_target(SpaceObject *t); ! //always-random selection, for the always-random button on the default ship selector ! int always_random; ! public: ! //handles camera focusing on a controls ship ! virtual SpaceLocation *get_focus(); ! int rand(); ! //loads configuration data from a ini file. ! //example: player1.load("scp.ini", "Keyboard1"); ! virtual void load(const char* inifile, const char* inisection); ! //saves configuration data to a ini file. ! virtual void save(const char* inifile, const char* inisection); ! //presents the ship selection dialog ! virtual int choose_ship(VideoWindow *window, char *prompt, class Fleet *fleet); ! //called whenever the ship being controlled changes ! //WARNING: select_ship() is not thread-safe ! virtual void select_ship(Ship* ship_pointer, const char* ship_name); ! //called every frame of physics ! virtual void calculate(); ! //called by calculate... this is where the important stuff goes ! virtual int think(); ! //returns the name of the control type, like "Joystick" ! virtual const char *getTypeName() = 0; ! //returns the description of the control, like "NetworkGame(local)_Keyboard0" ! virtual char *getDescription(); ! //the constructor initializes ship to NULL ! Control (const char *name, int channel) ; ! //the destructor, which is rarely used ! virtual ~Control () ; ! //called by the GUI stuff to setup the controls (calibrate Joystick, set keys, etc.) ! virtual void setup(); ! // virtual void add_target(SpaceObject *killit) ; ! // virtual void remove_target(SpaceObject *killit) ; ! //sets the target ! virtual void set_target(int i); ! virtual void target_stuff(); ! virtual void animate(Frame *space); ! ! ! enum {_prediction_keys_size = 128};//must be a power of 2 ! //half-assed network bypass for prediction ! KeyCode *_prediction_keys; ! unsigned char _prediction_keys_index; ! ! //for future mid-game lag changes ! virtual void _event ( Event *e ); ! ! ! virtual void gen_buffered_data(); ! }; --- 11,81 ---- class Control : public Presence { ! public: ! ! /*! \brief controls CANNOT arbitrarily be killed off, because the deal with networking directly */ ! virtual bool die(); ! ! /*! \brief true if this control will delete itself when it's ship dies */ ! bool temporary; ! unsigned char target_sign_color; ! /*! \brief this pertains to network traffic - see comment above calculate() in mcontrol.cpp */ ! int already; ! int channel; ! ! ! /*! \brief points at the current ship being controlled */ ! Ship *ship; ! /*! \brief keys currently pressed */ ! KeyCode keys; ! /*! \brief name of instance */ ! char *iname; ! SpaceObject *target; ! int index; ! bool valid_target(SpaceObject *t); ! /*! \brief always-random selection, for the always-random button on the default ship selector */ ! int always_random; ! public: ! /*! \brief handles camera focusing on a controls ship */ ! virtual SpaceLocation *get_focus(); ! int rand(); ! /*! \brief loads configuration data from a ini file. ! \example player1.load("scp.ini", "Keyboard1"); */ ! virtual void load(const char* inifile, const char* inisection); ! /*! \brief saves configuration data to a ini file. */ ! virtual void save(const char* inifile, const char* inisection); ! /*! \brief presents the ship selection dialog */ ! virtual int choose_ship(VideoWindow *window, char *prompt, class Fleet *fleet); ! /*! \brief called whenever the ship being controlled changes ! WARNING: select_ship() is not thread-safe */ ! virtual void select_ship(Ship* ship_pointer, const char* ship_name); ! /*! \brief called every frame of physics */ ! virtual void calculate(); ! /*! \brief called by calculate... this is where the important stuff goes */ ! virtual int think(); ! /*! \brief returns the name of the control type, like "Joystick" */ ! virtual const char *getTypeName() = 0; ! /*! \brief returns the description of the control, like "NetworkGame(local)_Keyboard0" */ ! virtual char *getDescription(); ! /*! \brief the constructor initializes ship to NULL */ ! Control (const char *name, int channel) ; ! /*! \brief the destructor, which is rarely used */ ! virtual ~Control () ; ! /*! called by the GUI stuff to setup the controls (calibrate Joystick, set keys, etc.) */ ! virtual void setup(); ! virtual void set_target(int i); ! virtual void target_stuff(); ! virtual void animate(Frame *space); ! ! ! enum {_prediction_keys_size = 128};//must be a power of 2 ! //half-assed network bypass for prediction ! KeyCode *_prediction_keys; ! unsigned char _prediction_keys_index; ! ! /*! \brief for future mid-game lag changes */ ! virtual void _event ( Event *e ); ! ! virtual void gen_buffered_data(); ! }; Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** mmain.cpp 18 Mar 2004 20:38:20 -0000 1.34 --- mmain.cpp 18 Mar 2004 23:38:38 -0000 1.35 *************** *** 605,609 **** // first you've to check if you're synched ! int k = 0; // this is probably enough --> the server has sent all data to you. --- 605,609 ---- // first you've to check if you're synched ! // int k = 0; // this is probably enough --> the server has sent all data to you. Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mgame.cpp 18 Mar 2004 20:38:20 -0000 1.40 --- mgame.cpp 18 Mar 2004 23:38:38 -0000 1.41 *************** *** 301,309 **** ! static const int channel_none = -1; ! static const int _channel_buffered = 1; ! static const int channel_init = 4; // game type, version, length, etc.. things that need to read by a reader independant of a particular game type ! static const int channel_playback = 8; // used for demo playbacks only ! static const int channel_server = 12; //data originating on the server int channel_network[max_network]; //data originating on the client int num_hotseats[max_network]; // number of hotseat-players per connected computer --- 301,309 ---- ! const int channel_none = -1; ! const int _channel_buffered = 1; ! const int channel_init = 4; // game type, version, length, etc.. things that need to read by a reader independant of a particular game type ! const int channel_playback = 8; // used for demo playbacks only ! const int channel_server = 12; //data originating on the server int channel_network[max_network]; //data originating on the client int num_hotseats[max_network]; // number of hotseat-players per connected computer *************** *** 1735,1742 **** void Game::register_events() { ! EVENT(Game, chat); ! EVENT(Game, change_lag); ! EVENT(Game, test_event1); ! EVENT(Game, disconnect); } --- 1735,1742 ---- void Game::register_events() { ! EVENT(Game, &Game::chat); ! EVENT(Game, &Game::change_lag); ! EVENT(Game, &Game::test_event1); ! EVENT(Game, &Game::disconnect); } *************** *** 1823,1828 **** { SpaceLocation *o = item[i]; ! sumpos += o->pos.x + o->pos.y; ! sumvel += o->vel.x + o->vel.y; } --- 1823,1828 ---- { SpaceLocation *o = item[i]; ! sumpos += iround(o->pos.x + o->pos.y); ! sumvel += iround(o->vel.x + o->vel.y); } *************** *** 1887,1892 **** // only generate in true-time // otherwise, N may differ from the true number of items in the game. ! test = item[i]->pos.x + item[i]->pos.y + ! item[i]->vel.x + item[i]->vel.y; id = item[i]->debug_id; } --- 1887,1892 ---- // only generate in true-time // otherwise, N may differ from the true number of items in the game. ! test = iround(item[i]->pos.x + item[i]->pos.y + ! item[i]->vel.x + item[i]->vel.y); id = item[i]->debug_id; } Index: mcontrol.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcontrol.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mcontrol.cpp 17 Mar 2004 22:27:37 -0000 1.19 --- mcontrol.cpp 18 Mar 2004 23:38:38 -0000 1.20 *************** *** 410,417 **** return; } ! Control::Control(const char *name, int _channel) : temporary(false), target_sign_color(255), ! already(0), channel(_channel), ship(NULL), ! target(NULL), index(-1), always_random(0), keys(0), _prediction_keys(NULL) ! {STACKTRACE; id |= ID_CONTROL; attributes |= ATTRIB_SYNCHED; --- 410,418 ---- return; } ! ! Control::Control(const char *name, int _channel) : temporary(false), target_sign_color(255), already(0), channel(_channel), ! ship(NULL), keys(0), ! target(NULL), index(-1), always_random(0), _prediction_keys(NULL) ! {STACKTRACE id |= ID_CONTROL; attributes |= ATTRIB_SYNCHED; *************** *** 420,424 **** _prediction_keys = new KeyCode[_prediction_keys_size]; _prediction_keys_index = 0; ! if (channel & _channel_buffered) { // ???????????? error("Control::Control - invalid channel!"); } --- 421,425 ---- _prediction_keys = new KeyCode[_prediction_keys_size]; _prediction_keys_index = 0; ! if (channel & _channel_buffered) { error("Control::Control - invalid channel!"); } |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/other Modified Files: gconfig.cpp Log Message: Index: gconfig.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/gconfig.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gconfig.cpp 15 Mar 2004 22:20:33 -0000 1.3 --- gconfig.cpp 18 Mar 2004 23:38:39 -0000 1.4 *************** *** 1,20 **** /* ! This file is part of "Star Control: TimeWarp" ! http://timewarp.sourceforge.net/ ! Copyright (C) 2001-2004 TimeWarp development team ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. */ #ifdef ALLEGRO_MSVC ! #pragma warning (disable:4786) // identifier was truncated to '255' characters in the browser information #endif --- 1,20 ---- /* ! This file is part of "Star Control: TimeWarp" ! http://timewarp.sourceforge.net/ ! Copyright (C) 2001-2004 TimeWarp development team ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. */ #ifdef ALLEGRO_MSVC ! #pragma warning (disable:4786) // identifier was truncated to '255' characters in the browser information #endif *************** *** 33,40 **** #include "games/ggob.h" #include "melee/mview.h" // for message #define gobgame ((GobGame*)game) ! static int l_InitializeSun(lua_State* ls); static int l_AddPlanet(lua_State* ls); static int l_AddStation(lua_State* ls); --- 33,41 ---- #include "games/ggob.h" #include "melee/mview.h" // for message + #include "other/orbit.h" #define gobgame ((GobGame*)game) ! static int l_AddSun(lua_State* ls); static int l_AddPlanet(lua_State* ls); static int l_AddStation(lua_State* ls); *************** *** 51,78 **** Planet * FindPlanet (std::string name) { ! Planet *p = NULL; ! Query q; ! q.begin(game->item[0], bit(LAYER_CBODIES), 99999999); ! // if first object is planet ! if (game->item[0]->isPlanet()) { ! p = (Planet*)game->item[0]; ! if (p->GetName() == name) ! return p; } ! while (q.current) { ! if (q.current->isPlanet()) { ! p = (Planet*)q.current; ! if (p->GetName() == name) ! return p; } ! q.next(); } ! return NULL; } --- 52,96 ---- Planet * FindPlanet (std::string name) { ! Planet *p = NULL; ! Query q; ! q.begin(game->item[0], bit(LAYER_CBODIES), 99999999); ! // if first object is planet ! if (game->item[0]->isPlanet()) { ! p = (Planet*)game->item[0]; ! if (p->GetName() == name) ! return p; } ! while (q.current) { ! if (q.current->isPlanet()) { ! p = (Planet*)q.current; ! if (p->GetName() == name) ! return p; } ! q.next(); } ! return NULL; ! } ! ! SpaceSprite * GetSprite(char *fileName, char *spriteName) ! { ! STACKTRACE; ! ! DATAFILE *tmpdata; ! tmpdata= load_datafile_object(fileName,spriteName); ! if(tmpdata==NULL) ! { ! tw_error("Unable to load space sprite"); ! return NULL; ! } ! ! SpaceSprite *spr=new SpaceSprite(tmpdata, 1, SpaceSprite::MASKED, 1); ! unload_datafile_object(tmpdata); ! return spr; } *************** *** 84,215 **** // Register C function for using in lua //////////////////////////////////////////////////////// ! lua_register(L, "DialogStart", l_InitializeSun); lua_register(L, "AddPlanet", l_AddPlanet); lua_register(L, "AddStation", l_AddStation); } ! ! static int l_InitializeSun(lua_State* ls) { ! return 0; ! }; /*! \brief add planet to gob like game ! \param name (string) name of the planet used as unique ID of planet form config script ! \param x (string) planets absciss, can be integer value or '?' for ramdom position ! \param y (string) planets ordinate, can be integer value or '?' for ramdom position */ static int l_AddPlanet(lua_State* ls) { ! int top = lua_gettop(ls); // number of argument ! if (top != 3) { ! tw_error("Wrong argument count in Add Planet (lua script)"); } ! if ( !lua_isstring(ls, 1) ) {tw_error("AddPlanet wrong argument type for 1 arg");} ! if ( !lua_isstring(ls, 2) ) {tw_error("AddPlanet wrong argument type for 2 arg");} ! if ( !lua_isstring(ls, 3) ) {tw_error("AddPlanet wrong argument type for 3 arg");} ! const char* name = lua_tostring(ls, 1); ! const char* x = lua_tostring(ls, 2); ! const char* y = lua_tostring(ls, 3); ! // Load cordinates ! int nx, ny; ! if ( !strcmp(x, "?") ) ! nx = iround(random (game->size.x)); ! else ! nx = atoi(x); ! if ( !strcmp(y, "?") ) ! ny = iround(random (game->size.y)); ! else ! ny = atoi(y); ! Vector2 pos(nx,ny); ! Planet *p = create_planet(pos); ! if (p == NULL) {tw_error ("Unable to create planet");}; ! p->SetName(name); ! while (true) { ! SpaceLocation *n; ! n = p->nearest_planet(); ! if (!n || (p->distance(n) > 1500)) break; ! p->translate(random(game->size)); ! } ! return 0; } /*! \brief add gob space station ! \param name (string) space station name ! \param x (string) not used, supposed for station what does not orbiting planet ! \param y (string) not used, supposed for station what does not orbiting planet ! \param buildtype (string) Ship type producing by station ! \param commander (string) External AI script for station commander ! \param orbit (string) nearest planet ! \param sprite (string) sprite for station ! \param background (string) background picture */ static int l_AddStation(lua_State* ls) { ! int top = lua_gettop(ls); // number of argument ! if (top != 8) { ! tw_error("Wrong argument count in Add Planet (lua script)"); } ! if ( !lua_isstring(ls, 1) ) {tw_error("AddStation wrong argument type for 1 arg");} ! if ( !lua_isstring(ls, 2) ) {tw_error("AddStation wrong argument type for 2 arg");} ! if ( !lua_isstring(ls, 3) ) {tw_error("AddStation wrong argument type for 3 arg");} ! if ( !lua_isstring(ls, 4) ) {tw_error("AddStation wrong argument type for 4 arg");} ! if ( !lua_isstring(ls, 5) ) {tw_error("AddStation wrong argument type for 5 arg");} ! if ( !lua_isstring(ls, 6) ) {tw_error("AddStation wrong argument type for 6 arg");} ! if ( !lua_isstring(ls, 7) ) {tw_error("AddStation wrong argument type for 7 arg");} ! if ( !lua_isstring(ls, 8) ) {tw_error("AddStation wrong argument type for 8 arg");} ! const char* name = lua_tostring(ls, 1); ! //const char* x = lua_tostring(ls, 2); ! //const char* y = lua_tostring(ls, 3); ! const char* buildtype = lua_tostring(ls, 4); ! const char* commander = lua_tostring(ls, 5); ! const char* orbit = lua_tostring(ls, 6); ! const char* sprite = lua_tostring(ls, 7); ! const char* background = lua_tostring(ls, 8); ! Planet *p = FindPlanet( orbit ); ! ASSERT (p!= NULL); ! DATAFILE *tmpdata; ! bool c = true; ! std::string file, pic; ! for (unsigned int i = 0; i< strlen(sprite);i++) { ! if (sprite[i] == '#') { ! c = false; ! continue; } ! if (c) ! file +=sprite[i]; ! else ! pic +=sprite[i]; } ! tmpdata = load_datafile_object(file.c_str(), pic.c_str()); ! if (!tmpdata) error( "couldn't find gob.dat#station0sprite"); ! SpaceSprite * stationSprite = new SpaceSprite(tmpdata, 1, SpaceSprite::MASKED | SpaceSprite::MIPMAPED, 64); ! unload_datafile_object(tmpdata); ! stationSprite->permanent_phase_shift(8); ! GobStation *gs = new GobStation(stationSprite, p, buildtype, ! /*"gob.dat#station0picture.bmp"*/ background, name ); ! //delete station_sprite; ! gs->install_external_ai(commander); ! gs->collide_flag_sameship = ALL_LAYERS; ! gs->collide_flag_sameteam = ALL_LAYERS; ! gs->collide_flag_anyone = ALL_LAYERS; ! gobgame->add ( gs ); ! return 0; } --- 102,273 ---- // Register C function for using in lua //////////////////////////////////////////////////////// ! lua_register(L, "AddSun", l_AddSun); lua_register(L, "AddPlanet", l_AddPlanet); lua_register(L, "AddStation", l_AddStation); } ! /*! \brief add sun to gob like game ! \param name (string) name of the star used as unique ID of planet form config script ! \param x (string) sun absciss, can be integer value or '?' for ramdom position ! \param y (string) sun ordinate, can be integer value or '?' for ramdom position ! */ ! static int l_AddSun(lua_State* ls) { ! int top = lua_gettop(ls); // number of argument ! if (top != 3) ! { ! tw_error("Wrong argument count in Add Sun (lua script)"); ! } ! if ( !lua_isstring(ls, 1) ) {tw_error("AddSun wrong argument type for 1 arg");} ! if ( !lua_isstring(ls, 2) ) {tw_error("AddSun wrong argument type for 2 arg");} ! if ( !lua_isstring(ls, 3) ) {tw_error("AddSun wrong argument type for 3 arg");} ! ! const char* name = lua_tostring(ls, 1); ! const char* x = lua_tostring(ls, 2); ! const char* y = lua_tostring(ls, 3); ! ! // Load cordinates ! int nx, ny; ! if ( !strcmp(x, "?") ) ! nx = iround(random (game->size.x)); ! else ! nx = atoi(x); ! ! if ( !strcmp(y, "?") ) ! ny = iround(random (game->size.y)); ! else ! ny = atoi(y); ! Vector2 pos(nx,ny); ! ! char starName[100]; ! sprintf(starName,"Star%03d",random()%1); ! SpaceSprite * StarPic=GetSprite("solar.dat",starName); ! if(StarPic==NULL) error("File error, star pic. Bailing out..."); ! ! Sun *p = new Sun(pos, StarPic, 0); ! if (p == NULL) {tw_error ("Unable to create sun");}; ! //p->SetName(name); + gobgame->add(p); + + return 0; + } /*! \brief add planet to gob like game ! \param name (string) name of the planet used as unique ID of planet form config script ! \param x (string) planets absciss, can be integer value or '?' for ramdom position ! \param y (string) planets ordinate, can be integer value or '?' for ramdom position */ static int l_AddPlanet(lua_State* ls) { ! int top = lua_gettop(ls); // number of argument ! if (top != 3) { ! tw_error("Wrong argument count in Add Planet (lua script)"); } ! if ( !lua_isstring(ls, 1) ) {tw_error("AddPlanet wrong argument type for 1 arg");} ! if ( !lua_isstring(ls, 2) ) {tw_error("AddPlanet wrong argument type for 2 arg");} ! if ( !lua_isstring(ls, 3) ) {tw_error("AddPlanet wrong argument type for 3 arg");} ! const char* name = lua_tostring(ls, 1); ! const char* x = lua_tostring(ls, 2); ! const char* y = lua_tostring(ls, 3); ! // Load cordinates ! int nx, ny; ! if ( !strcmp(x, "?") ) ! nx = iround(random (game->size.x)); ! else ! nx = atoi(x); ! if ( !strcmp(y, "?") ) ! ny = iround(random (game->size.y)); ! else ! ny = atoi(y); ! Vector2 pos(nx,ny); ! Planet *p = create_planet(pos); ! if (p == NULL) {tw_error ("Unable to create planet");}; ! p->SetName(name); ! while (true) { ! SpaceLocation *n; ! n = p->nearest_planet(); ! if (!n || (p->distance(n) > 1500)) break; ! p->translate(random(game->size)); ! } ! return 0; } /*! \brief add gob space station ! \param name (string) space station name ! \param x (string) not used, supposed for station what does not orbiting planet ! \param y (string) not used, supposed for station what does not orbiting planet ! \param buildtype (string) Ship type producing by station ! \param commander (string) External AI script for station commander ! \param orbit (string) nearest planet ! \param sprite (string) sprite for station ! \param background (string) background picture */ static int l_AddStation(lua_State* ls) { ! int top = lua_gettop(ls); // number of argument ! if (top != 8) { ! tw_error("Wrong argument count in Add Planet (lua script)"); } ! if ( !lua_isstring(ls, 1) ) {tw_error("AddStation wrong argument type for 1 arg");} ! if ( !lua_isstring(ls, 2) ) {tw_error("AddStation wrong argument type for 2 arg");} ! if ( !lua_isstring(ls, 3) ) {tw_error("AddStation wrong argument type for 3 arg");} ! if ( !lua_isstring(ls, 4) ) {tw_error("AddStation wrong argument type for 4 arg");} ! if ( !lua_isstring(ls, 5) ) {tw_error("AddStation wrong argument type for 5 arg");} ! if ( !lua_isstring(ls, 6) ) {tw_error("AddStation wrong argument type for 6 arg");} ! if ( !lua_isstring(ls, 7) ) {tw_error("AddStation wrong argument type for 7 arg");} ! if ( !lua_isstring(ls, 8) ) {tw_error("AddStation wrong argument type for 8 arg");} ! const char* name = lua_tostring(ls, 1); ! //const char* x = lua_tostring(ls, 2); ! //const char* y = lua_tostring(ls, 3); ! const char* buildtype = lua_tostring(ls, 4); ! const char* commander = lua_tostring(ls, 5); ! const char* orbit = lua_tostring(ls, 6); ! const char* sprite = lua_tostring(ls, 7); ! const char* background = lua_tostring(ls, 8); ! Planet *p = FindPlanet( orbit ); ! ASSERT (p!= NULL); ! DATAFILE *tmpdata; ! bool c = true; ! std::string file, pic; ! for (unsigned int i = 0; i< strlen(sprite);i++) { ! if (sprite[i] == '#') { ! c = false; ! continue; } ! if (c) ! file +=sprite[i]; ! else ! pic +=sprite[i]; } ! tmpdata = load_datafile_object(file.c_str(), pic.c_str()); ! if (!tmpdata) error( "couldn't find gob.dat#station0sprite"); ! SpaceSprite * stationSprite = new SpaceSprite(tmpdata, 1, SpaceSprite::MASKED | SpaceSprite::MIPMAPED, 64); ! unload_datafile_object(tmpdata); ! stationSprite->permanent_phase_shift(8); ! GobStation *gs = new GobStation(stationSprite, p, buildtype, ! /*"gob.dat#station0picture.bmp"*/ background, name ); ! //delete station_sprite; ! gs->install_external_ai(commander); ! gs->collide_flag_sameship = ALL_LAYERS; ! gs->collide_flag_sameteam = ALL_LAYERS; ! gs->collide_flag_anyone = ALL_LAYERS; ! gobgame->add ( gs ); ! return 0; } |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/gamex Modified Files: gamedata.cpp Log Message: Index: gamedata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** gamedata.cpp 18 Mar 2004 20:54:59 -0000 1.19 --- gamedata.cpp 18 Mar 2004 23:38:38 -0000 1.20 *************** *** 660,664 **** ! char **evildir = (".", "..", "CVS", 0); bool isevildir(char *name) --- 660,664 ---- ! const char * evildir[] = {".", "..", "CVS", NULL}; bool isevildir(char *name) |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/newships Modified Files: shppanav.cpp Log Message: Index: shppanav.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shppanav.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shppanav.cpp 29 Jan 2004 21:20:30 -0000 1.8 --- shppanav.cpp 18 Mar 2004 23:38:39 -0000 1.9 *************** *** 72,78 **** : SpaceObject(creator, 0, 0, osprite), existtime(0), ! maxtime(otime), ! armour(oarmour) { angle = creator->angle + orelangle; --- 72,78 ---- : SpaceObject(creator, 0, 0, osprite), + armour(oarmour), existtime(0), ! maxtime(otime) { angle = creator->angle + orelangle; |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source Modified Files: scp.cpp Log Message: Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** scp.cpp 18 Mar 2004 20:38:20 -0000 1.65 --- scp.cpp 18 Mar 2004 23:38:37 -0000 1.66 *************** *** 662,668 **** int psize; ! psize = 40 * T->scale; FONT *usefont1 = load_ttf_font ("fonts/Jobbernole.ttf", psize, 0); ! psize = 20 * T->scale; FONT *usefont2 = load_ttf_font ("fonts/Jobbernole.ttf", psize, 0); --- 662,668 ---- int psize; ! psize = iround(40 * T->scale); FONT *usefont1 = load_ttf_font ("fonts/Jobbernole.ttf", psize, 0); ! psize = iround(20 * T->scale); FONT *usefont2 = load_ttf_font ("fonts/Jobbernole.ttf", psize, 0); |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:52
|
Update of /cvsroot/timewarp/gamedata/gob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/gamedata/gob Modified Files: config.lua Log Message: Index: config.lua =================================================================== RCS file: /cvsroot/timewarp/gamedata/gob/config.lua,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.lua 5 Mar 2004 17:53:10 -0000 1.1 --- config.lua 18 Mar 2004 23:38:37 -0000 1.2 *************** *** 7,13 **** x = "10", y = "10", ! suns = { {name="Gob Star", x = "1000", y = "1000", sprite="vanguard.dat#Star000"}}, planets = { ! {name="GOB 1", x= "12000", y = "12000" }, {name="GOB 2", x= "?", y = "?" }, {name="GOB 3", x= "?", y = "?" }, --- 7,13 ---- x = "10", y = "10", ! suns = { {name="Gob Star", x = "12000", y = "12000", sprite="vanguard.dat#Star000"}}, planets = { ! {name="GOB 1", x= "?", y = "?" }, {name="GOB 2", x= "?", y = "?" }, {name="GOB 3", x= "?", y = "?" }, *************** *** 58,61 **** --- 58,67 ---- ------------------------------------------------------------------------------ + function InitSuns( suns ) + for a, b in suns do + AddSun (b.name, b.x, b.y ); + end + end + function InitPlanets( planets ) for a, b in planets do *************** *** 72,75 **** --- 78,82 ---- for a, b in Stars do if b.name == "GOB Star" then + InitSuns(b.suns); InitPlanets( b.planets ); InitSpaceStations(b.starbases); |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:51
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148 Modified Files: Doxyfile client.ini makefile Log Message: Index: Doxyfile =================================================================== RCS file: /cvsroot/timewarp/Doxyfile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Doxyfile 28 Feb 2004 01:05:49 -0000 1.5 --- Doxyfile 18 Mar 2004 23:38:36 -0000 1.6 *************** *** 9,13 **** OUTPUT_LANGUAGE = English EXTRACT_ALL = YES ! EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES --- 9,13 ---- OUTPUT_LANGUAGE = English EXTRACT_ALL = YES ! EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES *************** *** 32,36 **** SORT_MEMBER_DOCS = YES DISTRIBUTE_GROUP_DOC = NO ! TAB_SIZE = 8 GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES --- 32,36 ---- SORT_MEMBER_DOCS = YES DISTRIBUTE_GROUP_DOC = NO ! TAB_SIZE = 4 GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES *************** *** 180,183 **** DOC_URL = DOC_ABSPATH = ! BIN_ABSPATH = /usr/local/bin/ EXT_DOC_PATHS = --- 180,183 ---- DOC_URL = DOC_ABSPATH = ! #BIN_ABSPATH = /usr/local/bin/ EXT_DOC_PATHS = Index: client.ini =================================================================== RCS file: /cvsroot/timewarp/client.ini,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** client.ini 15 Mar 2004 22:20:14 -0000 1.30 --- client.ini 18 Mar 2004 23:38:36 -0000 1.31 *************** *** 19,23 **** ;valid = values are 8 (ugly), 15, 16, 24 (slow), and 32 ! FullScreen = 2 ; = 0 = windowed, 1 = fullscreen --- 19,23 ---- ;valid = values are 8 (ugly), 15, 16, 24 (slow), and 32 ! FullScreen = 0 ; = 0 = windowed, 1 = fullscreen *************** *** 78,82 **** [Menu] skin = interfaces/gametest ! SelectGame = 5 --- 78,82 ---- [Menu] skin = interfaces/gametest ! SelectGame = 16 Index: makefile =================================================================== RCS file: /cvsroot/timewarp/makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** makefile 15 Mar 2004 22:20:14 -0000 1.13 --- makefile 18 Mar 2004 23:38:36 -0000 1.14 *************** *** 17,21 **** CC = g++ LD = g++ ! CFLAGS = -fsigned-char -Wall OBJDIR = obj NAME = TimeWarp --- 17,21 ---- CC = g++ LD = g++ ! CFLAGS = -fsigned-char -Wall -Wno-deprecated-declarations OBJDIR = obj NAME = TimeWarp |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:36
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/sc2ships Modified Files: shpkohma.cpp Log Message: Index: shpkohma.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpkohma.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpkohma.cpp 29 Jan 2004 21:20:31 -0000 1.5 --- shpkohma.cpp 18 Mar 2004 23:38:39 -0000 1.6 *************** *** 126,132 **** AnimatedShot(oship, opos, oangle, ov, odamage, -1.0, oarmour, oship, osprite, ofcount, ofsize), passive(FALSE), ! passiveRange(orange), ! persist(_persists) { explosionSprite = data->spriteWeaponExplosion; --- 126,132 ---- AnimatedShot(oship, opos, oangle, ov, odamage, -1.0, oarmour, oship, osprite, ofcount, ofsize), + persist(_persists), passive(FALSE), ! passiveRange(orange) { explosionSprite = data->spriteWeaponExplosion; |
From: Yura S. <yu...@us...> - 2004-03-18 23:48:36
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6148/source/twgui Modified Files: gametest2.cpp twguilist.cpp Log Message: Index: twguilist.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twguilist.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** twguilist.cpp 15 Mar 2004 22:20:33 -0000 1.3 --- twguilist.cpp 18 Mar 2004 23:38:54 -0000 1.4 *************** *** 485,489 **** for ( k = 0; k < L; ++k ) { ! if (txt[k] < 20 || txt[k] > 127 ) txt[k] = ' '; } --- 485,489 ---- for ( k = 0; k < L; ++k ) { ! if ((unsigned char)txt[k] < 20 || (unsigned char)txt[k] > 127 ) txt[k] = ' '; } *************** *** 836,840 **** for ( k = 0; k < L; ++k ) { ! if (txt[k] < 20 || txt[k] > 127 ) txt[k] = ' '; } --- 836,840 ---- for ( k = 0; k < L; ++k ) { ! if ((unsigned char)txt[k] < 20 || (unsigned char)txt[k] > 127 ) txt[k] = ' '; } *************** *** 849,853 **** textinfo->getxy(charpos, &xc, &yc); yc /= textinfo->Htxt; - //yc = scroll.yselect; int h; --- 849,852 ---- Index: gametest2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/gametest2.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gametest2.cpp 17 Mar 2004 22:27:38 -0000 1.9 --- gametest2.cpp 18 Mar 2004 23:38:54 -0000 1.10 *************** *** 812,814 **** REGISTER_GAME(TWgui, "TWgui") ! */ \ No newline at end of file --- 812,814 ---- REGISTER_GAME(TWgui, "TWgui") ! */ |
From: Rob <geo...@us...> - 2004-03-18 21:09:49
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6000/gamex Modified Files: gamegeneral.cpp Log Message: video bitmap issue Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gamegeneral.cpp 18 Mar 2004 20:54:59 -0000 1.16 --- gamegeneral.cpp 18 Mar 2004 21:00:10 -0000 1.17 *************** *** 190,195 **** // can use the masked_blit operation without problems). bmplist[i] = 0; if (vidmem) ! create_video_bitmap(tmpbmp->w, tmpbmp->h); if (!bmplist[i]) bmplist[i] = create_bitmap_ex(bpp, tmpbmp->w, tmpbmp->h); --- 190,197 ---- // can use the masked_blit operation without problems). bmplist[i] = 0; + if (vidmem) ! bmplist[i] = create_video_bitmap(tmpbmp->w, tmpbmp->h); ! if (!bmplist[i]) bmplist[i] = create_bitmap_ex(bpp, tmpbmp->w, tmpbmp->h); *************** *** 200,206 **** if (scale != 1) { if (vidmem) tmpbmp = create_video_bitmap(iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); ! else tmpbmp = create_bitmap_ex(bpp, iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); --- 202,211 ---- if (scale != 1) { + tmpbmp = 0; + if (vidmem) tmpbmp = create_video_bitmap(iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); ! ! if (!tmpbmp) tmpbmp = create_bitmap_ex(bpp, iround(bmplist[i]->w * scale), iround(bmplist[i]->h * scale)); |
From: Rob <geo...@us...> - 2004-03-18 21:04:42
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/gamex Modified Files: gamedata.cpp gamedata.h gamegeneral.cpp gamesolarview.cpp Log Message: added directory check Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** gamegeneral.cpp 18 Mar 2004 20:41:27 -0000 1.15 --- gamegeneral.cpp 18 Mar 2004 20:54:59 -0000 1.16 *************** *** 9,12 **** --- 9,13 ---- #include "../frame.h" + #include "gamedata.h" #include "gamegeneral.h" *************** *** 712,716 **** while (!err) { ! if (info.name[0] != '.') ++(*N); err = al_findnext(&info); --- 713,717 ---- while (!err) { ! if (!isevildir(info.name)) ++(*N); err = al_findnext(&info); *************** *** 730,734 **** while (!err) { ! if (info.name[0] != '.') { if (!remext) --- 731,735 ---- while (!err) { ! if (!isevildir(info.name)) { if (!remext) Index: gamesolarview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamesolarview.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gamesolarview.cpp 18 Mar 2004 20:41:27 -0000 1.16 --- gamesolarview.cpp 18 Mar 2004 20:54:59 -0000 1.17 *************** *** 73,77 **** while (!err) { ! if (info.name[0] != '.') tl->add_optionlist(info.name); --- 73,77 ---- while (!err) { ! if (!isevildir(info.name)) tl->add_optionlist(info.name); Index: gamedata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** gamedata.cpp 18 Mar 2004 20:38:19 -0000 1.18 --- gamedata.cpp 18 Mar 2004 20:54:59 -0000 1.19 *************** *** 660,663 **** --- 660,681 ---- + char **evildir = (".", "..", "CVS", 0); + + bool isevildir(char *name) + { + if (!name) + return false; + + int i = 0; + while (evildir[i] != 0) + { + if (strcmp(name, evildir[i]) == 0) + return true; + } + + return false; + } + + void RaceManager::readracelist() { *************** *** 675,679 **** racename = info.name; ! if (racename && racename[0] != '.') { --- 693,697 ---- racename = info.name; ! if (!isevildir(racename)) { Index: gamedata.h =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** gamedata.h 12 Mar 2004 20:14:58 -0000 1.16 --- gamedata.h 18 Mar 2004 20:54:59 -0000 1.17 *************** *** 7,11 **** //#include "gamedata_map.h" ! const bool hascontent(char *t); --- 7,11 ---- //#include "gamedata_map.h" ! bool isevildir(char *name); const bool hascontent(char *t); |
From: Rob <geo...@us...> - 2004-03-18 21:04:40
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/twgui Modified Files: twmenuexamples.cpp Log Message: added directory check Index: twmenuexamples.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** twmenuexamples.cpp 18 Mar 2004 20:38:21 -0000 1.6 --- twmenuexamples.cpp 18 Mar 2004 20:54:59 -0000 1.7 *************** *** 341,345 **** while (!err) { ! if (info.name[0] != '.') { char tmp[512]; --- 341,345 ---- while (!err) { ! if (strcmp(info.name, ".") != 0 && strcmp(info.name, "..") != 0) { char tmp[512]; |
From: Rob <geo...@us...> - 2004-03-18 20:51:25
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv402/gamex Modified Files: gamegeneral.cpp gamesolarview.cpp Log Message: plus other "." problems perhaps Index: gamegeneral.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamegeneral.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gamegeneral.cpp 29 Feb 2004 23:22:17 -0000 1.14 --- gamegeneral.cpp 18 Mar 2004 20:41:27 -0000 1.15 *************** *** 712,716 **** while (!err) { ! if (strcmp(info.name, ".") && strcmp(info.name, "..") ) ++(*N); err = al_findnext(&info); --- 712,716 ---- while (!err) { ! if (info.name[0] != '.') ++(*N); err = al_findnext(&info); *************** *** 730,734 **** while (!err) { ! if (strcmp(info.name, ".") && strcmp(info.name, "..") ) { if (!remext) --- 730,734 ---- while (!err) { ! if (info.name[0] != '.') { if (!remext) Index: gamesolarview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamesolarview.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** gamesolarview.cpp 29 Feb 2004 23:22:17 -0000 1.15 --- gamesolarview.cpp 18 Mar 2004 20:41:27 -0000 1.16 *************** *** 73,77 **** while (!err) { ! if (strcmp(info.name, ".") && strcmp(info.name, "..") ) tl->add_optionlist(info.name); --- 73,77 ---- while (!err) { ! if (info.name[0] != '.') tl->add_optionlist(info.name); |
From: Rob <geo...@us...> - 2004-03-18 20:48:02
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32208/twgui Modified Files: twmenuexamples.cpp Log Message: committing a patch for nic, and some wip. Index: twmenuexamples.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twmenuexamples.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** twmenuexamples.cpp 28 Feb 2004 15:16:32 -0000 1.5 --- twmenuexamples.cpp 18 Mar 2004 20:38:21 -0000 1.6 *************** *** 341,345 **** while (!err) { ! if (strcmp(info.name, ".") && strcmp(info.name, "..") ) { char tmp[512]; --- 341,345 ---- while (!err) { ! if (info.name[0] != '.') { char tmp[512]; |
From: Rob <geo...@us...> - 2004-03-18 20:48:02
|
Update of /cvsroot/timewarp/source/games In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32208/games Modified Files: gflmelee.cpp gsample.cpp gtrug.cpp Log Message: committing a patch for nic, and some wip. Index: gtrug.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gtrug.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gtrug.cpp 17 Mar 2004 22:27:36 -0000 1.12 --- gtrug.cpp 18 Mar 2004 20:38:20 -0000 1.13 *************** *** 232,236 **** add(create_ship("chebr", cp, random(size), random(PI2))); ! if (glog->type == Log::log_net1client) add(gui = new TrugGUI( cp )); else --- 232,236 ---- add(create_ship("chebr", cp, random(size), random(PI2))); ! if (p_local != 0) add(gui = new TrugGUI( cp )); else Index: gflmelee.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gflmelee.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gflmelee.cpp 17 Mar 2004 22:27:36 -0000 1.23 --- gflmelee.cpp 18 Mar 2004 20:38:20 -0000 1.24 *************** *** 495,499 **** */ ! if (glog->type == Log::log_net1server || glog->type == Log::log_normal) { start_menu(allyfleet); --- 495,499 ---- */ ! if (p_local = 0) { start_menu(allyfleet); Index: gsample.cpp =================================================================== RCS file: /cvsroot/timewarp/source/games/gsample.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gsample.cpp 17 Mar 2004 22:27:36 -0000 1.12 --- gsample.cpp 18 Mar 2004 20:38:20 -0000 1.13 *************** *** 416,420 **** add(sp); ! if ((glog->type == Log::log_net1server) || (glog->type == Log::log_net1client)) { log_file("fleets/all.scf"); i = human_control[1]->choose_ship(window, "Hey You!\nPick a ship!", reference_fleet); --- 416,420 ---- add(sp); ! if (glog->type == Log::log_net) { log_file("fleets/all.scf"); i = human_control[1]->choose_ship(window, "Hey You!\nPick a ship!", reference_fleet); *************** *** 482,486 **** for (i = 0; i < 7; i += 1) add(new Asteroid()); ! if (glog->type == Log::log_net1server) fleet.load("fleets/all.scf", "Fleet"); log_fleet(channel_server, &fleet); //this time, instead of transmitting the fleet file over the network and then loading --- 482,486 ---- for (i = 0; i < 7; i += 1) add(new Asteroid()); ! if (p_local = 0) fleet.load("fleets/all.scf", "Fleet"); log_fleet(channel_server, &fleet); //this time, instead of transmitting the fleet file over the network and then loading |
From: Rob <geo...@us...> - 2004-03-18 20:48:01
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32208/melee Modified Files: mgame.cpp mlog.h mmain.cpp mmain.h Log Message: committing a patch for nic, and some wip. Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** mmain.cpp 18 Mar 2004 16:03:27 -0000 1.33 --- mmain.cpp 18 Mar 2004 20:38:20 -0000 1.34 *************** *** 27,30 **** --- 27,32 ---- //#include "../other/radar.h" + #include "mnet1.h" + *************** *** 177,182 **** } break; ! case Log::log_net1client: ! case Log::log_net1server: { //log_file("server.ini"); --- 179,183 ---- } break; ! case Log::log_net: { //log_file("server.ini"); *************** *** 514,519 **** Fleet *fleet = p->fleet; switch (glog->type) { ! case Log::log_net1client: ! case Log::log_net1server: { // if (log->get_direction(player_control[i]->channel) & Log::direction_write) message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", p->name, fleet->getSize(), fleet->getCost()); --- 515,519 ---- Fleet *fleet = p->fleet; switch (glog->type) { ! case Log::log_net: { // if (log->get_direction(player_control[i]->channel) & Log::direction_write) message.print(6000, 15, "%s status: : %d / ?? Ships, %d / ??? points", p->name, fleet->getSize(), fleet->getCost()); *************** *** 598,602 **** FILE *f; int L; ! const int N = 1024; char fdata[N]; --- 598,602 ---- FILE *f; int L; ! const int N = 50000; char fdata[N]; *************** *** 607,611 **** int k = 0; - log_int(k, channel_server); // this is probably enough --> the server has sent all data to you. // there's nothing you've to send to the server, so it's ok. --- 607,610 ---- *************** *** 613,675 **** // also, check which socket-connection you should use... - if (p_local == 0) // the host - { - // how does the server determine, who needs the data ? - // each should send a value to the server, telling whether - // the data are ok, or not ... - int p = 0; // should be opposite player? - k = channel_conn_recv[ player[p]->channel + _channel_buffered ]; ! // duh, this is getting complicated ! f = fopen(filename, "rb"); ! for (;;) ! { L = fread(fdata, N, 1, f); ! log_int(L); - if (L == 0) - break; - else - // this is wrong - log_data(fdata, L, channel_file_data); - // glog->net.conn[..]->send(); <-- should be something like this ! count += L; ! message.print(1500, 15, "sent %i bytes", count); ! message.animate(0); ! } } - else - { - f = fopen(filename, "wb"); ! for (;;) ! { ! log_int(L); ! if (L == 0) ! break; ! else ! // this is wrong ! log_data(fdata, L, channel_file_data); - fwrite(fdata, L, 1, f); ! count += L; ! message.print(1500, 15, "received %i bytes", count); ! message.animate(0); ! } } ! fclose(f); } ! void NormalGame::check_file(const char *id) { ShipType *type = shiptype(id); --- 612,778 ---- // also, check which socket-connection you should use... ! if (direct.isserver) // the host f = fopen(filename, "rb"); + // else + // f = fopen(filename, "wb"); + ! for (;;) ! { ! if (direct.isserver) // the host reads L = fread(fdata, N, 1, f); + ! direct.server(L); ! ! if (L == 0) ! break; ! else ! direct.server(fdata, L); // synch data with those on the server ! // if (!direct.isserver) // the client writes ! // fwrite(fdata, L, 1, f); ! ! count += L; ! message.print(1500, 15, "send/received %i bytes", count); ! message.animate(0); } ! fclose(f); ! } ! ! // SERVER CONTROLLED ACTIONS: ! // pause means, the player will wait for the server till it sends some signal ! // continue means, the server sends this signal !! ! void server_pause() ! { ! int k; ! if (p_local != 0) ! log_int(k, channel_server); // wait for server data ! } ! ! void server_continue() ! { ! int k; ! if (p_local == 0) ! log_int(k, channel_server); // generate server data ! } ! ! ! ! DirectConnection direct; ! ! // THIS IS SET FROM THE VIEWPOINT OF THE HOST ! // i.e., channel_server is always one of the channels already. You only need ! // to specify the other channel. ! // ! // note, that this always sets a connection between the host/client. ! // the code should take care that, if neither are "local", it's skipped, so ! // that only the true local players are using this ... ! ! bool DirectConnection::set(int i) ! { ! // if it's not a networked game. ! if (glog->type != Log::log_net) ! return false; ! ! // define a direct connection between the 2 players ! // you need to check which player is "local" and which ! // is "remote" and to which channel it belongs... ! ! int ch = player[i]->channel; ! ! // the host doesn't need to connect to itself. ! if (ch == channel_server) ! return false; ! ! // neither are "local" to this computer, so skip it... ! if (!(is_local(channel_server) || is_local(ch) )) ! return false; ! ! // create a connection from host to client, or the other way around; in each ! // case, it's stored in conn_remote. ! ! // note that this is somewhat dangerous - cause, if different players want ! // to connect at the same time, you get a mess... ! ! if (is_local(ch)) ! { ! conn_remote = channel_conn_recv[ channel_server]; ! isserver = false; ! } ! else ! { ! conn_remote = channel_conn_recv[ ch ]; ! isserver = true; } ! return true; ! } ! ! ! void DirectConnection::send(void *data, int N) ! { ! ((NetLog*)glog)->net[conn_remote].add2buffer((char*)data, N); ! ((NetLog*)glog)->net[conn_remote].sendall(); ! } + void DirectConnection::get(void *data, int N) + { + ((NetLog*)glog)->net[conn_remote].recv(N, N, data); } + void DirectConnection::exchange(void *data, int N) + { + send(data, N); + get(data, N); + } ! void DirectConnection::server(void *data, int N) { + if (isserver) + send(data, N); + else + get(data, N); + } + + void DirectConnection::client(void *data, int N) + { + if (!isserver) + send(data, N); + else + get(data, N); + } + + + + void DirectConnection::exchange(int &x) + { + exchange(&x, sizeof(int)); + } + + void DirectConnection::server(int &x) + { + server(&x, sizeof(int)); + } + + void DirectConnection::client(int &x) + { + client(&x, sizeof(int)); + } + + + + void NormalGame::check_file(const char *id, int iplayer) + { + // STILL NEEDS TO BE CHECKED / WRITTEN, + // so disabled for now. + return; + ShipType *type = shiptype(id); *************** *** 685,702 **** // (assumption here is, that the host has the most recent version) ! log_int(otherfsize, channel_file_data); ! ! // so ... if your local version differes from the host version, then ... ! if (otherfsize != myfsize) { ! // int i = tw_alert("File mismatch; download file from server?", "&Ok", "&Abort"); ! // if ( i == 2) ! // { ! tw_error("DAT files have different size! This may cause a desynch"); ! // } else { ! // download_file(type->data->file); ! // } } } --- 788,816 ---- // (assumption here is, that the host has the most recent version) ! if (direct.set(iplayer)) { ! direct.server(otherfsize); // receive host-filesize, overwrite local setting. ! ! // so ... if your local version differes from the host version, then ... ! int difference = otherfsize - myfsize; ! direct.client(difference); // receive client difference ! ! if (difference != 0) ! { ! int i = tw_alert("File mismatch; download file from server?", "&Ok", "&Abort"); ! direct.client(i); // the server should also have this value (and wait till it's chosen..) ! if ( i == 2) ! { ! tw_error("DAT files have different size! This may cause a desynch"); ! } else { ! download_file(type->data->file); ! } ! ! } } + + server_pause(); + server_continue(); } *************** *** 787,791 **** ! check_file(fleet->getShipType(slot[i])->id); --- 901,905 ---- ! check_file(fleet->getShipType(slot[i])->id, i); Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** mgame.cpp 18 Mar 2004 16:03:26 -0000 1.39 --- mgame.cpp 18 Mar 2004 20:38:20 -0000 1.40 *************** *** 547,552 **** } break; ! case Log::log_net1server: ! case Log::log_net1client: { int i; bool result = true; --- 547,551 ---- } break; ! case Log::log_net: { int i; bool result = true; *************** *** 946,950 **** idle(n); tot_idle_time += n; ! if (glog->type == Log::log_net1client || glog->type == Log::log_net1server) { NetLog *l = (NetLog*) glog; --- 945,949 ---- idle(n); tot_idle_time += n; ! if (glog->type == Log::log_net) { NetLog *l = (NetLog*) glog; *************** *** 1017,1021 **** #include "../util/profile2.h" void Game::fps() {STACKTRACE ! if ((!glog->playback) && ((glog->type == Log::log_net1server) || (glog->type == Log::log_net1client))) { char tmp[512]; --- 1016,1020 ---- #include "../util/profile2.h" void Game::fps() {STACKTRACE ! if ((!glog->playback) && (glog->type == Log::log_net)) { char tmp[512]; *************** *** 1148,1155 **** } break; ! case Log::log_net1server: { ! } ! break; ! case Log::log_net1client: { } break; --- 1147,1151 ---- } break; ! case Log::log_net: { } break; *************** *** 1259,1263 **** //message.animate(0); ! if ((glog->type == Log::log_net1server) || (glog->type == Log::log_net1client)) { int lag_time = 0;//get_config_int("Network", "Lag", 200); int blah = 0; --- 1255,1259 ---- //message.animate(0); ! if (glog->type == Log::log_net) { int lag_time = 0;//get_config_int("Network", "Lag", 200); int blah = 0; *************** *** 1991,1995 **** int k; for ( k = 0; k < num_network; ++k ) ! ((NetLog*)glog)->rem_conn(k); } --- 1987,1992 ---- int k; for ( k = 0; k < num_network; ++k ) ! if (glog->type == Log::log_net) ! ((NetLog*)glog)->rem_conn(k); } Index: mlog.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mlog.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mlog.h 17 Mar 2004 22:27:37 -0000 1.8 --- mlog.h 18 Mar 2004 20:38:20 -0000 1.9 *************** *** 60,64 **** int type; enum { ! log_normal = 0, log_net1server = 2, log_net1client = 3 }; bool playback; --- 60,64 ---- int type; enum { ! log_normal = 0, log_net = 1 }; bool playback; Index: mmain.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mmain.h 17 Mar 2004 23:24:00 -0000 1.14 --- mmain.h 18 Mar 2004 20:38:20 -0000 1.15 *************** *** 16,19 **** --- 16,48 ---- }; + + + class DirectConnection + { + int conn_remote; + + public: + + bool isserver; + + bool set(int i); + + void get(void *data, int N); + void send(void *data, int N); + + void exchange(void *data, int N); // host and client send each other data + void server(void *data, int N); // host sends data (client receives) --> host data are copied + void client(void *data, int N); // client sends data (host receives) --> client data are copied + + void exchange(int &x); + void server(int &x); + void client(int &x); + + + }; + + extern DirectConnection direct; + + class NormalGame : public Game { public: *************** *** 73,77 **** ! void check_file(const char *id); void download_file(char *filename); --- 102,106 ---- ! void check_file(const char *id, int iplayer); void download_file(char *filename); |
From: Rob <geo...@us...> - 2004-03-18 20:48:01
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32208 Modified Files: scp.cpp Log Message: committing a patch for nic, and some wip. Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** scp.cpp 18 Mar 2004 16:03:26 -0000 1.64 --- scp.cpp 18 Mar 2004 20:38:20 -0000 1.65 *************** *** 202,209 **** return log; } ! case Log::log_net1server: { netlog = new NetLog(); netlog->init(); ! netlog->type = Log::log_net1server; return netlog; } --- 202,209 ---- return log; } ! case Log::log_net: { netlog = new NetLog(); netlog->init(); ! netlog->type = Log::log_net; return netlog; } *************** *** 787,791 **** if (ishost) { ! log->type = Log::log_net1server; int status = -1; --- 787,791 ---- if (ishost) { ! log->type = Log::log_net; int status = -1; *************** *** 908,912 **** } else { ! log->type = Log::log_net1client; // channel_init and such, are all read-only for the clients --- 908,912 ---- } else { ! log->type = Log::log_net; // channel_init and such, are all read-only for the clients *************** *** 1153,1157 **** NetLog *log = new NetLog(); log->init(); ! log->type = Log::log_net1client; log->set_all_directions(Log::direction_read); --- 1153,1157 ---- NetLog *log = new NetLog(); log->init(); ! log->type = Log::log_net; log->set_all_directions(Log::direction_read); *************** *** 1202,1206 **** log->init(); ! log->type = Log::log_net1server; log->set_all_directions(Log::direction_write | Log::direction_read | NetLog::direction_immediate); int p; --- 1202,1206 ---- log->init(); ! log->type = Log::log_net; log->set_all_directions(Log::direction_write | Log::direction_read | NetLog::direction_immediate); int p; |
From: Rob <geo...@us...> - 2004-03-18 20:48:00
|
Update of /cvsroot/timewarp/source/gamex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32208/gamex Modified Files: gamedata.cpp Log Message: committing a patch for nic, and some wip. Index: gamedata.cpp =================================================================== RCS file: /cvsroot/timewarp/source/gamex/gamedata.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** gamedata.cpp 12 Mar 2004 20:14:57 -0000 1.17 --- gamedata.cpp 18 Mar 2004 20:38:19 -0000 1.18 *************** *** 675,679 **** racename = info.name; ! if (strcmp(racename, ".") != 0 && strcmp(racename, "..") != 0) { --- 675,679 ---- racename = info.name; ! if (racename && racename[0] != '.') { |
From: Rob <geo...@us...> - 2004-03-18 16:36:20
|
Update of /cvsroot/timewarp/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8591 Added Files: network_manual.txt Log Message: some notes on the networking --- NEW FILE: network_manual.txt --- Important variables (for networking): -------------------- const int max_connections = 20; maximum number of connections allowed. max_network num_network: number of computers connected in a network this defines the # of unique channels num_hotseat: number of people behind each computer they share a channel no limit num_bots: number of AI bots always on channel_none no limit max_player num_players: total number of "players" in the game, namely, all people and the bots. their properties are stored in Control player_control[i]->channel, should be one of num_network channels. IMPORTANT OTHER VARIABLES: p_local: the local network number; each is unique, and the host is labeled 0. channel_current: in some cases, used as a short-cut for log_int. log_synched: indicates read-mode for channel-data, which is always synched between games. This can only be used together with log_setmode(), which is used to tweak the degault read/write permissions to enter either total read- or total write-state (this is used in events). CHANNELS: channel_init, channel_network[]: Channels are owned by a player. Usually each player is assigned two channels with write-permission, except the host, which also has write-permission on special channels for file-sharing and initialization. channel_conn_recv: Because of the above, a channel is usually specific to a network-connection (channel-info is only received from the network-player who has write permission). Each time a conenction receives information on a certain channel, the connection-number that is active at that time is recorded in channel_conn_recv. Then, through knowledge of the channel of a player, you can find the connection of that player. You need to have shared a little data before this is usable !! PITFALLS: checks on networked values are sometimes difficult, cause because of the lag, a remote computer could already have sent you values, from a part of your program, that your own running version hasn't reached yet. rand() should be avoided. However, using random() for host-side init-calculations (which are typically non-synched, e.g. the host is the only one who can select something in a menu), can also cause a desynch. |
From: Rob <geo...@us...> - 2004-03-18 16:13:06
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2842/melee Modified Files: mgame.cpp mlog.cpp mmain.cpp mnet1.cpp mnet1.h Log Message: networking update Index: mlog.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mlog.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mlog.cpp 17 Mar 2004 23:24:00 -0000 1.15 --- mlog.cpp 18 Mar 2004 16:03:27 -0000 1.16 *************** *** 546,549 **** --- 546,552 ---- ++Nshare; + + message.print(1500, 15, "Nshare[%i] size[%i]", Nshare, share_num[Nshare-1] * share_size[Nshare-1]); + message.animate(0); } Index: mnet1.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mnet1.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mnet1.h 17 Mar 2004 22:27:37 -0000 1.9 --- mnet1.h 18 Mar 2004 16:03:27 -0000 1.10 *************** *** 48,52 **** ! const int max_connections = 20; // note, that I'll assume that (channel/4) equals the connection number. --- 48,52 ---- ! const int max_connections = 100; // note, that I'll assume that (channel/4) equals the connection number. Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** mgame.cpp 18 Mar 2004 01:50:59 -0000 1.38 --- mgame.cpp 18 Mar 2004 16:03:26 -0000 1.39 *************** *** 690,693 **** --- 690,697 ---- for ( i = 1; i < num_network; ++i ) // note, 0==server. { + // this checks for "null" channels... + if (glog->log_dir[channel_network[i] + CHECKSUM_CHANNEL] == 0) + continue; + client_checksum[i] = local_checksum; log_char(client_checksum[i], channel_network[i] + CHECKSUM_CHANNEL); *************** *** 1930,1934 **** // THIS IS (more or less) THE OLD STUFF // it'll stop all connected games as well... ! if (log_synched) { game->quit("none"); --- 1934,1938 ---- // THIS IS (more or less) THE OLD STUFF // it'll stop all connected games as well... ! if (false && log_synched) { game->quit("none"); *************** *** 1975,2006 **** void Game::remove_player(int i) { - // THIS DESYNCHES THE GAME !! - message.print(1500, 15, "removing player[%i]", i); message.animate(0); // if you're the local player, simply quit the game if (is_local(player[i]->channel)) { ! //game->quit("quit - Game aborted from keyboard"); ! // player[i]->control->select_ship(0, "none"); } player[i]->status = 0; // tell the game, that this player is gone ?! - // not really used. - // player[i]->die(); - message.print(1500, 14, "frame[%i] time[%i]", frame_number, game_time); // Disable that players buffered channel ... (but keep the direct channel) ! int ch = player[i]->channel + _channel_buffered; glog->log_dir[ch] = 0; // remove the players network-connection from the network... which network conn. ! // goes to that player... ? ! int k; ! k = channel_conn_recv[ player[i]->channel + _channel_buffered ]; ! ((NetLog*)glog)->rem_conn(k); ! //-- num_network; ! //channel_network[k] = channel_network[num_network]; // remove the player from the player-list, so that its data won't be used anymore... --- 1979,2021 ---- void Game::remove_player(int i) { message.print(1500, 15, "removing player[%i]", i); message.animate(0); + // if you're the local player, simply quit the game if (is_local(player[i]->channel)) { ! game->quit("none"); ! //tw_alert("Stopping", "&Ok"); ! ! // remove the connections to all other players ! int k; ! for ( k = 0; k < num_network; ++k ) ! ((NetLog*)glog)->rem_conn(k); } + + player[i]->status = 0; // tell the game, that this player is gone ?! // Disable that players buffered channel ... (but keep the direct channel) ! // cause it's still in the networking part ... ! int ch; ! int k; ! ! ch = player[i]->channel + _channel_buffered; glog->log_dir[ch] = 0; // remove the players network-connection from the network... which network conn. ! // goes to that player... well, that's analyzed on-the-fly by the packet ! // receiving algorithm (most channels are only owned by 1 player, on 1 network ! // connection) ! k = channel_conn_recv[ ch ]; ! message.print(1500, 14, "REMOVE channel[%i] conn[%i]", ch, k ); ! message.animate(0); ! if (p_local == 0) readkey(); ! ! if (k >= 0) ! ((NetLog*)glog)->rem_conn(k); // remove the player from the player-list, so that its data won't be used anymore... *************** *** 2008,2011 **** --- 2023,2030 ---- player[i] = player[num_players]; + + + + message.print(1500, 14, "frame[%i] time[%i]", frame_number, game_time); } Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mmain.cpp 17 Mar 2004 23:24:00 -0000 1.32 --- mmain.cpp 18 Mar 2004 16:03:27 -0000 1.33 *************** *** 603,608 **** --- 603,610 ---- int count = 0; + // first you've to check if you're synched int k = 0; + log_int(k, channel_server); // this is probably enough --> the server has sent all data to you. *************** *** 616,619 **** --- 618,623 ---- // each should send a value to the server, telling whether // the data are ok, or not ... + int p = 0; // should be opposite player? + k = channel_conn_recv[ player[p]->channel + _channel_buffered ]; // duh, this is getting complicated *************** *** 1036,1039 **** --- 1040,1045 ---- have routines that synchronize the two games explicitly in the code (ie synchronized halts). This buffer should be empty most of the time, except in special situations. + Note that it uses calls to random(), so be sure that the random() is synched before + you use these routines. */ void log_test(char *comment) *************** *** 1044,1047 **** --- 1050,1056 ---- k = random(); m = k; + + message.print(1500, 13, "log_test ran[%i]", k); + message.animate(0); int i; Index: mnet1.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mnet1.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mnet1.cpp 17 Mar 2004 23:24:00 -0000 1.13 --- mnet1.cpp 18 Mar 2004 16:03:27 -0000 1.14 *************** *** 727,730 **** --- 727,731 ---- { net_status[conn] = false; + net[conn].disconnect(); } |
From: Rob <geo...@us...> - 2004-03-18 16:13:05
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2842 Modified Files: scp.cpp Log Message: networking update Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** scp.cpp 17 Mar 2004 23:24:01 -0000 1.63 --- scp.cpp 18 Mar 2004 16:03:26 -0000 1.64 *************** *** 760,763 **** --- 760,766 ---- set_global(log); // this sets glog + log_set_nofake(); // perhaps some (global) settings were still present + log_resetmode(); // after leaving the last game ... (duh!) + // resets the channels to their default values ; that's needed, cause if there are // bots in the game, channel values can be set to non-human values (-1) *************** *** 839,843 **** int val; char *addr = 0; ! int Lstr; for ( n = 1; n < Nplayers; ++n ) // exclude the local player from this. --- 842,846 ---- int val; char *addr = 0; ! // int Lstr; for ( n = 1; n < Nplayers; ++n ) // exclude the local player from this. *************** *** 866,873 **** --- 869,879 ---- share(-1, &n); + /* Lstr = strlen(addr) + 1; share(-1, &Lstr); share_update(); share(-1, addr, Lstr); + */ + share_string(addr); share_update(); *************** *** 878,887 **** } ! if (addr) ! { ! int kstart = 0; share(-1, &val); share(-1, &kstart); Lstr = strlen(addr) + 1; share(-1, &Lstr); --- 884,894 ---- } ! addr = "signalstart"; ! int kstart = 0; // this signals the end for the client. ! share(-1, &val); share(-1, &kstart); + /* Lstr = strlen(addr) + 1; share(-1, &Lstr); *************** *** 889,896 **** share(-1, addr, Lstr); share_update(); message.print(1500, 14, "SHARED [%i] [%i] [%s]", val, kstart, addr); message.animate(0); - } --- 896,904 ---- share(-1, addr, Lstr); share_update(); + */ + share_string(addr); message.print(1500, 14, "SHARED [%i] [%i] [%s]", val, kstart, addr); message.animate(0); *************** *** 937,941 **** // receive some data on channel_init ! int Lstr; int val = -1; message.print(1500, 14, "SHARING(receiving)"); --- 945,949 ---- // receive some data on channel_init ! // int Lstr; int val = -1; message.print(1500, 14, "SHARING(receiving)"); *************** *** 951,958 **** --- 959,969 ---- share(-1, &p); // you receive your own (local) player number + /* share(-1, &Lstr); share_update(); share(-1, addr, Lstr); share_update(); + */ + share_string(addr); message.print(1500, 14, "SHARED [%i] [%i] [%s]", val, p, addr); *************** *** 1001,1007 **** } log_test("a1"); ! log_resetmode(); log->reset(); --- 1012,1034 ---- } + // note that the server has "local" settings which overwrite other players' setting + num_network = Nplayers; + num_bots = Nbots; + + message.print(1500, 13, "numnet [%i]", num_network); + + share(-1, &num_network); + share(-1, &num_bots); + share_update(); + // you've to share num_network this as early as possible, cause it's also + // important for the debugging part (log_test). + + // for log_test, also (re-)initialize the rng + rand_resync(); + + log_test("a1"); ! //log_resetmode(); log->reset(); *************** *** 1034,1048 **** ! // quick hack for testing. ! // note that the server has "local" settings which overwrite other players' setting ! num_network = Nplayers; ! num_bots = Nbots; ! ! share(-1, &num_network); ! share(-1, &num_bots); ! share_update(); message.print(1500, 13, "numnet [%i] numhotseat [%i][%i]", num_network, num_hotseats[0], num_hotseats[1]); --- 1061,1079 ---- + int k1 = 2, k2 = 3, k3 = 5; + share(-1, &k1); + share(-1, &k2); + share(-1, &k3); + share_update(); + log_test("a10"); ! message.print(1500, 13, "numnet [%i]", num_network); ! message.animate(0); + // NOTE NOTE NOTE + // that log_test depends on num_network, + // also, it depends on random() + log_test("a3"); message.print(1500, 13, "numnet [%i] numhotseat [%i][%i]", num_network, num_hotseats[0], num_hotseats[1]); *************** *** 1057,1060 **** --- 1088,1093 ---- //share_update(); + log_test("a4"); + for ( p = 0; p < num_network; ++p ) *************** *** 1252,1255 **** --- 1285,1302 ---- + void remove_players() + { + int i; + for ( i = 0; i < num_players; ++i ) + { + if (player[i]) + { + delete player[i]; + player[i] = 0; + } + } + } + + void play_game(const char *_gametype_name, Log *_log) { *************** *** 1309,1312 **** --- 1356,1361 ---- new_game->game_done = true; old_game = new_game; + + remove_players(); } |
From: Paul F. <you...@us...> - 2004-03-18 02:00:31
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1846/source/newships Modified Files: shpsefn2.cpp Log Message: some minor fixes Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpsefn2.cpp 14 Mar 2004 23:26:22 -0000 1.4 --- shpsefn2.cpp 18 Mar 2004 01:51:00 -0000 1.5 *************** *** 1128,1132 **** // simulate visibility of a glittering line in the sun ... double a, colscale; ! a = atan2(dy,dx); colscale = fabs(sin(a)); // flat lying = less visible. --- 1128,1132 ---- // simulate visibility of a glittering line in the sun ... double a, colscale; ! a = atan2((float)dy,(float)dx); colscale = fabs(sin(a)); // flat lying = less visible. |
From: Paul F. <you...@us...> - 2004-03-18 02:00:30
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1846/source/melee Modified Files: mgame.cpp Log Message: some minor fixes Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mgame.cpp 17 Mar 2004 22:27:37 -0000 1.37 --- mgame.cpp 18 Mar 2004 01:50:59 -0000 1.38 *************** *** 680,683 **** --- 680,684 ---- unsigned char local_checksum = checksum() & 255; unsigned char client_checksum[max_network]; + memset(client_checksum, 0, sizeof(char)* max_network); unsigned char server_checksum = local_checksum; bool desync = false; |
From: Rob <geo...@us...> - 2004-03-17 23:33:32
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8241/melee Modified Files: mlog.cpp mmain.cpp mmain.h mnet1.cpp Log Message: no message Index: mlog.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mlog.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mlog.cpp 17 Mar 2004 22:27:37 -0000 1.14 --- mlog.cpp 17 Mar 2004 23:24:00 -0000 1.15 *************** *** 147,150 **** --- 147,190 ---- } + + + void Log::deinit() + { + STACKTRACE; + + if (log_data) + { + for (int i = 0; i < log_num; i += 1) + free(log_data[i]); + } + + if (log_len) free(log_len); + log_len = 0; + + if (log_size) free(log_size); + log_size = 0; + + if (log_pos) free(log_pos); + log_pos = 0; + + if (log_data) free(log_data); + log_data = 0; + + if (log_dir) free(log_dir); + log_dir = 0; + + log_num = 0; + + return; + } + + + Log::~Log() + { + STACKTRACE; + + deinit(); + } + void Log::set_r(int ch) { *************** *** 187,201 **** } - Log::~Log() {STACKTRACE - if (log_data) for (int i = 0; i < log_num; i += 1) { - free(log_data[i]); - } - free(log_len); - free(log_size); - free(log_pos); - free(log_data); - free(log_dir); - log_num = 0; - } void Log::log ( int channel, void *data, int size) --- 227,230 ---- *************** *** 319,337 **** - void Log::deinit() - { - STACKTRACE; - - // set all channelinfo to 0 - - int i; - for ( i = 0; i < log_num; ++i ) - { - log_len[i] = 0; - log_pos[i] = 0; - } - - return; - } bool Log::buffer ( int channel, void *data, int size ) {STACKTRACE --- 348,351 ---- Index: mmain.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** mmain.cpp 17 Mar 2004 22:27:37 -0000 1.31 --- mmain.cpp 17 Mar 2004 23:24:00 -0000 1.32 *************** *** 183,187 **** // isn't needed yet ?! ! log_test(); int count = 0; --- 183,187 ---- // isn't needed yet ?! ! log_test("mmain(a)"); int count = 0; *************** *** 734,740 **** // humans can choose ships ! // if (p->channel != channel_none) ! // slot[i] = p->control->choose_ship(window, buffy, fleet); ! // else // bots choose "randomly" (but synched randomly so don't use rand() !!). // this is needed, otherwise a bot would need its own channel, while this way, --- 734,740 ---- // humans can choose ships ! if (p->channel != channel_none) ! slot[i] = p->control->choose_ship(window, buffy, fleet); ! else // bots choose "randomly" (but synched randomly so don't use rand() !!). // this is needed, otherwise a bot would need its own channel, while this way, *************** *** 1037,1041 **** halts). This buffer should be empty most of the time, except in special situations. */ ! void log_test() { #ifdef _DEBUG --- 1037,1041 ---- halts). This buffer should be empty most of the time, except in special situations. */ ! void log_test(char *comment) { #ifdef _DEBUG *************** *** 1050,1055 **** log_int(k, channel_network[i]); if ( k != m ) ! tw_error("log stack is probably mixed up on computer [%i] channel [%i]", ! i, channel_network[i]); } --- 1050,1055 ---- log_int(k, channel_network[i]); if ( k != m ) ! tw_error("[%s] log stack is probably mixed up on computer [%i] channel [%i]", ! comment, i, channel_network[i]); } Index: mmain.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mmain.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mmain.h 17 Mar 2004 22:27:37 -0000 1.13 --- mmain.h 17 Mar 2004 23:24:00 -0000 1.14 *************** *** 7,11 **** int log_size_pl(int netnum); int log_totalsize(); ! void log_test(); // normal player information. --- 7,11 ---- int log_size_pl(int netnum); int log_totalsize(); ! void log_test(char *comment); // normal player information. Index: mnet1.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mnet1.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mnet1.cpp 17 Mar 2004 22:27:37 -0000 1.12 --- mnet1.cpp 17 Mar 2004 23:24:00 -0000 1.13 *************** *** 150,162 **** // set all channelinfo to 0 ! for ( i = 0; i < log_num; ++i ) ! log_transmitted[i] = 0; for ( i = 0; i < max_connections; ++i ) net[i].deinit(); - //delete buffy; - free(buffy); - } --- 150,163 ---- // set all channelinfo to 0 ! if (log_transmitted) free(log_transmitted); ! log_transmitted = 0; ! ! //delete buffy; ! if (buffy) free(buffy); ! buffy = 0; for ( i = 0; i < max_connections; ++i ) net[i].deinit(); } *************** *** 165,169 **** STACKTRACE; ! free (log_transmitted); } --- 166,170 ---- STACKTRACE; ! deinit();//free (log_transmitted); } |
From: Rob <geo...@us...> - 2004-03-17 23:33:32
|
Update of /cvsroot/timewarp/source/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8241/util Modified Files: net_tcp.cpp Log Message: no message Index: net_tcp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/util/net_tcp.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** net_tcp.cpp 15 Mar 2004 22:20:33 -0000 1.9 --- net_tcp.cpp 17 Mar 2004 23:24:00 -0000 1.10 *************** *** 143,146 **** --- 143,147 ---- free(buffer); + buffer = 0; return; |