From: <cel...@us...> - 2013-03-03 22:05:33
|
Revision: 13554 http://vegastrike.svn.sourceforge.net/vegastrike/?rev=13554&view=rev Author: cellsafemode Date: 2013-03-03 22:05:25 +0000 (Sun, 03 Mar 2013) Log Message: ----------- more warning cleanups, almost done Modified Paths: -------------- branches/py3/vegastrike/src/XMLDocument.cpp branches/py3/vegastrike/src/cmd/beam_generic.cpp branches/py3/vegastrike/src/cmd/script/director_server.cpp branches/py3/vegastrike/src/cmd/script/mission.cpp branches/py3/vegastrike/src/cmd/script/mission.h branches/py3/vegastrike/src/cmd/script/script_statement.cpp branches/py3/vegastrike/src/cmd/script/script_variables.cpp branches/py3/vegastrike/src/cmd/unit_csv.cpp branches/py3/vegastrike/src/cmd/unit_generic.cpp branches/py3/vegastrike/src/cmd/unit_xml.cpp branches/py3/vegastrike/src/faction_util_generic.cpp branches/py3/vegastrike/src/gamemenu.cpp branches/py3/vegastrike/src/gfx/cockpit_generic.cpp branches/py3/vegastrike/src/gfx/mesh.cpp branches/py3/vegastrike/src/gfx/mesh_bxm.cpp branches/py3/vegastrike/src/gfxlib_struct.cpp branches/py3/vegastrike/src/gui/glut_support.cpp branches/py3/vegastrike/src/gui/text_area.cpp branches/py3/vegastrike/src/networking/netserver.cpp branches/py3/vegastrike/src/networking/netserver_login.cpp branches/py3/vegastrike/src/networking/netserver_net.cpp branches/py3/vegastrike/src/networking/zonemgr.cpp branches/py3/vegastrike/src/pk3.cpp branches/py3/vegastrike/src/star_system_generic.cpp Modified: branches/py3/vegastrike/src/XMLDocument.cpp =================================================================== --- branches/py3/vegastrike/src/XMLDocument.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/XMLDocument.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -392,19 +392,6 @@ * * ******************************************************************/ -static void Doctype( void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset ) -{ - XMLParserContext *internals = (XMLParserContext*) userData; - assert( internals ); - assert( internals->document ); - internals->document->docType = doctypeName; - internals->document->sysId = sysid; - internals->document->pubId = pubid; -} /* atts is array of name/value pairs, terminated by 0; * names and values are 0 terminated. */ Modified: branches/py3/vegastrike/src/cmd/beam_generic.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/beam_generic.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/beam_generic.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -397,16 +397,6 @@ static float scoopcosangle = (float) cos( scoopangle ); static float maxrelspeed = XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.max_relative_speed", "150" ) ); - static float c_lighting = - XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.cargo.light_shields_on_push", "1" ) ); - static float u_lighting = - XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.upgrade.light_shields_on_push", "1" ) ); - static float f_lighting = - XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.faction.light_shields_on_push", "1" ) ); - static float d_lighting = - XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.disabled.light_shields_on_push", "0" ) ); - static float o_lighting = - XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.others.light_shields_on_push", "1" ) ); static float c_ors_m = XMLSupport::parse_float( vs_config->getVariable( "physics", "tractor.cargo.distance_own_rsize", "1.5" ) ); static float c_trs_m = Modified: branches/py3/vegastrike/src/cmd/script/director_server.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/script/director_server.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/script/director_server.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -77,7 +77,6 @@ void Mission::DirectorLoop() { - double oldgametime = gametime; gametime += SIMULATION_ATOM; //elapsed; try { Modified: branches/py3/vegastrike/src/cmd/script/mission.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/script/mission.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/script/mission.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -392,7 +392,6 @@ int nr_ships_i = atoi( nr_ships.c_str() ); bool have_pos = false; - bool have_rot = false; double pos[3]; float rot[3]; @@ -404,8 +403,8 @@ for (siter = node->subnodes.begin(); siter != node->subnodes.end(); siter++) { if ( (*siter)->Name() == "pos" ) have_pos = doPosition( *siter, pos, &cf ); - else if ( (*siter)->Name() == "rot" ) - have_rot = doRotation( *siter, rot, &cf ); +// else if ( (*siter)->Name() == "rot" ) +// doRotation( *siter, rot, &cf ); This function isn't implemented yet else if ( (*siter)->Name() == "order" ) doOrder( *siter, cf.fg ); } @@ -476,12 +475,12 @@ /* *********************************************************** */ -bool Mission::doRotation( easyDomNode *node, float rot[3], class CreateFlightgroup* ) +/* void Mission::doRotation( easyDomNode *node, float rot[3], class CreateFlightgroup* ) { //not yet - return true; + //return true; } - +*/ /* *********************************************************** */ void Mission::doOrder( easyDomNode *node, Flightgroup *fg ) Modified: branches/py3/vegastrike/src/cmd/script/mission.h =================================================================== --- branches/py3/vegastrike/src/cmd/script/mission.h 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/script/mission.h 2013-03-03 22:05:25 UTC (rev 13554) @@ -607,7 +607,7 @@ void doOrder( easyDomNode *node, Flightgroup *fg ); void checkFlightgroup( easyDomNode *node ); bool doPosition( easyDomNode*node, double pos[3], class CreateFlightgroup* ); - bool doRotation( easyDomNode*node, float rot[3], class CreateFlightgroup* ); +// bool doRotation( easyDomNode*node, float rot[3], class CreateFlightgroup* ); void doOrigin( easyDomNode *node ); void doSettings( easyDomNode *node ); Modified: branches/py3/vegastrike/src/cmd/script/script_statement.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/script/script_statement.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/script/script_statement.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -122,9 +122,6 @@ node->script.while_arg[0] = (missionNode*) node->subnodes[0]; node->script.while_arg[1] = (missionNode*) node->subnodes[1]; - bool res = checkBoolExpr( node->script.while_arg[0], mode ); //FIXME unused variable 'res' --chuck_starchaser - - checkStatement( node->script.while_arg[1], mode ); } else { //runtime while ( checkBoolExpr( node->script.while_arg[0], mode ) ) Modified: branches/py3/vegastrike/src/cmd/script/script_variables.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/script/script_variables.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/script/script_variables.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -457,17 +457,7 @@ } vi = global_var->script.varinst; } - if (vi->type == VAR_BOOL) { //FIXME I can't imagine the purpose of these these... --chuck_starchaser - bool res = checkBoolExpr( expr, mode ); //FIXME ???! - } else if (vi->type == VAR_FLOAT) { - double res = checkFloatExpr( expr, mode ); //FIXME ???! - } else if (vi->type == VAR_INT) { - float res = checkIntExpr( expr, mode ); //FIXME ???! - } else if (vi->type == VAR_OBJECT) { - debug( 3, node, mode, "setvar object" ); - varInst *ovi = checkObjectExpr( expr, mode ); - deleteVarInst( ovi ); - } else { + if(vi->type != VAR_BOOL || vi->type != VAR_FLOAT || vi->type != VAR_INT || vi->type != VAR_OBJECT){ fatalError( node, mode, "unsupported type in setvar" ); assert( 0 ); } Modified: branches/py3/vegastrike/src/cmd/unit_csv.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/unit_csv.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/unit_csv.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -770,7 +770,7 @@ DEF_OPTIMIZER( Armor_Front_Bottom_Right ); DEF_OPTIMIZER( Armor_Back_Bottom_Left ); DEF_OPTIMIZER( Armor_Back_Bottom_Right ); - DEF_OPTIMIZER( Description ); + DEF_OPTIMIZER( Description ); // What was this supposed to describe? DEF_OPTIMIZER( Shield_Front_Top_Left ); DEF_OPTIMIZER( Shield_Front_Top_Right ); DEF_OPTIMIZER( Shield_Back_Top_Left ); Modified: branches/py3/vegastrike/src/cmd/unit_generic.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/unit_generic.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/unit_generic.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -9178,12 +9178,6 @@ void MeshAnimation::StartAnimation( unsigned int how_many_times, int numAnimation ) { - bool infiniteLoop; - if(!how_many_times) - infiniteLoop = true; - else - infiniteLoop = false; - if(animationRuns()) StopAnimation(); Modified: branches/py3/vegastrike/src/cmd/unit_xml.cpp =================================================================== --- branches/py3/vegastrike/src/cmd/unit_xml.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/cmd/unit_xml.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -1089,8 +1089,6 @@ break; case NETCOM: { - float minfreq = 0, maxfreq = 0; - bool video = false, secured = false; string method; assert( xml->unitlevel == 1 ); xml->unitlevel++; @@ -1098,16 +1096,12 @@ switch ( attribute_map.lookup( (*iter).name ) ) { case NETCOMM_MINFREQ: - minfreq = parse_float( (*iter).value ); break; case NETCOMM_MAXFREQ: - maxfreq = parse_float( (*iter).value ); break; case NETCOMM_SECURED: - secured = parse_bool( (*iter).value ); break; case NETCOMM_VIDEO: - video = parse_bool( (*iter).value ); break; case NETCOMM_CRYPTO: method = (*iter).value; @@ -2037,12 +2031,10 @@ } } } else { - Mesh *tmp = NULL; static int shieldstacks = XMLSupport::parse_int( vs_config->getVariable( "graphics", "shield_detail", "16" ) ); static std::string shieldtex = vs_config->getVariable( "graphics", "shield_texture", "shield.bmp" ); static std::string shieldtechnique = vs_config->getVariable( "graphics", "shield_technique", "" ); meshdata.back() = new SphereMesh( rSize(), shieldstacks, shieldstacks, shieldtex.c_str(), shieldtechnique, NULL, false, ONE, ONE ); - tmp = meshdata.back(); } meshdata.back()->EnableSpecialFX(); if (!this->colTrees) { Modified: branches/py3/vegastrike/src/faction_util_generic.cpp =================================================================== --- branches/py3/vegastrike/src/faction_util_generic.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/faction_util_generic.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -156,7 +156,6 @@ { for (unsigned int i = 0; i < factions.size(); i++) { char *tmp = new char[24*factions[i]->faction.size()]; - static char *bogus_return; //added by chuck_starchaser to squash a warning fgets( tmp, 24*factions[i]->faction.size()-1, fp ); char *tmp2 = tmp; if (numnums( tmp ) == 0) { Modified: branches/py3/vegastrike/src/gamemenu.cpp =================================================================== --- branches/py3/vegastrike/src/gamemenu.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gamemenu.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -677,7 +677,6 @@ restore_main_loop(); NetClient *playerClient = &Network[player]; - Window *parentWin = m_parent; globalWindowManager().shutDown(); TerminateCurrentBase(); Modified: branches/py3/vegastrike/src/gfx/cockpit_generic.cpp =================================================================== --- branches/py3/vegastrike/src/gfx/cockpit_generic.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gfx/cockpit_generic.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -328,13 +328,10 @@ void SwitchUnits( Unit *ol, Unit *nw ) { bool pointingtool = false; - bool pointingtonw = false; for (unsigned int i = 0; i < _Universe->numPlayers(); ++i) if ( i != _Universe->CurrentCockpit() ) { if (_Universe->AccessCockpit( i )->GetParent() == ol) pointingtool = true; - if (_Universe->AccessCockpit( i )->GetParent() == nw) - pointingtonw = true; } if ( ol && (!pointingtool) ) { Unit *oltarg = ol->Target(); Modified: branches/py3/vegastrike/src/gfx/mesh.cpp =================================================================== --- branches/py3/vegastrike/src/gfx/mesh.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gfx/mesh.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -83,10 +83,8 @@ mn = Vector( 0, 0, 0 ); mx = Vector( 0, 0, 0 ); radialSize = 0; - GFXVertex *alphalist; if ( Decal.empty() ) Decal.push_back( NULL ); - alphalist = NULL; //texturename[0] = -1; numforcelogo = numsquadlogo = 0; Modified: branches/py3/vegastrike/src/gfx/mesh_bxm.cpp =================================================================== --- branches/py3/vegastrike/src/gfx/mesh_bxm.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gfx/mesh_bxm.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -332,7 +332,7 @@ xml.faction = fac; if (recordindex > 0 || meshindex > 0) { char filenamebuf[56]; //Is more than enough characters - int can't be this big in decimal - int32bit error = sprintf( filenamebuf, "%d_%d.xmesh", recordindex, meshindex ); + int error = sprintf( filenamebuf, "%d_%d.xmesh", recordindex, meshindex ); if (error == -1) //if wasn't enough characters - something is horribly wrong. exit( error ); string filename = string( filenamebuf ); @@ -608,7 +608,7 @@ word32index += 1; #ifndef STANDALONE if (meshindex == 0) - for (int framecount = numLODs+1; framecount < nummeshes; framecount++) + for (int32bit framecount = numLODs+1; framecount < nummeshes; framecount++) bxmfprintf( Outputfile, "<Frame FrameMeshName=\"%d_%d.xmesh\"/>\n", recordindex, framecount ); #endif for (int32bit anim = 0; anim < numanimdefs; anim++) { Modified: branches/py3/vegastrike/src/gfxlib_struct.cpp =================================================================== --- branches/py3/vegastrike/src/gfxlib_struct.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gfxlib_struct.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -131,17 +131,16 @@ return; //don't used lists if they're mutable if (display_list) GFXDeleteList( display_list ); - int a; int offset = 0; display_list = GFXCreateList(); - if (changed&HAS_COLOR) { + if (changed & HAS_COLOR) { EnableArrays(data.colors); } else { EnableArrays(data.vertices); } for (int i = 0; i < numlists; i++) { // Populate the display list with array data - if (changed&HAS_INDEX) { + if (changed & HAS_INDEX) { switch (changed & (INDEX_BYTE|INDEX_INT|INDEX_SHORT)) { case INDEX_BYTE: glDrawElements( PolyLookup(mode[i]), offsets[i], GL_UNSIGNED_BYTE, index.b ); @@ -374,8 +373,8 @@ } else { for (int i = 0; i < numlists; i++) { glDrawElements( PolyLookup( mode[i] ), offsets[i], indextype, - use_vbo ? (void*) (stride*totoffset) - : &index.b[stride*totoffset] ); //changed&INDEX_BYTE == stride! + use_vbo ? (GLvoid*) (stride*totoffset) + : (GLvoid*)&index.b[stride*totoffset] ); //changed&INDEX_BYTE == stride! totoffset += offsets[i]; ++gl_batches_this_frame; gl_vertices_this_frame += offsets[i]; Modified: branches/py3/vegastrike/src/gui/glut_support.cpp =================================================================== --- branches/py3/vegastrike/src/gui/glut_support.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gui/glut_support.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -193,6 +193,7 @@ switch(pointerStyle) { case MOUSE_POINTER_NORMAL: whichSprite = &MouseVSSprite; break; case MOUSE_POINTER_HOVER: whichSprite = &MouseOverVSSprite; break; + case MOUSE_POINTER_NONE: return; } DrawGlutMouse( mmx, mmy, whichSprite ); Modified: branches/py3/vegastrike/src/gui/text_area.cpp =================================================================== --- branches/py3/vegastrike/src/gui/text_area.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/gui/text_area.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -145,87 +145,14 @@ void TextArea::Refresh( void ) { - float x = xcoord[0], y = ycoord[0], wid = width[0], hei = height[0]; - //Local x,y,wid,hei for images to render - float lx = 0; - float ly = 0; - float lwid = 0; - float lhei = 0; + // Obscene amounts of commented code removed, check r13553 for content - //Ratio border and scrollbar - //float ratio[] = { 0.06, 0.12 }; - - lwid = ratio[0]*wid; - lhei = ratio[1]*wid; //Draw the bars to run across the length -/* - * // Top Horizontal - * lx = x; - * ly = y; - * ShowImage(lx, ly, wid, lwid, Images[IMG_TOP], 1, 0); - * - * // Left Horizontal - * ShowImage(lx, ly, lwid, hei, Images[IMG_LEFT_SIDE], 0, 1); - * - * // Bottom Horizontal - * ly = y - hei + lwid; - * ShowImage(lx, ly, wid, lwid, Images[IMG_BOTTOM], 1, 0); - * - * // Right Horizontal - * ly = y; - * lx = x + wid - lhei; - * if (has_scrollbar != 0) { ShowImage(lx, ly, lhei, hei, Images[IMG_RIGHT_SIDE], 0, 1); } - * - * - * // Draw the corners - * - * // Top right corner - * if (has_scrollbar != 0) { ShowImage(lx, ly, lhei, lhei, Images[IMG_CORNER_TOP_RIGHT], 0, 0); } - * else { ShowImage(lx, ly, lhei, lhei, Images[IMG_END], 0, 0); } - * - * // Bottom right corner - * ly = y - hei + lhei; - * if (has_scrollbar != 0) { ShowImage(lx, ly, lhei, lhei, Images[IMG_CORNER_BOTTOM_RIGHT], 0, 0); } - * else { ShowImage(lx, ly, lhei, lhei, Images[IMG_END], 0, 0); } - * - * // Bottom left corner - * lx = x; - * ly = y - hei + lwid; - * ShowImage(lx, ly, lwid, lwid, Images[IMG_CORNER_BOTTOM_LEFT], 0, 0); - * - * // Top left corner - * ly = y; - * ShowImage(lx, ly, lwid, lwid, Images[IMG_CORNER_TOP_LEFT], 0, 0); - * - * if (button_pressed == 1) { - * ShowImage(xcoord[1], ycoord[1], width[1], height[1], Images[IMG_HIGHLIGHT_BUTTON_UP], 0, 0); - * } - * if (button_pressed == 2) { - * ShowImage(xcoord[2], ycoord[2], width[2], height[2], Images[IMG_HIGHLIGHT_BUTTON_DOWN], 0, 0); - * } - */ + if (has_scrollbar != 0) DisplayScrollbar(); RenderText(); -//if (cur_highlighted > 0 && cur_highlighted != (cur_selected - top_item_number)) { HighlightCount(cur_highlighted, 1); } - if (cur_highlighted > 0) HighlightCount( cur_highlighted, 1 ); //if (cur_selected > 0) { HighlightCount(cur_selected - top_item_number, 2); } + if (cur_highlighted > 0) HighlightCount( cur_highlighted, 1 ); if (cur_selected > 0) HighlightCount( cur_selected, 2 ); - //Displays a transparent red box in the area where text can be displayed - //ShowColor(xcoord[5], ycoord[5], width[5], height[5], 1, 0, 0, 0.5); - - //Displays a transparent green box in the area where the buttons should be - //ShowColor(xcoord[1], ycoord[1], width[1], height[1], 0, 1, 0, 0.5); - //ShowColor(xcoord[2], ycoord[2], width[2], height[2], 0, 1, 0, 0.5); - - //Displays a transparent yellow box in the area where the scrollbar should be - //ShowColor(xcoord[3], ycoord[3], width[3], height[3], 1, 1, 0, 0.5); - - //ShowColor(xcoord[3], ycoord[3], width[3], height[3], 0.51, 0.47, 0.79, 1); - //ShowColor(xcoord[3], ycoord[3], width[3], height[3]/2, 0.66, 0.6, 1, 1); - //ShowColor(xcoord[3], ycoord[3], width[3], height[3]/2, 0, 1,1, 0.05); - - //ShowColor(xcoord[3], ycoord[3], width[3], height[3]/2, 1, 0, 0, 0.05); - - //ShowImage(xcoord[3], ycoord[3], width[3], height[3], Images[IMG_SCROLLBAR], 0, 1); } void TextArea::RenderText( void ) Modified: branches/py3/vegastrike/src/networking/netserver.cpp =================================================================== --- branches/py3/vegastrike/src/networking/netserver.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/networking/netserver.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -691,7 +691,6 @@ this->sendLoginUnavailable( clt ); } else { SOCKETALT tmpsock; - const AddressIP *iptmp; WaitListEntry entry; NetBuffer netbuf( packet.getData(), packet.getDataLength() ); std::string user = netbuf.getString(); @@ -710,7 +709,6 @@ sendLoginAlready( clt ); break; } - iptmp = &clt->cltadr; tmpsock = clt->tcp_sock; //Redirect the login request packet to account server Modified: branches/py3/vegastrike/src/networking/netserver_login.cpp =================================================================== --- branches/py3/vegastrike/src/networking/netserver_login.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/networking/netserver_login.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -47,7 +47,6 @@ string callsign; string unused; NetBuffer netbuf; - ObjSerial cltserial; callsign = getSimpleString( inetbuf ); unused = getSimpleString( inetbuf ); string serverip = getSimpleString( inetbuf ); @@ -400,7 +399,6 @@ un->Kill(); } if (!exist) { - unsigned short serial = cltserial; std::string logoutnetbuf; addSimpleChar( logoutnetbuf, ACCT_LOGOUT ); addSimpleString( logoutnetbuf, clt->callsign ); Modified: branches/py3/vegastrike/src/networking/netserver_net.cpp =================================================================== --- branches/py3/vegastrike/src/networking/netserver_net.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/networking/netserver_net.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -44,21 +44,24 @@ void NetServer::checkTimedoutClients_udp() { /********* Method 1 : compare latest_timestamp to current time and see if > CLIENTTIMEOUT */ - double curtime = getNewTime(); - double deltatmp = 0; + for (LI i = allClients.begin(); i != allClients.end(); i++) { ClientPtr cl = *i; if ( !cl->lossy_socket->isTcp() ) { //NETFIXME: Does this delta and latest_timeout actually only check UDP or does this include TCP? //Time elapsed since latest packet in seconds - deltatmp = ( fabs( curtime-cl->latest_timeout ) ); +#ifdef TIMEOUT_USING_UDP_EVEN_THOUGH_THEY_USE_TCP + double curtime = getNewTime(); + double deltatmp = ( fabs( curtime-cl->latest_timeout ) ); +#endif if (cl->latest_timeout != 0) { - //COUT<<"DELTATMP = "<<deltatmp<<" - clienttimeout = "<<clienttimeout<<endl; - //Here considering a delta > 0xFFFFFFFX where X should be at least something like 0.9 - //This allows a packet not to be considered as "old" if timestamp has been "recycled" on client - //side -> when timestamp has grown enough to became bigger than what an u_int can store + /* COUT<<"DELTATMP = "<<deltatmp<<" - clienttimeout = "<<clienttimeout<<endl; + Here considering a delta > 0xFFFFFFFX where X should be at least something like 0.9 + This allows a packet not to be considered as "old" if timestamp has been "recycled" on client + side -> when timestamp has grown enough to became bigger than what an u_int can store - //if( cl->ingame && deltatmp > clienttimeout && deltatmp < (0xFFFFFFFF*0.9) ) + if( cl->ingame && deltatmp > clienttimeout && deltatmp < (0xFFFFFFFF*0.9) ) + */ #ifdef TIMEOUT_USING_UDP_EVEN_THOUGH_THEY_USE_TCP if (cl->ingame == true && deltatmp > clienttimeout) { Unit *un; Modified: branches/py3/vegastrike/src/networking/zonemgr.cpp =================================================================== --- branches/py3/vegastrike/src/networking/zonemgr.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/networking/zonemgr.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -908,8 +908,7 @@ Cockpit *cp = _Universe->AccessCockpit( i ); if (cp->activeStarSystem != ss) continue; - Unit *un; - char name[15]; + char name[15]; if ( !cp->GetParent() ) { sprintf( name, "*Plr% 3d ", i ); displayUnitInfo( NULL, cp->savegame->GetCallsign(), name ); Modified: branches/py3/vegastrike/src/pk3.cpp =================================================================== --- branches/py3/vegastrike/src/pk3.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/pk3.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -356,7 +356,7 @@ } //if the file isn't in the archive if (index == -1) - return false; + return (NULL); int flength = GetFileLen( index ); buffer = new char[flength]; Modified: branches/py3/vegastrike/src/star_system_generic.cpp =================================================================== --- branches/py3/vegastrike/src/star_system_generic.cpp 2013-03-03 19:09:47 UTC (rev 13553) +++ branches/py3/vegastrike/src/star_system_generic.cpp 2013-03-03 22:05:25 UTC (rev 13554) @@ -257,25 +257,26 @@ collidemap[locind]->erase( un->location[locind] ); set_null( un->location[locind] ); } - bool removed2 = false; Unit *unit; + + // Is it possible for units to be in the system but not on the drawlist? + // Not sure so covering all bases + bool removed2 = false; for (un_iter iter = gravitationalUnits().createIterator(); (unit = *iter); ++iter) if (unit == un) { iter.remove(); removed2 = true; - break; //Shouldn't be in there twice + break; } - //NOTE: not sure why if(1) was here, but safemode removed it bool removed = false; - if (1) { - for (un_iter iter = drawList.createIterator(); (unit = *iter); ++iter) - if (unit == un) { - iter.remove(); - removed = true; - break; - } - } - if (removed) { + for (un_iter iter = drawList.createIterator(); (unit = *iter); ++iter) + if (unit == un) { + iter.remove(); + removed = true; + break; + } + if (removed || removed2) { + // regardless of being drawn, it should be in physics list for (unsigned int i = 0; i <= SIM_QUEUE_SIZE; ++i) { Unit *unit; for (un_iter iter = physics_buffer[i].createIterator(); (unit = *iter); ++iter) @@ -289,7 +290,7 @@ } stats.RemoveUnit( un ); } - return removed; + return (removed|removed2); } void StarSystem::ExecuteUnitAI() @@ -497,7 +498,6 @@ double aitime = 0; double phytime = 0; double collidetime = 0; - double flattentime = 0; double bolttime = 0; targetpick = 0; aggfire = 0; @@ -562,11 +562,9 @@ Bolt::UpdatePhysics( this ); double cc = queryTime(); last_collisions.clear(); - double fl0 = queryTime(); collidemap[Unit::UNIT_BOLT]->flatten(); if (Unit::NUM_COLLIDE_MAPS > 1) collidemap[Unit::UNIT_ONLY]->flatten( *collidemap[Unit::UNIT_BOLT] ); - flattentime = queryTime()-fl0; Unit *unit; for (un_iter iter = physics_buffer[current_sim_location].createIterator(); (unit = *iter);) { int priority = unit->sim_atom_multiplier; @@ -684,7 +682,6 @@ void StarSystem::Update( float priority, bool executeDirector ) { bool firstframe = true; - double pythontime = 0; ///this makes it so systems without players may be simulated less accurately for (unsigned int k = 0; k < _Universe->numPlayers(); ++k) if (_Universe->AccessCockpit( k )->activeStarSystem == this) @@ -705,12 +702,10 @@ TerrainCollide(); UpdateAnimatedTexture(); Unit::ProcessDeleteQueue(); - double pythonidea = queryTime(); if ( (run_only_player_starsystem && _Universe->getActiveStarSystem( 0 ) == this) || !run_only_player_starsystem ) if (executeDirector) ExecuteDirector(); - pythontime = queryTime()-pythonidea; static int dothis = 0; if ( this == _Universe->getActiveStarSystem( 0 ) ) if ( (++dothis)%2 == 0 ) |