yourmnbbn / smext-fakequeries

Return custom A2S_INFO and A2S_PLAYER response
GNU General Public License v3.0
23 stars 5 forks source link

Issue with build #9

Closed daffyyyy closed 2 years ago

daffyyyy commented 2 years ago

Hi, I have problem with compiling on sm version 1.10

When run /home/alliedmodders/extensions/smext-fakequeries/build# python3 ../configure.py --hl2sdk-root "/home/alliedmodders" --sm-path "/home/alliedmodders/sourcemod" --mms-path "/home/alliedmodders/mmsource-1.10" -s csgo and ambuild script throw errors likt below:


Spawned worker (pid: 23194)
[23193] c++ -pipe -fno-strict-aliasing -Wall -Werror -Wno-unused -Wno-switch -Wno-array-bounds -msse -m32 -fvisibility=hidden -Wno-narrowing -Wno-unused-result -mfpmath=sse -g3 -ggdb3 -std=c++14 -fno-exceptions -fno-threadsafe-statics -Wno-non-virtual-dtor -Wno-overloaded-virtual -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -DHAVE_STDINT_H -DGNUC -D_LINUX -DPOSIX -DHAVE_STRING_H -DSE_EPISODEONE=1 -DSE_ORANGEBOX=3 -DSE_CSS=6 -DSE_HL2DM=7 -DSE_DODS=8 -DSE_SDK2013=9 -DSE_TF2=11 -DSE_LEFT4DEAD=12 -DSE_NUCLEARDAWN=13 -DSE_LEFT4DEAD2=15 -DSE_DARKMESSIAH=2 -DSE_ALIENSWARM=16 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 -DSE_CSGO=21 -DSE_PORTAL2=17 -DSE_BLADE=18 -DSE_INSURGENCY=19 -DSE_CONTAGION=14 -DSE_BMS=10 -DSE_DOI=20 -DSOURCE_ENGINE=21 -DCOMPILER_GCC -DNETWORK_VARS_ENABLED -I /home/alliedmodders/sourcemod/public -I /home/alliedmodders/extensions/smext-fakequeries -I /home/alliedmodders/extensions/smext-fakequeries/sdk -I /home/alliedmodders/sourcemod/public -I /home/alliedmodders/sourcemod/public/extensions -I /home/alliedmodders/sourcemod/sourcepawn/include -I /home/alliedmodders/sourcemod/public/amtl/amtl -I /home/alliedmodders/sourcemod/public/amtl -I /home/alliedmodders/hl2sdk-csgo/public -I /home/alliedmodders/hl2sdk-csgo/public/steam -I /home/alliedmodders/mmsource-1.10/core -I /home/alliedmodders/mmsource-1.10/core/sourcehook -I /home/alliedmodders/hl2sdk-csgo/public -I /home/alliedmodders/hl2sdk-csgo/public/engine -I /home/alliedmodders/hl2sdk-csgo/public/mathlib -I /home/alliedmodders/hl2sdk-csgo/public/vstdlib -I /home/alliedmodders/hl2sdk-csgo/public/tier0 -I /home/alliedmodders/hl2sdk-csgo/public/tier1 -I /home/alliedmodders/hl2sdk-csgo/public/game/server -I /home/alliedmodders/hl2sdk-csgo/public/toolframework -I /home/alliedmodders/hl2sdk-csgo/game/shared -I /home/alliedmodders/hl2sdk-csgo/common -H -c /home/alliedmodders/extensions/smext-fakequeries/natives.cpp -o natives.o
In file included from /home/alliedmodders/extensions/smext-fakequeries/natives.cpp:1:
/home/alliedmodders/extensions/smext-fakequeries/natives.h:10:10: error: ‘string’ in namespace ‘std’ does not name a type
     std::string     name;
          ^~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.h:10:5: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
/home/alliedmodders/extensions/smext-fakequeries/natives.h:6:1:
+#include <string>

/home/alliedmodders/extensions/smext-fakequeries/natives.h:10:5:
     std::string     name;
     ^~~
In file included from /home/alliedmodders/extensions/smext-fakequeries/natives.cpp:1:
/home/alliedmodders/extensions/smext-fakequeries/natives.h:77:10: error: ‘vector’ in namespace ‘std’ does not name a template type
     std::vector<PlayerInfo_t> m_FakePlayers;
          ^~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.h:77:5: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
