From d2b8fd735a109e68f00c6bec833083ce2acfdf46 Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 17 Aug 2008 20:06:39 +0000 Subject: [PATCH] fixed worldobjref virt destructor, fixed omitted server error response leaving the client in a vote-blocked state git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2333 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.cpp | 10 +++++----- source/src/sound.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/src/server.cpp b/source/src/server.cpp index 1f321b96..7a921aed 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1351,7 +1351,7 @@ void callvotesuc(voteinfo *v) void callvoteerr(voteinfo *v, int error) { - if(!v->isvalid()) return; + if(!valid_client(v->owner)) return; sendf(v->owner, 1, "ri2", SV_CALLVOTEERR, error); logger->writeline(log::info, "[%s] client %s failed to call a vote: %s (%s)", clients[v->owner]->hostname, clients[v->owner]->name, v->action->desc ? v->action->desc : "[unknown]", voteerrorstr(error)); } @@ -1370,9 +1370,9 @@ bool callvote(voteinfo *v, ENetPacket *msg) // true if a regular vote was called else if(clients[v->owner]->lastvotecall && servmillis - clients[v->owner]->lastvotecall < 60*1000 && clients[v->owner]->role != CR_ADMIN && numclients()>1) error = VOTEE_MAX; - if(error >= 0) - { - callvoteerr(v, error); + if(error>=0) + { + callvoteerr(v, error); return false; } else @@ -1599,7 +1599,7 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 } else if(mastermode==MM_PRIVATE) disconnect_client(sender, DISC_MASTERMODE); else if(nonlocalclients>maxclients) disconnect_client(sender, DISC_MAXCLIENTS); - else if(isbanned(sender)) disconnect_client(sender, DISC_MBAN); + else if(isbanned(sender)) disconnect_client(sender, DISC_BANREFUSE); else cl->isauthed = true; } if(!cl->isauthed) return; diff --git a/source/src/sound.cpp b/source/src/sound.cpp index f05e9600..6e77e573 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -398,7 +398,7 @@ struct worldobjreference int type; worldobjreference(int t) : type(t) {}; - ~worldobjreference() {}; + virtual ~worldobjreference() {}; virtual vec& currentposition() = 0; virtual bool nodistance() = 0; virtual bool operator==(const worldobjreference &other) = 0; @@ -1373,7 +1373,7 @@ void clearworldsounds() VAR(footsteps, 0, 1, 1); -int lastpitch = 1.0f; +float lastpitch = 1.0f; void updateplayerfootsteps(playerent *p, int sound) {