gcblue-commits Mailing List for Global Conflict Blue (Page 3)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/include/sim Modified Files: tcAero.h tcMissileObject.h Log Message: Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcMissileObject.h 18 Jun 2006 00:47:51 -0000 1.22 --- tcMissileObject.h 6 Dec 2006 01:20:42 -0000 1.23 *************** *** 46,50 **** float mfGoalHeading_rad; float mfGoalPitch_rad; - float mfGoalSpeed_kts; double mfInterceptTime; bool subSurfaceLaunch; ///< true during subsurface launch phase for sub-launched missiles --- 46,49 ---- *************** *** 73,77 **** teGuidanceMode GetCurrentGuidanceMode(); float GetDistanceFromLaunch() const; ! virtual void SetSpeed(float afNewSpeed) {mfGoalSpeed_kts=afNewSpeed;} virtual tcRadar* GetSeekerRadar() const; virtual tcSensorState* GetSeekerSensor() const; --- 72,76 ---- teGuidanceMode GetCurrentGuidanceMode(); float GetDistanceFromLaunch() const; ! virtual tcRadar* GetSeekerRadar() const; virtual tcSensorState* GetSeekerSensor() const; Index: tcAero.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAero.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcAero.h 22 Mar 2006 01:23:29 -0000 1.8 --- tcAero.h 6 Dec 2006 01:20:42 -0000 1.9 *************** *** 46,50 **** float mfHeading_rad; float mfAltitude_m; - float mfHeadingControl; ///< [-1,1] heading rate control input tcStream& operator<<(tcStream& stream); --- 46,49 ---- |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/src/network Modified Files: tcMultiplayerInterface.cpp tcUpdateMessageHandler.cpp Log Message: Index: tcUpdateMessageHandler.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcUpdateMessageHandler.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcUpdateMessageHandler.cpp 27 Nov 2006 00:46:39 -0000 1.20 --- tcUpdateMessageHandler.cpp 6 Dec 2006 01:20:43 -0000 1.21 *************** *** 236,239 **** --- 236,240 ---- temp.SetMaxSize(size_t(freeSpace)); temp.SetDoneFlag(true); + temp.SetDetailLevel(stream.GetDetailLevel()); *obj >> temp; Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tcMultiplayerInterface.cpp 30 Nov 2006 04:11:13 -0000 1.39 --- tcMultiplayerInterface.cpp 6 Dec 2006 01:20:42 -0000 1.40 *************** *** 61,65 **** void tcPlayerStatus::EraseEntry(long id) { ! std::map<long, unsigned int>::iterator iter; if (id == -1) return; --- 61,65 ---- void tcPlayerStatus::EraseEntry(long id) { ! std::map<long, UpdateInfo>::iterator iter; if (id == -1) return; *************** *** 88,94 **** * @return true if id exists in update map, false otherwise */ ! bool tcPlayerStatus::GetLastUpdate(long id, unsigned int& updateTime) { ! std::map<long, unsigned int>::iterator mapIter; if (id == -1) return false; --- 88,94 ---- * @return true if id exists in update map, false otherwise */ ! bool tcPlayerStatus::GetLastUpdate(long id, unsigned int& updateTime, unsigned int& detailedUpdateTime) { ! std::map<long, UpdateInfo>::iterator mapIter; if (id == -1) return false; *************** *** 100,104 **** } ! updateTime = mapIter->second; return true; --- 100,105 ---- } ! updateTime = mapIter->second.updateTime; ! detailedUpdateTime = mapIter->second.detailedUpdateTime; return true; *************** *** 164,168 **** if (id == -1) return; // return and do nothing if null idx passed ! lastUpdate[id] = updateTime; } --- 165,180 ---- if (id == -1) return; // return and do nothing if null idx passed ! lastUpdate[id].updateTime = updateTime; ! } ! ! /** ! * Updates lastUpdate detailed update time. ! * A new map entry is created if this is the first update. ! */ ! void tcPlayerStatus::SetDetailedUpdate(long id, unsigned int detailedUpdateTime) ! { ! if (id == -1) return; // return and do nothing if null idx passed ! ! lastUpdate[id].detailedUpdateTime = detailedUpdateTime; } *************** *** 412,416 **** if (iter == playerToConnection.end()) { ! fprintf(stderr, "tcMultiplayerInterface::LogOutPlayer - not found in playerToConnection map\n"); return; } --- 424,429 ---- if (iter == playerToConnection.end()) { ! fprintf(stderr, "tcMultiplayerInterface::LogOutPlayer - %s not found in playerToConnection map\n", ! username.c_str()); return; } *************** *** 850,853 **** --- 863,867 ---- SendChatText(connectionId, " /gm create '<class>' '<unitname>' <alliance> <lat_deg> <lon_deg> (<alt_m>)"); SendChatText(connectionId, " /gm destroy <id>"); + SendChatText(connectionId, " /gm kick '<playername>'"); SendChatText(connectionId, " /gm move <id> <lat_deg> <lon_deg> (<alt_m>)"); // SendChatText(connectionId, " /gm reload <id>"); *************** *** 878,881 **** --- 892,901 ---- } } + else if (command == "kick") + { + syntaxError = false; + + ProcessGMKick(args, msg); + } else if (command == "move") { *************** *** 1040,1043 **** --- 1060,1087 ---- /** + * Kick player from game + * /gm kick '<playername>' + * @param args argument string + * @param msg message text to be returned + */ + void tcMultiplayerInterface::ProcessGMKick(const wxString& args, wxString& msg) + { + const char delim = '\''; + wxString s1 = args.AfterFirst(delim); + std::string playername = s1.BeforeFirst(delim).c_str(); + + int playerId = GetPlayerConnectionId(playername); + if (playerId == -1) return; + + SendChatText(playerId, "You have been kicked from the game"); + + LogOutPlayer(playername); + + playerInfo.erase(playerId); + networkInterface->RemoveConnection(playerId); + } + + + /** * Moves a game entity * move <id> <lat_deg> <lon_deg> (<alt>) *************** *** 1656,1660 **** unsigned destroyCount = 0; ! for (std::map<long, unsigned int>::iterator iter = pstatus.lastUpdate.begin(); iter != pstatus.lastUpdate.end(); ) { --- 1700,1704 ---- unsigned destroyCount = 0; ! for (std::map<long, tcPlayerStatus::UpdateInfo>::iterator iter = pstatus.lastUpdate.begin(); iter != pstatus.lastUpdate.end(); ) { *************** *** 1804,1811 **** } ! unsigned int tcMultiplayerInterface::GetUpdatePeriod(const tcGameObject* obj, const std::string& playerName) const { bool playerControlled = obj->IsControlledBy(playerName); const tcFlightOpsObject* flightOps = dynamic_cast<const tcFlightOpsObject*>(obj); bool largeFlightOps = (flightOps == 0) ? false : (flightOps->CurrentAirComplementSize() > 8); --- 1848,1858 ---- } ! void tcMultiplayerInterface::GetUpdatePeriod(const tcGameObject* obj, const std::string& playerName, ! unsigned int& updatePeriod, unsigned int& detailedUpdatePeriod) const { bool playerControlled = obj->IsControlledBy(playerName); + detailedUpdatePeriod = playerControlled ? 300 : 900; + const tcFlightOpsObject* flightOps = dynamic_cast<const tcFlightOpsObject*>(obj); bool largeFlightOps = (flightOps == 0) ? false : (flightOps->CurrentAirComplementSize() > 8); *************** *** 1815,1823 **** if (!largeFlightOps) { ! return 90; } else { ! return 90; } } --- 1862,1870 ---- if (!largeFlightOps) { ! updatePeriod = 90; } else { ! updatePeriod = 90; } } *************** *** 1826,1834 **** if (!largeFlightOps) { ! return 25; } else { ! return 60; } } --- 1873,1881 ---- if (!largeFlightOps) { ! updatePeriod = 25; } else { ! updatePeriod = 60; } } *************** *** 1866,1880 **** if (pstatus.alliance == obj->GetAlliance()) { ! unsigned int lastUpdate; ! if (pstatus.GetLastUpdate(obj->mnID, lastUpdate)) { unsigned int dt = t - lastUpdate; ! bool doUpdate = (dt >= GetUpdatePeriod(obj, playerName)); if (doUpdate) { ! bool updateAdded = tcUpdateMessageHandler::AddUpdate(obj, updateStream); if (updateAdded) { --- 1913,1940 ---- if (pstatus.alliance == obj->GetAlliance()) { ! unsigned int lastUpdate, lastDetailedUpdate; ! if (pstatus.GetLastUpdate(obj->mnID, lastUpdate, lastDetailedUpdate)) { unsigned int dt = t - lastUpdate; + unsigned int updatePeriod, detailedUpdatePeriod; + GetUpdatePeriod(obj, playerName, updatePeriod, detailedUpdatePeriod); ! bool doUpdate = (dt >= updatePeriod); if (doUpdate) { ! unsigned int dt_detailed = t - lastDetailedUpdate; ! bool detailUpdate = (dt_detailed >= detailedUpdatePeriod); ! if (!detailUpdate) ! { ! updateStream.SetDetailLevel(0); ! } ! else ! { ! updateStream.SetDetailLevel(1); ! } + bool updateAdded = tcUpdateMessageHandler::AddUpdate(obj, updateStream); + if (updateAdded) { *************** *** 1913,1917 **** } ! pstatus.SetUpdate(obj->mnID, t); } --- 1973,1978 ---- } ! pstatus.SetUpdate(obj->mnID, t); ! if (detailUpdate) pstatus.SetDetailedUpdate(obj->mnID, t); } *************** *** 1972,1977 **** // set time to force update at next opportunity ! pstatus.SetUpdate(obj->mnID, (unsigned int)(t-90)); ! #ifdef _DEBUG fprintf(stdout, "C%d ", obj->mnID); --- 2033,2038 ---- // set time to force update at next opportunity ! pstatus.SetUpdate(obj->mnID, (unsigned int)(t-200)); ! pstatus.SetDetailedUpdate(obj->mnID, (unsigned int)(t-200)); #ifdef _DEBUG fprintf(stdout, "C%d ", obj->mnID); |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/include/database Modified Files: tcSonobuoyDBObject.h Log Message: Index: tcSonobuoyDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSonobuoyDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSonobuoyDBObject.h 20 Nov 2006 00:16:27 -0000 1.4 --- tcSonobuoyDBObject.h 6 Dec 2006 01:20:41 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- #include "tcDatabaseObject.h" #include "tcSensorPlatformDBObject.h" + #include "tcWaterDetectionDBObject.h" class TiXmlElement; *************** *** 36,40 **** class tcSqlReader; ! class tcSonobuoyDBObject : public tcDatabaseObject, public tcSensorPlatformDBObject { public: --- 37,41 ---- class tcSqlReader; ! class tcSonobuoyDBObject : public tcDatabaseObject, public tcSensorPlatformDBObject, public tcWaterDetectionDBObject { public: |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/include/graphics Modified Files: tcContainerGui.h tcFlightportGui.h tcPlatformGui.h tcStoresGui.h Log Message: Index: tcStoresGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcStoresGui.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcStoresGui.h 20 Nov 2006 00:16:28 -0000 1.4 --- tcStoresGui.h 6 Dec 2006 01:20:42 -0000 1.5 *************** *** 41,46 **** --- 41,51 ---- { public: + static tcStoresGui* GetExistingGui(long id, long host); + virtual void Draw(); + long GetPlatformId() const; + long GetHostId() const; + //virtual void OnChar(wxKeyEvent& event); //virtual void OnEnterWindow(wxMouseEvent& event); Index: tcFlightportGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcFlightportGui.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcFlightportGui.h 20 Nov 2006 00:16:28 -0000 1.6 --- tcFlightportGui.h 6 Dec 2006 01:20:41 -0000 1.7 *************** *** 63,66 **** --- 63,70 ---- { public: + static tcFlightPortGui* GetExistingGui(long id); + + long GetPlatformId() const; + virtual void Draw(); Index: tcPlatformGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPlatformGui.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcPlatformGui.h 6 Sep 2006 01:28:20 -0000 1.6 --- tcPlatformGui.h 6 Dec 2006 01:20:41 -0000 1.7 *************** *** 58,63 **** --- 58,68 ---- { public: + static tcPlatformGui* GetExistingGui(long id, long host); + virtual void Draw(); + long GetPlatformId() const; + long GetHostId() const; + //virtual void OnChar(wxKeyEvent& event); //virtual void OnEnterWindow(wxMouseEvent& event); Index: tcContainerGui.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcContainerGui.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcContainerGui.h 20 Nov 2006 00:16:28 -0000 1.6 --- tcContainerGui.h 6 Dec 2006 01:20:41 -0000 1.7 *************** *** 118,126 **** void UpdateWindowDrag(const wxPoint& pos); private: bool destroy; ///< workaround to delay destruction of window to safe time tcContainerItem* parentItem; ///< item that was clicked to popup this gui (if applicable) static tc3DWindow* parent; ! static std::list<tcContainerGui*> openContainers; ///< to allow closing all open GUIs void RegisterGui(); --- 118,128 ---- void UpdateWindowDrag(const wxPoint& pos); + static std::list<tcContainerGui*> openContainers; ///< to allow closing all open GUIs + private: bool destroy; ///< workaround to delay destruction of window to safe time tcContainerItem* parentItem; ///< item that was clicked to popup this gui (if applicable) static tc3DWindow* parent; ! void RegisterGui(); |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/include/network Modified Files: tcMultiplayerInterface.h Log Message: Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcMultiplayerInterface.h 1 Dec 2006 03:39:53 -0000 1.32 --- tcMultiplayerInterface.h 6 Dec 2006 01:20:42 -0000 1.33 *************** *** 59,62 **** --- 59,68 ---- { public: + struct UpdateInfo + { + unsigned int updateTime; + unsigned int detailedUpdateTime; + }; + std::string name; ///< username of player std::string nameWithRank; ///< name with rank title *************** *** 70,74 **** unsigned int sensorUpdateTime; ///< time of last sensor update (30 Hz tics) float ping_s; ///< value of last ping ! std::map<long, unsigned int> lastUpdate; ///< map of (obj id, update time (30Hz tics)) tcAccountDatabase::UserData data; ///< local copy of account database entry (messy, merge or otherwise fix this) int connectionId; --- 76,80 ---- unsigned int sensorUpdateTime; ///< time of last sensor update (30 Hz tics) float ping_s; ///< value of last ping ! std::map<long, UpdateInfo> lastUpdate; ///< map of (obj id, update time (30Hz tics)) tcAccountDatabase::UserData data; ///< local copy of account database entry (messy, merge or otherwise fix this) int connectionId; *************** *** 77,81 **** unsigned char GetAlliance() const; int GetConnectionId() const; ! bool GetLastUpdate(long id, unsigned int& updateTime); const std::string& GetName() const; const std::string& GetNameWithRank() const; --- 83,87 ---- unsigned char GetAlliance() const; int GetConnectionId() const; ! bool GetLastUpdate(long id, unsigned int& updateTime, unsigned int& detailedUpdateTime); const std::string& GetName() const; const std::string& GetNameWithRank() const; *************** *** 89,92 **** --- 95,99 ---- void SetRank(unsigned char val); void SetUpdate(long id, unsigned int updateTime); + void SetDetailedUpdate(long id, unsigned int detailedUpdateTime); }; *************** *** 197,201 **** void ClearMessageMap(); void DistributeChatText(); ! unsigned int GetUpdatePeriod(const tcGameObject* obj, const std::string& playerName) const; bool IsNewPlayer(int id); --- 204,209 ---- void ClearMessageMap(); void DistributeChatText(); ! void GetUpdatePeriod(const tcGameObject* obj, const std::string& playerName, ! unsigned int& updatePeriod, unsigned int& detailedUpdatePeriod) const; bool IsNewPlayer(int id); *************** *** 204,207 **** --- 212,216 ---- void ProcessGMAddAccount(const wxString& args, wxString& msg); void ProcessGMCreate(const wxString& args, wxString& msg); + void ProcessGMKick(const wxString& args, wxString& msg); void ProcessGMMove(const wxString& args, wxString& msg); void ProcessMessage(int messageId, int connectionId, |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/src/graphics Modified Files: tcFlightPortGui.cpp tcMapView.cpp tcNetworkView.cpp tcPlatformGui.cpp tcStoresGui.cpp Log Message: Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcStoresGui.cpp 27 Nov 2006 00:46:39 -0000 1.11 --- tcStoresGui.cpp 6 Dec 2006 01:20:42 -0000 1.12 *************** *** 43,46 **** --- 43,69 ---- + + + tcStoresGui* tcStoresGui::GetExistingGui(long id, long host) + { + std::list<tcContainerGui*>::iterator iter = + openContainers.begin(); + + for (iter=openContainers.begin(); iter!=openContainers.end(); ++iter) + { + if (tcStoresGui* storesGui = dynamic_cast<tcStoresGui*>(*iter)) + { + if ((storesGui->GetPlatformId() == id) && (storesGui->GetHostId() == host)) + { + return storesGui; + } + } + + } + return 0; + } + + + /** * If slot has tcStoresContainerItem then update it, otherwise create *************** *** 195,198 **** --- 218,232 ---- } + long tcStoresGui::GetPlatformId() const + { + return platformId; + } + + long tcStoresGui::GetHostId() const + { + return hostId; + } + + /** * @return pointer to stores object Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcNetworkView.cpp 24 Oct 2006 01:34:04 -0000 1.14 --- tcNetworkView.cpp 6 Dec 2006 01:20:42 -0000 1.15 *************** *** 377,380 **** --- 377,381 ---- passwordEdit->SetClearOnReturn(false); passwordEdit->SetBuffer(""); + tcMultiplayerInterface::Get()->SetPassword(""); if (!tcOptions::Get()->OptionStringExists("HostAddress")) Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcPlatformGui.cpp 20 Nov 2006 00:17:42 -0000 1.14 --- tcPlatformGui.cpp 6 Dec 2006 01:20:42 -0000 1.15 *************** *** 62,65 **** --- 62,85 ---- + + tcPlatformGui* tcPlatformGui::GetExistingGui(long id, long host) + { + std::list<tcContainerGui*>::iterator iter = + openContainers.begin(); + + for (iter=openContainers.begin(); iter!=openContainers.end(); ++iter) + { + if (tcPlatformGui* platformGui = dynamic_cast<tcPlatformGui*>(*iter)) + { + if ((platformGui->GetPlatformId() == id) && (platformGui->GetHostId() == host)) + { + return platformGui; + } + } + + } + return 0; + } + /** * @return first stores that has at least one compatible item with platform launcher (or 0 if none found) *************** *** 97,100 **** --- 117,132 ---- } + + long tcPlatformGui::GetPlatformId() const + { + return platformId; + } + + long tcPlatformGui::GetHostId() const + { + return hostId; + } + + void tcPlatformGui::OnLoadoutCommand(wxCommandEvent& event) { Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcFlightPortGui.cpp 1 Dec 2006 03:39:54 -0000 1.13 --- tcFlightPortGui.cpp 6 Dec 2006 01:20:42 -0000 1.14 *************** *** 99,102 **** --- 99,124 ---- //------------------------------------------------------------------------------ + + tcFlightPortGui* tcFlightPortGui::GetExistingGui(long id) + { + std::list<tcContainerGui*>::iterator iter = + openContainers.begin(); + + for (iter=openContainers.begin(); iter!=openContainers.end(); ++iter) + { + if (tcFlightPortGui* flightPortGui = dynamic_cast<tcFlightPortGui*>(*iter)) + { + if (flightPortGui->GetPlatformId() == id) + { + return flightPortGui; + } + } + + } + return 0; + } + + + /** * If slot has tcEntityContainerItem then update it, otherwise create *************** *** 320,323 **** --- 342,351 ---- } + long tcFlightPortGui::GetPlatformId() const + { + return platformId; + } + + void tcFlightPortGui::HandleDrop(size_t slotIdx, tcContainerItem* item) { Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** tcMapView.cpp 24 Oct 2006 01:34:04 -0000 1.51 --- tcMapView.cpp 6 Dec 2006 01:20:42 -0000 1.52 *************** *** 2147,2151 **** bool suppressTrackId = (pMO->mnID == NULL_INDEX) || (type == SYMBOL_UNKNOWN) || ! (type == SYMBOL_MARK); if (mbShowTrackID && !suppressTrackId) --- 2147,2152 ---- bool suppressTrackId = (pMO->mnID == NULL_INDEX) || (type == SYMBOL_UNKNOWN) || ! (type == SYMBOL_MARK) || ((pMO->meAffiliation == FRIENDLY) && (type == SYMBOL_MISSILE)); ! if (mbShowTrackID && !suppressTrackId) |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/scripts Modified Files: Menu.py Log Message: Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Menu.py 28 Nov 2006 01:57:36 -0000 1.29 --- Menu.py 6 Dec 2006 01:20:42 -0000 1.30 *************** *** 72,76 **** return else: ! UnitMenu.AddItem('Unavailable unit', '') return --- 72,77 ---- return else: ! controller = UnitInfo.GetController() ! UnitMenu.AddItem('Unavailable unit (%s)' % controller, '') return |
From: Dewitt C. <ddc...@us...> - 2006-12-06 01:20:48
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22513/src/database Modified Files: tcSonobuoyDBObject.cpp Log Message: Index: tcSonobuoyDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSonobuoyDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSonobuoyDBObject.cpp 20 Nov 2006 00:17:40 -0000 1.4 --- tcSonobuoyDBObject.cpp 6 Dec 2006 01:20:42 -0000 1.5 *************** *** 56,59 **** --- 56,60 ---- tcDatabaseObject::AddSqlColumns(columnString); tcSensorPlatformDBObject::AddSqlColumns(columnString); + tcWaterDetectionDBObject::AddSqlColumns(columnString); columnString += ","; *************** *** 67,73 **** --- 68,77 ---- tcDatabaseObject::ReadSql(entry); tcSensorPlatformDBObject::ReadSql(entry); + tcWaterDetectionDBObject::ReadSql(entry); batteryLife_s = entry.GetDouble("BatteryLife_s"); commRange_km = entry.GetDouble("CommRange_km"); + + tcWaterDetectionDBObject::CalculateParams(1.0); } *************** *** 76,79 **** --- 80,84 ---- tcDatabaseObject::WriteSql(valueString); tcSensorPlatformDBObject::WriteSql(valueString); + tcWaterDetectionDBObject::WriteSql(valueString); std::stringstream s; *************** *** 89,93 **** tcSonobuoyDBObject::tcSonobuoyDBObject() : tcDatabaseObject(), ! tcSensorPlatformDBObject() { mzClass = "Default Sonobuoy"; --- 94,99 ---- tcSonobuoyDBObject::tcSonobuoyDBObject() : tcDatabaseObject(), ! tcSensorPlatformDBObject(), ! tcWaterDetectionDBObject() { mzClass = "Default Sonobuoy"; *************** *** 96,99 **** --- 102,106 ---- tcSonobuoyDBObject::tcSonobuoyDBObject(tcSonobuoyDBObject& obj) : tcDatabaseObject(obj), tcSensorPlatformDBObject(obj), + tcWaterDetectionDBObject(obj), batteryLife_s(obj.batteryLife_s), commRange_km(obj.commRange_km) |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/src/graphics Modified Files: tcChatBox.cpp tcDatabaseInfoWindow.cpp tcOOBView.cpp tcXmlWindow.cpp Log Message: Index: tcXmlWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcXmlWindow.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcXmlWindow.cpp 6 Sep 2006 01:28:20 -0000 1.10 --- tcXmlWindow.cpp 2 Dec 2006 02:23:48 -0000 1.11 *************** *** 118,121 **** --- 118,149 ---- } + + /** + * Use this method to safely destroy the windw + */ + void tcXmlWindow::DestroyWindow() + { + destroy = true; + } + + /** + * If destroy is queued, destroy window and return true, + * otherwise do nothing and return false + */ + bool tcXmlWindow::FinishDestroy() + { + if (destroy) + { + ClearDrawObjects(); + Destroy(); + return true; + } + else + { + return false; + } + } + + /** * Intended to be overrided to intercept command events from GUI *************** *** 135,138 **** --- 163,203 ---- } + void tcXmlWindow::OnLButtonDown(wxMouseEvent& event) + { + /* check if cursor is over a non-empty slot, if so + ** arm drag with slot idx */ + wxPoint point = event.GetPosition(); + + float x = (float)point.x; + float y = (float)point.y; + + isLButtonDown = true; + if (isDragable && ((point.y <= 20) || (point.y >= mnHeight))) + { + windowDragOn = true; + // position in parent's frame of mouse pointer + windowDragPoint = wxPoint(mrectWindow.GetLeft() + point.x, mrectWindow.GetBottom() + point.y); + + CaptureMouse(); + return; + } + + } + + void tcXmlWindow::OnLButtonUp(wxMouseEvent& event) + { + isLButtonDown = false; + windowDragOn = false; + ReleaseMouse(); + } + + + void tcXmlWindow::OnMouseMove(wxMouseEvent& event) + { + wxPoint point = event.GetPosition(); + + UpdateWindowDrag(point); + } + void tcXmlWindow::SetButtonDisable(long command, bool state) *************** *** 188,191 **** --- 253,262 ---- } + void tcXmlWindow::SetDragable(bool state) + { + isDragable = state; + } + + /** * Finds first radio button with command matching radioCommand and sets *************** *** 209,217 **** tcXmlWindow::tcXmlWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& configFile, const wxString& name, tc3DWindow* graphicsHost) ! : tc3DWindow(parent, pos, size, name, graphicsHost) { if (configFile.length() > 2) --- 280,309 ---- + void tcXmlWindow::UpdateWindowDrag(const wxPoint& pos) + { + if (!windowDragOn) return; + + // position in parent's frame of mouse pointer + wxPoint current = wxPoint(mrectWindow.GetLeft() + pos.x, mrectWindow.GetBottom() + pos.y); + if (current != windowDragPoint) + { + wxPoint delta = current - windowDragPoint; + int xmove = mrectWindow.GetLeft() + delta.x; + int ymove = mrectWindow.GetTop() + delta.y; + tc3DWindow::MoveWindow(xmove, ymove); + windowDragPoint = current; + } + } + + tcXmlWindow::tcXmlWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& configFile, const wxString& name, tc3DWindow* graphicsHost) ! : tc3DWindow(parent, pos, size, name, graphicsHost) , ! destroy(false), ! isDragable(false), ! windowDragOn(false), ! isLButtonDown(false) { if (configFile.length() > 2) Index: tcDatabaseInfoWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcDatabaseInfoWindow.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDatabaseInfoWindow.cpp 20 Nov 2006 00:17:42 -0000 1.9 --- tcDatabaseInfoWindow.cpp 2 Dec 2006 02:23:48 -0000 1.10 *************** *** 62,74 **** - /** - * Use this method to safely destroy the windw - */ - void tcDatabaseInfoWindow::DestroyWindow() - { - destroy = true; - } - - void tcDatabaseInfoWindow::Draw() { --- 62,65 ---- *************** *** 215,236 **** - /** - * If destroy is queued, destroy window and return true, - * otherwise do nothing and return false - */ - bool tcDatabaseInfoWindow::FinishDestroy() - { - if (destroy) - { - ClearDrawObjects(); - this->Destroy(); - return true; - } - else - { - return false; - } - } - --- 206,209 ---- *************** *** 306,328 **** void tcDatabaseInfoWindow::OnLButtonDown(wxMouseEvent& event) { ! /* check if cursor is over a non-empty slot, if so ! ** arm drag with slot idx */ ! wxPoint point = event.GetPosition(); ! ! float x = (float)point.x; ! float y = (float)point.y; ! ! ! isLButtonDown = true; ! if (isDragable && ((point.y <= 20) || (point.y >= mnHeight))) ! { ! windowDragOn = true; ! // position in parent's frame of mouse pointer ! windowDragPoint = wxPoint(mrectWindow.GetLeft() + point.x, mrectWindow.GetBottom() + point.y); ! ! CaptureMouse(); ! return; ! } ! } --- 279,283 ---- void tcDatabaseInfoWindow::OnLButtonDown(wxMouseEvent& event) { ! tcXmlWindow::OnLButtonDown(event); } *************** *** 331,338 **** void tcDatabaseInfoWindow::OnLButtonUp(wxMouseEvent& event) { ! isLButtonDown = false; ! windowDragOn = false; ! ReleaseMouse(); ! } --- 286,290 ---- void tcDatabaseInfoWindow::OnLButtonUp(wxMouseEvent& event) { ! tcXmlWindow::OnLButtonUp(event); } *************** *** 347,358 **** void tcDatabaseInfoWindow::OnMouseMove(wxMouseEvent& event) { ! wxPoint point = event.GetPosition(); ! ! UpdateWindowDrag(point); ! ! // update mouseover status of all slots ! float x = (float)point.x; ! float y = (float)point.y; ! } --- 299,303 ---- void tcDatabaseInfoWindow::OnMouseMove(wxMouseEvent& event) { ! tcXmlWindow::OnMouseMove(event); } *************** *** 379,404 **** } - void tcDatabaseInfoWindow::SetDragable(bool state) - { - isDragable = state; - } - - - void tcDatabaseInfoWindow::UpdateWindowDrag(const wxPoint& pos) - { - if (!windowDragOn) return; - - - // position in parent's frame of mouse pointer - wxPoint current = wxPoint(mrectWindow.GetLeft() + pos.x, mrectWindow.GetBottom() + pos.y); - if (current != windowDragPoint) - { - wxPoint delta = current - windowDragPoint; - int xmove = mrectWindow.GetLeft() + delta.x; - int ymove = mrectWindow.GetTop() + delta.y; - tc3DWindow::MoveWindow(xmove, ymove); - windowDragPoint = current; - } - } --- 324,327 ---- *************** *** 408,416 **** tcDatabaseInfoWindow::tcDatabaseInfoWindow(const wxPoint& pos, const wxString& configFile, const wxString& name, tc3DWindow* hostParent) : tcXmlWindow(hostParent, pos, wxSize(10, 10), configFile, name, hostParent), - destroy(false), drawCount(0), - isLButtonDown(false), - windowDragOn(false), - isDragable(true), objId(-1), databaseClassName(""), --- 331,335 ---- Index: tcChatBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcChatBox.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcChatBox.cpp 23 Mar 2006 01:11:02 -0000 1.5 --- tcChatBox.cpp 2 Dec 2006 02:23:48 -0000 1.6 *************** *** 39,42 **** --- 39,43 ---- BEGIN_EVENT_TABLE(tcChatBox, tcXmlWindow) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcChatBox::SendChatText) + EVT_COMMAND(86, wxEVT_COMMAND_BUTTON_CLICKED, tcChatBox::OnCloseCommand) END_EVENT_TABLE() *************** *** 49,52 **** --- 50,55 ---- void tcChatBox::Draw() { + if (FinishDestroy()) return; + if (!IsBackgroundEnabled()) { *************** *** 66,69 **** --- 69,80 ---- } + /** + * Close and destroy window at next safe opportunity + */ + void tcChatBox::OnCloseCommand(wxCommandEvent& event) + { + SetActive(false); + } + void tcChatBox::OnKeyDown(wxKeyEvent& event) { *************** *** 73,76 **** --- 84,93 ---- void tcChatBox::OnLButtonDown(wxMouseEvent& event) { + tcXmlWindow::OnLButtonDown(event); + } + + void tcChatBox::OnRButtonDown(wxMouseEvent& event) + { + // event stops here } Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcOOBView.cpp 17 Aug 2006 01:28:04 -0000 1.15 --- tcOOBView.cpp 2 Dec 2006 02:23:48 -0000 1.16 *************** *** 101,105 **** wxASSERT(mpSimState); ! unsigned nCount = mpSimState->GetAlliancePlatforms(objKeys, MAX_OOB_OBJECTS, mnAlliance); for (unsigned n = 0; n < nCount; n++) --- 101,107 ---- wxASSERT(mpSimState); ! int alliance = (int)tcUserInfo::Get()->GetOwnAlliance(); ! ! unsigned nCount = mpSimState->GetAlliancePlatforms(objKeys, MAX_OOB_OBJECTS, alliance); for (unsigned n = 0; n < nCount; n++) *************** *** 173,176 **** --- 175,180 ---- void tcOOBView::UpdateTrackData() { + int alliance = (int)tcUserInfo::Get()->GetOwnAlliance(); + surfaceTracks.clear(); subTracks.clear(); *************** *** 182,186 **** region.Set(-C_PI, C_PIM, -C_PIOVER2, C_PIOVER2); // all earth ! tcSensorTrackIterator iter(mnAlliance, 0xFFFF, region); for (iter.First();iter.NotDone();iter.Next()) --- 186,190 ---- region.Set(-C_PI, C_PIM, -C_PIOVER2, C_PIOVER2); // all earth ! tcSensorTrackIterator iter(alliance, 0xFFFF, region); for (iter.First();iter.NotDone();iter.Next()) *************** *** 809,813 **** tcXmlWindow(parent, pos, size, "xml/oobview.xml", name, graphicsHost), mpMapView(0), - mnAlliance(0), mnSelectedKey(NULL_INDEX), mbMouseDrag(false), --- 813,816 ---- |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/include/sim Modified Files: tcPlatformObject.h Log Message: Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcPlatformObject.h 20 Nov 2006 00:16:29 -0000 1.40 --- tcPlatformObject.h 2 Dec 2006 02:23:48 -0000 1.41 *************** *** 135,138 **** --- 135,139 ---- bool AllLaunchersEmpty(); bool AllLaunchersFull(); + bool IsLoading() const; void UnloadAllLaunchers(); void EquipForTargetType(int targetFlag); |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/src/network Modified Files: tcControlMessageHandler.cpp Log Message: Index: tcControlMessageHandler.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcControlMessageHandler.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcControlMessageHandler.cpp 23 Mar 2006 01:11:02 -0000 1.10 --- tcControlMessageHandler.cpp 2 Dec 2006 02:23:48 -0000 1.11 *************** *** 163,167 **** --- 163,170 ---- int alliance; stream >> alliance; + + simState->Clear(); simState->mpUserInfo->SetOwnAlliance(alliance); + simState->SetMultiplayerClient(); // a hack to get the sensor map to switch to the new alliance fprintf(stdout, "Received alliance update msg from server (%d)\n", |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/include/graphics Modified Files: tcChatBox.h tcDatabaseInfoWindow.h tcOOBView.h tcXmlWindow.h Log Message: Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcXmlWindow.h 6 Sep 2006 01:28:20 -0000 1.9 --- tcXmlWindow.h 2 Dec 2006 02:23:48 -0000 1.10 *************** *** 43,46 **** --- 43,47 ---- { public: + virtual void DestroyWindow(); /// find first button with matching command and set force disable state void SetButtonDisable(long command, bool state); *************** *** 50,53 **** --- 51,55 ---- /// find first button with matching command and change caption void SetButtonCaption(long command, const std::string& caption); + void SetDragable(bool state); void SetRadioButtonState(long radioCommand, long buttonCommand); *************** *** 58,68 **** --- 60,85 ---- tc3DWindow* graphicsHost = 0); virtual ~tcXmlWindow(); + protected: TiXmlDocument* config; ///< XML auto-configuration file for window static int windowLayer; ///< used to achieve some layering of GUI windows (last always on top) + // params for window drag + bool isLButtonDown; + bool windowDragOn; + wxPoint windowDragPoint; + bool isDragable; ///< true if window can be dragged (moved) + + void UpdateWindowDrag(const wxPoint& pos); + bool FinishDestroy(); + virtual void OnButtonCommand(wxCommandEvent& event); + virtual void OnLButtonDown(wxMouseEvent& event); + virtual void OnLButtonUp(wxMouseEvent& event); + virtual void OnMouseMove(wxMouseEvent& event); + private: static unsigned ref_count; + bool destroy; ///< flag to delay destruction of window to safe time void AddXMLControls(); ///< adds XML controls to window that can be added automatically Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcOOBView.h 22 Mar 2006 01:23:29 -0000 1.8 --- tcOOBView.h 2 Dec 2006 02:23:48 -0000 1.9 *************** *** 75,79 **** tcSimState* mpSimState; ///< for retrieving platform info tcTacticalMapView *mpMapView; - int mnAlliance; ///< alliance to display // own alliance --- 75,78 ---- Index: tcDatabaseInfoWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseInfoWindow.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcDatabaseInfoWindow.h 20 Nov 2006 00:16:28 -0000 1.7 --- tcDatabaseInfoWindow.h 2 Dec 2006 02:23:48 -0000 1.8 *************** *** 49,53 **** { public: - virtual void DestroyWindow(); virtual void Draw(); --- 49,52 ---- *************** *** 66,76 **** /// set id of game object to display info for (must be classified if track) void SetDatabaseObject(long id); - - void SetDragable(bool state); static void SetParent(tc3DWindow* win); - tcDatabaseInfoWindow(const wxPoint& pos, const wxString& configFile = "xml/database_info.xml", --- 65,72 ---- *************** *** 83,95 **** unsigned int drawCount; - // params for window drag (move this function to base class?) - bool isLButtonDown; - bool windowDragOn; - wxPoint windowDragPoint; - bool isDragable; ///< true if window can be dragged (moved) - - bool FinishDestroy(); - void UpdateWindowDrag(const wxPoint& pos); - private: enum ViewMode --- 79,82 ---- *************** *** 99,104 **** } viewMode; ///< mode automatically selected based on hostParent argument to constructor ! bool destroy; ///< workaround to delay destruction of window to safe time ! long objId; ///< id of obj or track to display info for std::string databaseClassName; ///< class name of database object, empty if not looked up yet --- 86,90 ---- } viewMode; ///< mode automatically selected based on hostParent argument to constructor ! long objId; ///< id of obj or track to display info for std::string databaseClassName; ///< class name of database object, empty if not looked up yet Index: tcChatBox.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcChatBox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcChatBox.h 22 Mar 2006 01:23:28 -0000 1.3 --- tcChatBox.h 2 Dec 2006 02:23:48 -0000 1.4 *************** *** 44,48 **** --- 44,50 ---- void Draw(); void OnLButtonDown(wxMouseEvent& event); + void OnRButtonDown(wxMouseEvent& event); void OnChar(wxKeyEvent& event); + void OnCloseCommand(wxCommandEvent& event); void OnKeyDown(wxKeyEvent& event); void SendChatText(wxCommandEvent& event); |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/src/sim Modified Files: Game.cpp tcAirObject.cpp tcFlightPort.cpp tcPlatformObject.cpp tcStores.cpp Log Message: Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** tcPlatformObject.cpp 23 Nov 2006 00:07:33 -0000 1.68 --- tcPlatformObject.cpp 2 Dec 2006 02:23:48 -0000 1.69 *************** *** 685,688 **** --- 685,703 ---- } + /** + * @return true if any launchers are loading or unloading + */ + bool tcPlatformObject::IsLoading() const + { + size_t nLaunchers = GetLauncherCount(); + for (size_t n=0; n<nLaunchers; n++) + { + const tcLauncher* launcher = GetLauncher(n); + if (launcher->IsLoading()) return true; + } + + return false; + } + void tcPlatformObject::UnloadAllLaunchers() { Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** Game.cpp 23 Nov 2006 00:07:33 -0000 1.164 --- Game.cpp 2 Dec 2006 02:23:48 -0000 1.165 *************** *** 620,623 **** --- 620,624 ---- chatBox->SetBaseRenderBin(40); chatBox->SetActive(false); + chatBox->SetDragable(true); *************** *** 1159,1164 **** oobView->AttachMapView(tacticalMap); - oobView->mnAlliance = userInfo->GetOwnAlliance(); // TODO: make this configurable - // popupControl init --- 1160,1163 ---- Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcStores.cpp 23 Nov 2006 00:07:33 -0000 1.17 --- tcStores.cpp 2 Dec 2006 02:23:49 -0000 1.18 *************** *** 541,546 **** tcGameObject* obj = GetChildOrParent(op.obj); ! wxASSERT(obj); ! if (obj == 0) { return; --- 541,546 ---- tcGameObject* obj = GetChildOrParent(op.obj); ! ! if (obj == 0) // object left or destroyed { return; Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcFlightPort.cpp 27 Nov 2006 00:46:40 -0000 1.31 --- tcFlightPort.cpp 2 Dec 2006 02:23:48 -0000 1.32 *************** *** 1314,1317 **** --- 1314,1327 ---- { tcAirState *airstate = units.at(n); + + bool moveable = false; + if (tcAirObject* air = dynamic_cast<tcAirObject*>(airstate->obj)) + { + moveable = !air->IsRefueling() && !air->IsLoading(); + } + else + { + wxASSERT(false); + } /* if the unit is not in transit and is not at goal location, *************** *** 1319,1323 **** ** goal location, then take spot and set current location to TRANSIT */ bool inTransit = airstate->inTransit; ! if ((!inTransit)&&(airstate->current_location != airstate->goal_location)) { if ((airstate->goal_location == TAKEOFF) && (airstate->current_location == LAUNCH)) --- 1329,1334 ---- ** goal location, then take spot and set current location to TRANSIT */ bool inTransit = airstate->inTransit; ! ! if ((!inTransit) && moveable && (airstate->current_location != airstate->goal_location)) { if ((airstate->goal_location == TAKEOFF) && (airstate->current_location == LAUNCH)) Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** tcAirObject.cpp 1 Dec 2006 03:39:54 -0000 1.34 --- tcAirObject.cpp 2 Dec 2006 02:23:48 -0000 1.35 *************** *** 71,74 **** --- 71,76 ---- stream >> maxPitch_rad; + UpdateLoadoutTag(); + return stream; } |
From: Dewitt C. <ddc...@us...> - 2006-12-02 02:23:51
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14318/xml Modified Files: chat_box.xml Log Message: Index: chat_box.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/chat_box.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** chat_box.xml 17 May 2005 00:20:41 -0000 1.3 --- chat_box.xml 2 Dec 2006 02:23:49 -0000 1.4 *************** *** 2,5 **** <ChatBox X="10" Y="10" Width="400" Height="250" FontSize="14.0" Wrap="70" DrawBorder="1"/> <ChatEntry X="10" Y="260" Width="400" Height="16" BarX="0.0" BarY="1.0" BarWidth="400.0" BarHeight="14.0" Caption="" FontSize="14.0" DrawBorder="1"/> ! </Window> \ No newline at end of file --- 2,7 ---- <ChatBox X="10" Y="10" Width="400" Height="250" FontSize="14.0" Wrap="70" DrawBorder="1"/> <ChatEntry X="10" Y="260" Width="400" Height="16" BarX="0.0" BarY="1.0" BarWidth="400.0" BarHeight="14.0" Caption="" FontSize="14.0" DrawBorder="1"/> ! <Button X="400" Y="2" Width="16" Height="16" Command="86" Caption=""> ! <Image Off="close.png" On="close.png" /> ! </Button> </Window> \ No newline at end of file |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:56
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/src/scriptinterface Modified Files: tcSimPythonInterface.cpp tcTrackInterface.cpp Log Message: Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** tcSimPythonInterface.cpp 20 Nov 2006 00:17:43 -0000 1.45 --- tcSimPythonInterface.cpp 1 Dec 2006 03:39:54 -0000 1.46 *************** *** 38,41 **** --- 38,42 ---- #include "tcMessageInterface.h" #include "tcTime.h" + #include "network/tcMultiplayerInterface.h" #include "ai/ScriptedTask.h" *************** *** 45,54 **** --- 46,59 ---- #include "common/tcOptions.h" + + #ifdef _DEBUG #define new DEBUG_NEW #endif + using namespace boost::python; using namespace ai; + using namespace network; namespace scriptinterface *************** *** 195,198 **** --- 200,226 ---- const std::string& playerName = stream.GetMetaString(); + tcMultiplayerInterface* multiplayerInterface = tcMultiplayerInterface::Get(); + int connId = multiplayerInterface->GetPlayerConnectionId(playerName); + if (connId == -1) + { + fprintf(stderr, "tcSimPythonInterface::operator<< - Bad playername (%s)\n", + playerName.c_str()); + return stream; + } + tcPlayerStatus playerStatus = multiplayerInterface->GetPlayerStatus(connId); + + tcAllianceSensorMap* playerSensorMap = mpSimState->GetSensorMap()->GetMap(playerStatus.alliance); + if (playerSensorMap == 0) + { + fprintf(stderr, "tcSimPythonInterface::operator<< - Player has no sensor map, bad alliance? (%s, %d)\n", + playerName.c_str(), playerStatus.alliance); + return stream; + } + tcAllianceSensorMap* previousSensorMap = tcTrackInterface::GetSensorMap(); // save current map + tcTrackInterface::SetSensorMap(playerSensorMap); + + unsigned char prevAlliance = mpSimState->mpUserInfo->GetOwnAlliance(); + mpSimState->mpUserInfo->SetOwnAlliance(playerStatus.alliance); + unsigned char nCommands; stream >> nCommands; *************** *** 200,203 **** --- 228,234 ---- for (unsigned char n=0; n<nCommands; n++) { + char menuMode; + stream >> menuMode; + unsigned char nId; stream >> nId; *************** *** 220,238 **** { tcGameObject* obj = mpSimState->GetObject(idList[n]); ! playerHasControl = obj->IsControlledBy(playerName); } ! if (playerHasControl) ! { #ifdef _DEBUG ! long id0 = (idList.size() > 0) ? idList[0] : -1; ! fprintf(stdout, "Script cmd (%d/%d): %s\n", id0, idList.size(), command.c_str()); #endif ! ProcessCallbackString(command, idList); ! } ! else ! { ! fprintf(stderr, "Script command issued for obj that player does not control, " ! "player: %s\n", playerName.c_str()); ! } } else --- 251,296 ---- { tcGameObject* obj = mpSimState->GetObject(idList[n]); ! playerHasControl = (obj != 0) ? obj->IsControlledBy(playerName) : false; ! if (obj == 0) ! { ! fprintf(stderr, "tcSimPythonInterface::operator<< - bad idList passed, menuMode: %d\n", ! int(menuMode)); ! } } ! ! bool trackMode = menuMode == TRACK_MENU; ! ! if (!trackMode) ! { ! if (playerHasControl) ! { #ifdef _DEBUG ! long id0 = (idList.size() > 0) ? idList[0] : -1; ! fprintf(stdout, "Script cmd (%d/%d): %s\n", id0, idList.size(), command.c_str()); #endif ! ProcessCallbackString(command, idList); ! } ! else ! { ! fprintf(stderr, "Script command issued for obj that player does not control, " ! "player: %s\n", playerName.c_str()); ! } ! } ! else // track mode ! { ! if (!playerHasControl) ! { ! #ifdef _DEBUG ! long id0 = (idList.size() > 0) ? idList[0] : -1; ! fprintf(stdout, "Script track cmd (%d/%d): %s\n", id0, idList.size(), command.c_str()); ! #endif ! ProcessCallbackString(command, idList); ! } ! else ! { ! fprintf(stderr, "Script track command issued for obj that player controls, " ! "player: %s\n", playerName.c_str()); ! } ! } } else *************** *** 243,246 **** --- 301,307 ---- } + tcTrackInterface::SetSensorMap(previousSensorMap); // restore sensor map + mpSimState->mpUserInfo->SetOwnAlliance(prevAlliance); + return stream; } *************** *** 263,266 **** --- 324,329 ---- ClientCommand& cmd = clientCommands[n]; + stream << cmd.menuMode; + wxASSERT(cmd.idList.size() < 256); unsigned char nId = cmd.idList.size(); *************** *** 612,615 **** --- 675,681 ---- int param, std::string textParam) { + PushMode(); + SetMenuGroup(id); + std::string s = "Menu."; *************** *** 624,628 **** { char zBuff[64]; ! sprintf(zBuff,", %d",param); s += zBuff; } --- 690,694 ---- { char zBuff[64]; ! sprintf(zBuff,", %d", param); s += zBuff; } *************** *** 635,639 **** s += ")\n"; ! CallPython(s.c_str(),"Exception occurred in ProcessCommand\n"); } --- 701,727 ---- s += ")\n"; ! ! ! if (!mpSimState->IsMultiplayerClient()) ! { ! CallPython(s.c_str(), "Exception occurred in ProcessCommand\n"); ! } ! else ! { ! ClientCommand cmd; ! cmd.menuMode = meMenuMode; ! cmd.idList = id; ! cmd.commandText = s; ! ! if (cmd.idList.size() == 0) ! { ! cmd.idList = groupInterface->GetUnits(); ! } ! ! clientCommands.push_back(cmd); ! } ! ! ! PopMode(); } *************** *** 728,731 **** --- 816,820 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; cmd.commandText = std::string(zBuff); *************** *** 756,760 **** - GetObjectStringByMode(zObject); --- 845,848 ---- *************** *** 779,782 **** --- 867,871 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; cmd.commandText = std::string(zBuff); *************** *** 831,834 **** --- 920,924 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; unsigned nId = id.size(); *************** *** 882,885 **** --- 972,976 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; cmd.commandText = std::string(zBuff); *************** *** 920,923 **** --- 1011,1015 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; cmd.commandText = std::string(zBuff); *************** *** 955,958 **** --- 1047,1051 ---- { ClientCommand cmd; + cmd.menuMode = meMenuMode; cmd.idList = id; cmd.commandText = command; Index: tcTrackInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcTrackInterface.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcTrackInterface.cpp 23 Mar 2006 01:11:02 -0000 1.11 --- tcTrackInterface.cpp 1 Dec 2006 03:39:54 -0000 1.12 *************** *** 43,53 **** ! void tcTrackInterface::AttachSensorMap(tcAllianceSensorMap *apSM) { wxASSERT(apSM); mpSensorMap = apSM; ! fprintf(stdout, "tcTrackInterface - Attaching sensor map for alliance: %d\n", ! mpSensorMap->GetAlliance()); } --- 43,58 ---- ! void tcTrackInterface::SetSensorMap(tcAllianceSensorMap *apSM) { wxASSERT(apSM); mpSensorMap = apSM; ! fprintf(stdout, "tcTrackInterface - Attaching sensor map for alliance: %d\n", ! mpSensorMap->GetAlliance()); ! } ! ! tcAllianceSensorMap* tcTrackInterface::GetSensorMap() ! { ! return mpSensorMap; } |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:55
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/src/sim Modified Files: tcAirObject.cpp Log Message: Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcAirObject.cpp 20 Nov 2006 00:17:43 -0000 1.33 --- tcAirObject.cpp 1 Dec 2006 03:39:54 -0000 1.34 *************** *** 494,497 **** --- 494,525 ---- /** + * Automatically updates loadout tag with best guess at loadout + */ + void tcAirObject::UpdateLoadoutTag() + { + if (IsEquippedForTargetType(SUBSURFACE_TARGET)) + { + SetLoadoutTag("ASW"); + } + else if (IsEquippedForTargetType(SURFACE_TARGET)) + { + SetLoadoutTag("ASuW"); + } + else if (IsEquippedForTargetType(LAND_TARGET)) + { + SetLoadoutTag("STK"); + } + else if (IsEquippedForTargetType(AIR_TARGET)) + { + SetLoadoutTag("AAW"); + } + else + { + SetLoadoutTag("---"); + } + + } + + /** * Limits speed to 100 kts min */ |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:55
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/src/graphics Modified Files: tcFlightPortGui.cpp Log Message: Index: tcFlightPortGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcFlightPortGui.cpp 20 Nov 2006 00:17:42 -0000 1.12 --- tcFlightPortGui.cpp 1 Dec 2006 03:39:54 -0000 1.13 *************** *** 220,224 **** // draw description caption if mouse is over slot ! if (isMouseOver) { caption = entityItem->GetDescription(); --- 220,233 ---- // draw description caption if mouse is over slot ! if (!isMouseOver) ! { ! caption = air->GetLoadoutTag(); ! if (caption.size() == 0) ! { ! air->UpdateLoadoutTag(); ! caption = air->GetLoadoutTag(); ! } ! } ! else { caption = entityItem->GetDescription(); *************** *** 238,242 **** ! if (isMouseOver) { if (caption.size() == 0) --- 247,260 ---- ! if (!isMouseOver) ! { ! if (caption.size() > 0) ! { ! const osg::Vec4 color(1.0f, 1.0f, 1.0f, 1.0f); ! DrawTextR(caption.c_str(), slot.loc.XCenter(), slot.loc.GetTop() + 8.0f, defaultFont.get(), ! color, 10.0f, CENTER_CENTER); ! } ! } ! else { if (caption.size() == 0) *************** *** 250,253 **** --- 268,272 ---- } + } |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:55
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/include/scriptinterface Modified Files: tcSimPythonInterface.h tcTrackInterface.h Log Message: Index: tcTrackInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcTrackInterface.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcTrackInterface.h 22 Mar 2006 01:23:29 -0000 1.9 --- tcTrackInterface.h 1 Dec 2006 03:39:53 -0000 1.10 *************** *** 49,53 **** static void SetTrack(long anID) {mnTrackID = anID;} ! static void AttachSensorMap(tcAllianceSensorMap *apSM); tcTrackInterface(); virtual ~tcTrackInterface(); --- 49,55 ---- static void SetTrack(long anID) {mnTrackID = anID;} ! static void SetSensorMap(tcAllianceSensorMap *apSM); ! static tcAllianceSensorMap* GetSensorMap(); ! tcTrackInterface(); virtual ~tcTrackInterface(); Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** tcSimPythonInterface.h 24 Sep 2006 19:50:19 -0000 1.33 --- tcSimPythonInterface.h 1 Dec 2006 03:39:53 -0000 1.34 *************** *** 109,113 **** void AttachMenu(tcMenu *apMenu) {tcMenuInterface::AttachMenu(apMenu);} void AttachPanel(tcPanel *apPanel) {tcPanelInterface::AttachPanel(apPanel);} ! void AttachSensorMap(tcAllianceSensorMap *apSM) {tcTrackInterface::AttachSensorMap(apSM);} void AttachSimState(tcSimState *apSimState); --- 109,113 ---- void AttachMenu(tcMenu *apMenu) {tcMenuInterface::AttachMenu(apMenu);} void AttachPanel(tcPanel *apPanel) {tcPanelInterface::AttachPanel(apPanel);} ! void AttachSensorMap(tcAllianceSensorMap *apSM) {tcTrackInterface::SetSensorMap(apSM);} void AttachSimState(tcSimState *apSimState); *************** *** 215,218 **** --- 215,219 ---- struct ClientCommand { + char menuMode; std::vector<long> idList; std::string commandText; |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:55
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/include/sim Modified Files: tcAirObject.h Log Message: Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcAirObject.h 20 Nov 2006 00:16:29 -0000 1.16 --- tcAirObject.h 1 Dec 2006 03:39:53 -0000 1.17 *************** *** 68,71 **** --- 68,72 ---- bool IsOverweight() const; bool IsReadyForLaunch(); + void UpdateLoadoutTag(); void PrintToFile(tcFile& file); |
From: Dewitt C. <ddc...@us...> - 2006-12-01 03:39:55
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9232/include/network Modified Files: tcMultiplayerInterface.h Log Message: Index: tcMultiplayerInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcMultiplayerInterface.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcMultiplayerInterface.h 27 Nov 2006 00:46:24 -0000 1.31 --- tcMultiplayerInterface.h 1 Dec 2006 03:39:53 -0000 1.32 *************** *** 125,132 **** --- 125,135 ---- const std::vector<int>& GetConnectionVector() const; const std::string& GetConnectionStatus(int connectionId); + wxEvtHandler* GetEvtHandler() const; const std::string& GetName() const; unsigned int GetNumConnections(); const std::string& GetPassword() const; + + int GetPlayerConnectionId(const std::string& playerName); tcPlayerStatus& GetPlayerStatus(int connectionId); ///< redundant with GetConnectionStatus? const std::string& GetPlayerName(int connectionId); *************** *** 194,198 **** void ClearMessageMap(); void DistributeChatText(); - int GetPlayerConnectionId(const std::string& playerName); unsigned int GetUpdatePeriod(const tcGameObject* obj, const std::string& playerName) const; bool IsNewPlayer(int id); --- 197,200 ---- |
From: Dewitt C. <ddc...@us...> - 2006-11-30 04:11:17
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6798/src/network Modified Files: tcMultiplayerInterface.cpp Log Message: Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcMultiplayerInterface.cpp 29 Nov 2006 02:51:44 -0000 1.38 --- tcMultiplayerInterface.cpp 30 Nov 2006 04:11:13 -0000 1.39 *************** *** 2198,2212 **** tcUpdateStream stream; tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream); - tcUpdateMessageHandler::AddSensorUpdateHeader(alliance, stream); - size_t initialStreamSize = stream.size(); ! *allianceSensorMap >> stream; ! if (stream.size() > initialStreamSize) ! { ! SendUpdateMessage(connId, stream); ! fprintf(stdout, ">> sensormap update msg sent, connId (%d) size (%d)\n", ! connId, stream.size()); ! } } --- 2198,2235 ---- tcUpdateStream stream; tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream); + stream.SetDoneFlag(false); ! unsigned int nMessages = 0; ! const unsigned int maxMessages = 4; ! bool doneWriting = false; ! ! while (!doneWriting && (nMessages++ < maxMessages)) ! { ! tcUpdateMessageHandler::AddSensorUpdateHeader(alliance, stream); ! size_t initialStreamSize = stream.size(); ! ! *allianceSensorMap >> stream; ! doneWriting = stream.GetDoneFlag(); ! ! if (stream.size() > initialStreamSize) ! { ! SendUpdateMessage(connId, stream); ! fprintf(stdout, ">> sensormap update msg sent, connId (%d) size (%d) msg (%d)\n", ! connId, stream.size(), nMessages); ! } ! ! if (!doneWriting) ! { ! stream.clear(); ! tcUpdateMessageHandler::InitializeMessage(tcUpdateMessageHandler::SENSOR_UPDATE, stream); ! stream.SetDoneFlag(false); ! } ! } ! ! if (nMessages >= maxMessages) ! { ! fprintf(stderr, "tcMultiplayerInterface::UpdateSensorMap - exceeded max messages\n"); ! } } |
From: Dewitt C. <ddc...@us...> - 2006-11-30 04:11:16
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6798/src/sim Modified Files: tcAeroAirObject.cpp tcSensorMap.cpp tcSensorMapTrack.cpp tcSimState.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** tcSimState.cpp 28 Nov 2006 01:57:37 -0000 1.102 --- tcSimState.cpp 30 Nov 2006 04:11:13 -0000 1.103 *************** *** 217,220 **** --- 217,222 ---- tcGameObject* reference, float sensorAz, long fcID, unsigned fcIdx) { + if (target == 0) return false; + tcDatabaseObject* databaseObj = mpDatabase->GetObject(sensorKey); if (databaseObj == 0) Index: tcSensorMap.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMap.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcSensorMap.cpp 29 Nov 2006 02:51:44 -0000 1.28 --- tcSensorMap.cpp 30 Nov 2006 04:11:13 -0000 1.29 *************** *** 43,50 **** tcUpdateStream& tcAllianceSensorMap::operator<<(tcUpdateStream& stream) { ! long nTrackID; ! ! while ((stream >> nTrackID).eof() == false) { long nIdx = maTrackToSensorTrack[nTrackID]; if (nIdx == NULL_INDEX) --- 43,54 ---- tcUpdateStream& tcAllianceSensorMap::operator<<(tcUpdateStream& stream) { ! unsigned int nUpdates; ! stream >> nUpdates; ! ! for (unsigned int n=0; n<nUpdates; n++) { + long nTrackID; + stream >> nTrackID; + long nIdx = maTrackToSensorTrack[nTrackID]; if (nIdx == NULL_INDEX) *************** *** 80,99 **** tcUpdateStream& tcAllianceSensorMap::operator>>(tcUpdateStream& stream) { ! long pos = maTrack.GetStartPosition(); ! long nSize = maTrack.GetCount(); ! tcSensorMapTrack* sensorMapTrack; ! for (long i=0; i<nSize; i++) { ! long key; ! maTrack.GetNextAssoc(pos, key, sensorMapTrack); double dt = mfPreviousStatusTime - sensorMapTrack->mfTimestamp; if (dt < 2.0) { ! stream << sensorMapTrack->mnID; ! *sensorMapTrack >> stream; } } return stream; } --- 84,163 ---- tcUpdateStream& tcAllianceSensorMap::operator>>(tcUpdateStream& stream) { ! long freeSpace = stream.GetMaxSize() - stream.size() - sizeof(unsigned int); // unsigned int for update count header ! // if freeSpace < 0, the message should be rejected anyway so don't worry about special case ! // for this ! ! tcUpdateStream tempStream1; ! tcUpdateStream tempStream2; ! unsigned int nUpdates = 0; ! ! long pos; ! if (nextUpdateKey == -1) { ! pos = maTrack.GetStartPosition(); ! updatesRemaining = maTrack.GetCount(); ! } ! else ! { ! pos = nextUpdateKey; ! } ! ! ! tcSensorMapTrack* sensorMapTrack = 0; ! ! while ((updatesRemaining > 0) && (freeSpace > 0)) ! { ! tempStream1.clear(); ! ! maTrack.GetNextAssoc(pos, nextUpdateKey, sensorMapTrack); ! updatesRemaining--; double dt = mfPreviousStatusTime - sensorMapTrack->mfTimestamp; if (dt < 2.0) { ! tempStream1 << sensorMapTrack->mnID; ! *sensorMapTrack >> tempStream1; ! ! if ((long)tempStream1.size() <= freeSpace) ! { ! tempStream2 << tempStream1; ! freeSpace -= tempStream1.size(); ! nUpdates++; ! } ! else ! { ! freeSpace = 0; ! updatesRemaining++; // have to redo this update ! } ! } + } + if (nUpdates == 0) + { + nextUpdateKey = -1; + updatesRemaining = 0; + stream.SetDoneFlag(true); + return stream; + } + + stream << nUpdates; + stream << tempStream2; + + if (updatesRemaining < 0) + { + wxASSERT(updatesRemaining == 0); + nextUpdateKey = -1; + updatesRemaining = 0; + stream.SetDoneFlag(true); + } + else + { + stream.SetDoneFlag(false); + } + + + return stream; } *************** *** 245,253 **** } ! void tcAllianceSensorMap::Update(double afStatusTime) { #ifdef _DEBUG wxASSERT(maTrack.CheckForCorruption()==false); #endif tnPoolIndex cmappos = maTrack.GetStartPosition(); --- 309,375 ---- } ! ! void tcAllianceSensorMap::UpdateMultiplayerClient(double statusTime) { + tnPoolIndex cmappos = maTrack.GetStartPosition(); + tnPoolIndex nSize = maTrack.GetCount(); + tnPoolIndex nKey; + tcSensorMapTrack *psmtrack; + + for (tnPoolIndex i=0;i<nSize;i++) + { + maTrack.GetNextAssoc(cmappos,nKey,psmtrack); + + double timeSinceUpdate = statusTime - psmtrack->mfTimestamp; + + // updated to never drop ground tracks + bool dropTrack = false; + if (psmtrack->IsSurface()) + { + dropTrack = (timeSinceUpdate > 90.0f); + } + else if (psmtrack->IsGround()) + { + dropTrack = false; + } + else + { + dropTrack = (timeSinceUpdate > 40.0f); + } + + if (dropTrack) + { + if (psmtrack->mnID >= 0) + { + maTrackToSensorTrack[psmtrack->mnID] = NULL_INDEX; // used to be = maTrack.GetPoolSize(); + } + char zBuff[128]; + sprintf(zBuff,"Dropped track %d at time %.1f",psmtrack->mnID,statusTime); + WTL(zBuff); + + maTrack.RemoveKey(nKey); + } + else + { + // check for new data and update + psmtrack->UpdateTrack(); + } + } + #ifdef _DEBUG wxASSERT(maTrack.CheckForCorruption()==false); #endif + } + + void tcAllianceSensorMap::Update(double statusTime) + { + if ((statusTime - mfPreviousStatusTime) < 1.0f) {return;} + mfPreviousStatusTime = statusTime; + + if (tcSimState::Get()->IsMultiplayerClient()) + { + UpdateMultiplayerClient(statusTime); + return; + } tnPoolIndex cmappos = maTrack.GetStartPosition(); *************** *** 256,267 **** tcSensorMapTrack *psmtrack; - if ((afStatusTime - mfPreviousStatusTime) < 1.0f) {return;} - mfPreviousStatusTime = afStatusTime; bool updateEngagements = false; ! if (afStatusTime - lastEngagementsUpdate > 8.0f) { updateEngagements = true; ! lastEngagementsUpdate = afStatusTime; } --- 378,387 ---- tcSensorMapTrack *psmtrack; bool updateEngagements = false; ! if (statusTime - lastEngagementsUpdate > 8.0f) { updateEngagements = true; ! lastEngagementsUpdate = statusTime; } *************** *** 277,281 **** float adjustedStaleTime = (psmtrack->IsMissile()) ? 0.5f * staleTime : staleTime; ! double timeSinceUpdate = afStatusTime - psmtrack->maSensorReport[n].mfTimestamp; if (timeSinceUpdate >= ageOutTime) { --- 397,401 ---- float adjustedStaleTime = (psmtrack->IsMissile()) ? 0.5f * staleTime : staleTime; ! double timeSinceUpdate = statusTime - psmtrack->maSensorReport[n].mfTimestamp; if (timeSinceUpdate >= ageOutTime) { *************** *** 310,323 **** } char zBuff[128]; ! sprintf(zBuff,"Dropped track %d at time %.1f",psmtrack->mnID,afStatusTime); WTL(zBuff); - #ifdef _DEBUG - wxASSERT(maTrack.CheckForCorruption()==false); - #endif - maTrack.RemoveKey(nKey); - #ifdef _DEBUG - wxASSERT(maTrack.CheckForCorruption()==false); - #endif } else --- 430,437 ---- } char zBuff[128]; ! sprintf(zBuff,"Dropped track %d at time %.1f",psmtrack->mnID,statusTime); WTL(zBuff); + maTrack.RemoveKey(nKey); } else *************** *** 378,382 **** // randomize updates so alliances don't all update at once mfPreviousStatusTime = 1.0f*randf(); ! lastEngagementsUpdate = 10.0f*randf(); } /********************************************************************/ --- 492,499 ---- // randomize updates so alliances don't all update at once mfPreviousStatusTime = 1.0f*randf(); ! lastEngagementsUpdate = 10.0f*randf(); ! ! nextUpdateKey = -1; ! updatesRemaining = 0; } /********************************************************************/ *************** *** 421,425 **** : alliance(mapAlliance), ageOutTime(90.0f), ! staleTime(30.0f) { Clear(); --- 538,544 ---- : alliance(mapAlliance), ageOutTime(90.0f), ! staleTime(30.0f), ! nextUpdateKey(-1), ! updatesRemaining(0) { Clear(); Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSensorMapTrack.cpp 20 Nov 2006 00:17:45 -0000 1.9 --- tcSensorMapTrack.cpp 30 Nov 2006 04:11:13 -0000 1.10 *************** *** 63,72 **** tcTrack::operator<<(stream); ! stream >> mnContributors; ! for (int n = 0; n < mnContributors; n++) ! { ! stream >> maSensorReport[n].mfTimestamp; ! stream >> maSensorReport[n].mnSensorPlatformID; ! } long databaseId; --- 63,73 ---- tcTrack::operator<<(stream); ! mnContributors = 0; ! // stream >> mnContributors; ! // for (int n = 0; n < mnContributors; n++) ! // { ! // stream >> maSensorReport[n].mfTimestamp; ! //stream >> maSensorReport[n].mnSensorPlatformID; ! // } long databaseId; *************** *** 86,95 **** tcTrack::operator>>(stream); ! stream << mnContributors; ! for (int n = 0; n < mnContributors; n++) ! { ! stream << maSensorReport[n].mfTimestamp; ! stream << maSensorReport[n].mnSensorPlatformID; ! } stream << mnDatabaseID; --- 87,96 ---- tcTrack::operator>>(stream); ! // stream << mnContributors; ! // for (int n = 0; n < mnContributors; n++) ! // { ! // stream << maSensorReport[n].mfTimestamp; ! //stream << maSensorReport[n].mnSensorPlatformID; ! // } stream << mnDatabaseID; *************** *** 488,493 **** void tcSensorMapTrack::UpdateTrack() { ! if (autoKillAssess && (!simState->IsMultiplayerClient())) { if (!IsNew() && !IsDestroyed()) --- 489,495 ---- void tcSensorMapTrack::UpdateTrack() { + if (simState->IsMultiplayerClient()) return; ! if (autoKillAssess) { if (!IsNew() && !IsDestroyed()) Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcAeroAirObject.cpp 20 Nov 2006 00:17:43 -0000 1.25 --- tcAeroAirObject.cpp 30 Nov 2006 04:11:13 -0000 1.26 *************** *** 53,58 **** stream >> throttleFraction; ! fprintf(stdout, "received aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, ! mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); return stream; --- 53,58 ---- stream >> throttleFraction; ! //fprintf(stdout, "received aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, ! // mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); return stream; *************** *** 65,70 **** stream << throttleFraction; ! fprintf(stdout, "sending aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, ! mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); return stream; } --- 65,70 ---- stream << throttleFraction; ! //fprintf(stdout, "sending aero guidance update, id: %d, HSA %f, %f, %f\n", mnID, ! // mcGS.mfGoalHeading_deg, mcGS.mfGoalSpeed_kts, mcGS.mfGoalAltitude_m); return stream; } |
From: Dewitt C. <ddc...@us...> - 2006-11-30 04:11:16
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6798/include/sim Modified Files: tcSensorMap.h Log Message: Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcSensorMap.h 6 Jun 2006 00:08:34 -0000 1.18 --- tcSensorMap.h 30 Nov 2006 04:11:13 -0000 1.19 *************** *** 65,69 **** tnPoolIndex anTrackID, tcSensorMapTrack*& rpSMTrack); ! void Update(double afStatusTime); tcSensorMapTrack* GetSensorMapTrack(long anTrackID); bool GetTrack(long anTrackID, tcTrack& track); --- 65,70 ---- tnPoolIndex anTrackID, tcSensorMapTrack*& rpSMTrack); ! void Update(double statusTime); ! void UpdateMultiplayerClient(double statusTime); tcSensorMapTrack* GetSensorMapTrack(long anTrackID); bool GetTrack(long anTrackID, tcTrack& track); *************** *** 84,87 **** --- 85,90 ---- float ageOutTime; ///< time to drop track float staleTime; ///< time to indicate track as stale + long nextUpdateKey; ///< track key for partial mp update + long updatesRemaining; ///< remaining updates for partial mp update }; |
From: Dewitt C. <ddc...@us...> - 2006-11-29 02:51:47
|
Update of /cvsroot/gcblue/gcb_wx/include/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15466/include/network Modified Files: tcNetworkInterface.h Log Message: Index: tcNetworkInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/network/tcNetworkInterface.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcNetworkInterface.h 24 Oct 2006 01:33:58 -0000 1.15 --- tcNetworkInterface.h 29 Nov 2006 02:51:43 -0000 1.16 *************** *** 53,58 **** UDP = 2, UDP_ACK = 3, ! TCPIP_PORT = 3000, ! UDP_PORT = 3011, MESSAGE_BUFFER_SIZE = 128, UDP_EVENT_ID = -123, --- 53,58 ---- UDP = 2, UDP_ACK = 3, ! TCPIP_PORT = 3000, //6320, ! UDP_PORT = 3011, //6331, MESSAGE_BUFFER_SIZE = 128, UDP_EVENT_ID = -123, |
From: Dewitt C. <ddc...@us...> - 2006-11-29 02:51:47
|
Update of /cvsroot/gcblue/gcb_wx/src/network In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15466/src/network Modified Files: tcConnectionData.cpp tcMultiplayerInterface.cpp Log Message: Index: tcConnectionData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcConnectionData.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcConnectionData.cpp 20 Nov 2006 00:17:43 -0000 1.16 --- tcConnectionData.cpp 29 Nov 2006 02:51:44 -0000 1.17 *************** *** 364,368 **** const unsigned int resendLimit_sec = 8; ! const unsigned short maxResends = 2; unsigned int t = tcTime::Get()->Get30HzCount(); std::list<unsigned int>::iterator iter = waitForAck.begin(); --- 364,368 ---- const unsigned int resendLimit_sec = 8; ! const unsigned short maxResends = 1; unsigned int t = tcTime::Get()->Get30HzCount(); std::list<unsigned int>::iterator iter = waitForAck.begin(); Index: tcMultiplayerInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/network/tcMultiplayerInterface.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcMultiplayerInterface.cpp 27 Nov 2006 00:46:39 -0000 1.37 --- tcMultiplayerInterface.cpp 29 Nov 2006 02:51:44 -0000 1.38 *************** *** 1830,1834 **** else { ! return 50; } } --- 1830,1834 ---- else { ! return 60; } } |