Fix dummy bugs

This commit is contained in:
def 2014-04-26 21:10:39 +02:00
parent 378d613de9
commit 5345bb6273
2 changed files with 11 additions and 21 deletions

View file

@ -533,15 +533,12 @@ void CClient::Connect(const char *pAddress)
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBuf); m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBuf);
ServerInfoRequest(); ServerInfoRequest();
for(int i=0;i<1;i++) if(net_host_lookup(m_aServerAddressStr, &m_ServerAddress, m_NetClient[0].NetType()) != 0)
{ {
if(net_host_lookup(m_aServerAddressStr, &m_ServerAddress, m_NetClient[i].NetType()) != 0) char aBufMsg[256];
{ str_format(aBufMsg, sizeof(aBufMsg), "could not find the address of %s, connecting to localhost", aBuf);
char aBufMsg[256]; m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBufMsg);
str_format(aBufMsg, sizeof(aBufMsg), "could not find the address of %s, connecting to localhost", aBuf); net_host_lookup("localhost", &m_ServerAddress, m_NetClient[0].NetType());
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBufMsg);
net_host_lookup("localhost", &m_ServerAddress, m_NetClient[i].NetType());
}
} }
m_RconAuthed = 0; m_RconAuthed = 0;
@ -1669,7 +1666,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
void CClient::PumpNetwork() void CClient::PumpNetwork()
{ {
for(int i=0; i<64; i++) for(int i=0; i<2; i++)
{ {
m_NetClient[i].Update(); m_NetClient[i].Update();
} }
@ -1698,9 +1695,8 @@ void CClient::PumpNetwork()
// process packets // process packets
CNetChunk Packet; CNetChunk Packet;
for(int i=0; i < 64; i++) for(int i=0; i < 2; i++)
{ {
// wichtig
while(m_NetClient[i].Recv(&Packet)) while(m_NetClient[i].Recv(&Packet))
{ {
if(Packet.m_ClientID == -1 || i > 1) if(Packet.m_ClientID == -1 || i > 1)
@ -1956,10 +1952,7 @@ void CClient::VersionUpdate()
Packet.m_DataSize = sizeof(VERSIONSRV_GETVERSION); Packet.m_DataSize = sizeof(VERSIONSRV_GETVERSION);
Packet.m_Flags = NETSENDFLAG_CONNLESS; Packet.m_Flags = NETSENDFLAG_CONNLESS;
for(int i = 0; i < 64;i++) m_NetClient[0].Send(&Packet);
{
m_NetClient[i].Send(&Packet);
}
m_VersionInfo.m_State = CVersionInfo::STATE_READY; m_VersionInfo.m_State = CVersionInfo::STATE_READY;
} }
} }
@ -2040,7 +2033,7 @@ void CClient::Run()
mem_zero(&BindAddr, sizeof(BindAddr)); mem_zero(&BindAddr, sizeof(BindAddr));
BindAddr.type = NETTYPE_ALL; BindAddr.type = NETTYPE_ALL;
} }
for(int i = 0; i < 64; i++) for(int i = 0; i < 2; i++)
{ {
if(!m_NetClient[i].Open(BindAddr, 0)) if(!m_NetClient[i].Open(BindAddr, 0))
{ {
@ -2057,10 +2050,7 @@ void CClient::Run()
Input()->Init(); Input()->Init();
// start refreshing addresses while we load // start refreshing addresses while we load
for(int i=0;i<64;i++) MasterServer()->RefreshAddresses(m_NetClient[0].NetType());
{
MasterServer()->RefreshAddresses(m_NetClient[i].NetType());
}
// init the editor // init the editor
m_pEditor->Init(); m_pEditor->Init();

View file

@ -71,7 +71,7 @@ class CClient : public IClient, public CDemoPlayer::IListner
PREDICTION_MARGIN=1000/50/2, // magic network prediction value PREDICTION_MARGIN=1000/50/2, // magic network prediction value
}; };
class CNetClient m_NetClient[MAX_CLIENTS]; class CNetClient m_NetClient[2];
class CDemoPlayer m_DemoPlayer; class CDemoPlayer m_DemoPlayer;
class CDemoRecorder m_DemoRecorder; class CDemoRecorder m_DemoRecorder;
class CServerBrowser m_ServerBrowser; class CServerBrowser m_ServerBrowser;