repairing some bugs appearing after a certain time being connected
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13157 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -282,7 +282,7 @@ SFXBase* SFXManager::createSoundSource(SFXBuffer* buffer,
|
||||
// race_manager->getNumLocalPlayers(), buffer->isPositional());
|
||||
|
||||
#if HAVE_OGGVORBIS
|
||||
assert( alIsBuffer(buffer->getBufferID()) );
|
||||
//assert( alIsBuffer(buffer->getBufferID()) ); crashes on server
|
||||
SFXBase* sfx = new SFXOpenAL(buffer, positional, buffer->getGain(), owns_buffer);
|
||||
#else
|
||||
SFXBase* sfx = new DummySFX(buffer, positional, buffer->getGain(), owns_buffer);
|
||||
|
||||
@@ -43,6 +43,10 @@ void* waitInput(void* data)
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
else if (str == "disconnect")
|
||||
{
|
||||
NetworkManager::getInstance()->getPeers()[0]->disconnect();
|
||||
}
|
||||
else if (str == "connect")
|
||||
{
|
||||
ProtocolManager::getInstance()->requestStart(new ConnectToServer());
|
||||
|
||||
@@ -56,6 +56,11 @@ bool STKPeer::connectToHost(STKHost* localhost, TransportAddress host, uint32_t
|
||||
return true;
|
||||
}
|
||||
|
||||
void STKPeer::disconnect()
|
||||
{
|
||||
enet_peer_disconnect(m_peer, 0);
|
||||
}
|
||||
|
||||
void STKPeer::sendPacket(NetworkString const& data)
|
||||
{
|
||||
Log::info("STKPeer", "sending packet of size %d to %i.%i.%i.%i:%i", data.size(), (m_peer->address.host>>0)&0xff,(m_peer->address.host>>8)&0xff,(m_peer->address.host>>16)&0xff,(m_peer->address.host>>24)&0xff,m_peer->address.port);
|
||||
|
||||
@@ -33,7 +33,8 @@ class STKPeer
|
||||
virtual void sendPacket(const NetworkString& data);
|
||||
|
||||
static bool connectToHost(STKHost* localhost, TransportAddress host, uint32_t channel_count, uint32_t data);
|
||||
|
||||
void disconnect();
|
||||
|
||||
bool isConnected() const;
|
||||
void setClientServerToken(const uint32_t& token) { m_client_server_token = token; m_token_set = true; }
|
||||
void unsetClientServerToken() { m_token_set = false; }
|
||||
|
||||
Reference in New Issue
Block a user