/home/alliedmodders/extensions/smext-fakequeries/natives.h:6:1:
+#include <vector>

/home/alliedmodders/extensions/smext-fakequeries/natives.h:77:5:
     std::vector<PlayerInfo_t> m_FakePlayers;
     ^~~
/home/alliedmodders/extensions/smext-fakequeries/natives.h: In member function ‘void CReturnA2sPlayer::InsertFakePlayer(uint8_t, char*, int, float)’:
/home/alliedmodders/extensions/smext-fakequeries/natives.h:64:55: error: too many initializers for ‘PlayerInfo_t’
         PlayerInfo_t info{index, name, score, playTime};
                                                       ^
/home/alliedmodders/extensions/smext-fakequeries/natives.h:65:9: error: ‘m_FakePlayers’ was not declared in this scope
         m_FakePlayers.push_back(std::move(info));
         ^~~~~~~~~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.h:65:9: note: suggested alternative: ‘RemoveFakePlayer’
         m_FakePlayers.push_back(std::move(info));
         ^~~~~~~~~~~~~
         RemoveFakePlayer
/home/alliedmodders/extensions/smext-fakequeries/natives.h: In member function ‘void CReturnA2sPlayer::ClearAllFakePlayer()’:
/home/alliedmodders/extensions/smext-fakequeries/natives.h:68:33: error: ‘m_FakePlayers’ was not declared in this scope
     void ClearAllFakePlayer() { m_FakePlayers.clear();}
                                 ^~~~~~~~~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.h:68:33: note: suggested alternative: ‘RemoveFakePlayer’
     void ClearAllFakePlayer() { m_FakePlayers.clear();}
                                 ^~~~~~~~~~~~~
                                 RemoveFakePlayer
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp: In member function ‘bool CReturnA2sPlayer::RemoveFakePlayer(uint8_t)’:
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:16:19: error: ‘m_FakePlayers’ was not declared in this scope
     for(auto it = m_FakePlayers.begin(); it != m_FakePlayers.end();)
                   ^~~~~~~~~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:16:19: note: suggested alternative: ‘RemoveFakePlayer’
     for(auto it = m_FakePlayers.begin(); it != m_FakePlayers.end();)
                   ^~~~~~~~~~~~~
                   RemoveFakePlayer
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp: In member function ‘bool CReturnA2sPlayer::GetPlayerStatus(int, PlayerInfo_t&)’:
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:45:10: error: ‘struct PlayerInfo_t’ has no member named ‘name’
     info.name = pPlayer->GetName();
          ^~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp: In member function ‘virtual void CReturnA2sPlayer::BuildCommunicationFrame()’:
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:96:41: error: ‘m_FakePlayers’ was not declared in this scope
     m_TotalClientsCount = maxClients + (m_FakePlayers.size() > m_FakePlayerDisplayNum ? m_FakePlayerDisplayNum : m_FakePlayers.size());
                                         ^~~~~~~~~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:96:41: note: suggested alternative: ‘RemoveFakePlayer’
     m_TotalClientsCount = maxClients + (m_FakePlayers.size() > m_FakePlayerDisplayNum ? m_FakePlayerDisplayNum : m_FakePlayers.size());
                                         ^~~~~~~~~~~~~
                                         RemoveFakePlayer
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:114:40: error: ‘struct PlayerInfo_t’ has no member named ‘name’
         m_replyPacket.WriteString(info.name.c_str());
                                        ^~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:127:29: error: unable to deduce ‘auto&&’ from ‘m_FakePlayers’
     for(PlayerInfo_t info : m_FakePlayers)
                             ^~~~~~~~~~~~~
/home/alliedmodders/extensions/smext-fakequeries/natives.cpp:130:40: error: ‘struct PlayerInfo_t’ has no member named ‘name’
         m_replyPacket.WriteString(info.name.c_str());
                                        ^~~~
Build failed: fakequeries.ext.2.csgo/natives.o```

Is there any way to compile with 1.10? 
yourmnbbn commented 2 years ago

Just do as what the compiler has noted. Add the following code in extension.h

#include <string>
#include <vector>
yourmnbbn commented 2 years ago

The latest commit has fixed this.