Raised This Month: $32 Target: $400
 8% 

SetListenOverride Issues


Post New Thread Reply   
 
Thread Tools Display Modes
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 02-02-2011 , 19:25   Re: SetListenOverride Issues
Reply With Quote #11

Not meant personal but wow that code is bad.


Why on earth use a IsConnected global array when IsClientConnected checks the game internal array.

Why is the update timer on 0.1 seconds, is that for a high velocity glide map

There is multiple redundancies, like, you loop from 1 to MaxClients, only to check if its > 0 and < MaxClients in the next function

You dont need to check if a client is a valid edict

You dont need to check Conncted, InGame, and Authorized all ... Ingame is entirely enough
AtomicStryker is offline
BAILOPAN
Join Date: Jan 2004
Old 02-02-2011 , 19:29   Re: SetListenOverride Issues
Reply With Quote #12

kossolax: I'd address AtomicStryker's comments - they're spot on. But either way, what OS are you crashing on? If it's Windows, please send a .mdmp to [email protected]. If it's Linux, do you have shell access?
__________________
egg
BAILOPAN is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 02-02-2011 , 19:57   Re: SetListenOverride Issues
Reply With Quote #13

Fyren, sorry, that came out wrong.. the client-side mute code is good, I just meant that it didn't seem relevant to the problem we're having. We can ignore it since no plugins use the client-side mute discovery to do anything AFAIK.

I couldn't have coded the voice.cpp, just drawing parallels to mani which I know has a functioning dead all talk system. The major differences seemed the time and manner in which VoiceServer was hooked and the ClientDisconnect code.

The Dead All Talk plugins and 'proximity talk' plugins that have been attempted all have these symptoms:
http://forums.alliedmods.net/showthread.php?p=673586
and my attempt
http://forums.alliedmods.net/showthread.php?t=148069

Use the plugin on a server with more than 7 players and wait sometimes 45 minutes and the VoiceServer seems to unhook and no future over-rides are processed. I'm running a linux box with shell access and would love to know if there's anyway I can debug this further because, as was already stated, we don't see any errors in the logs.
databomb is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-02-2011 , 20:18   Re: SetListenOverride Issues
Reply With Quote #14

To be more clear the issue is also present on windows the plugin I made is attached to this post and I have yet to get any errors despite having the same issue of it randomly breaking.
Attached Files
File Type: sp Get Plugin or Get Source (teamtalk.sp - 226 views - 6.5 KB)
__________________
zeroibis is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 02-03-2011 , 01:06   Re: SetListenOverride Issues
Reply With Quote #15

Quote:
Originally Posted by BAILOPAN View Post
kossolax: I'd address AtomicStryker's comments - they're spot on. But either way, what OS are you crashing on? If it's Windows, please send a .mdmp to [email protected]. If it's Linux, do you have shell access?

I'm on linux ubuntu 10.4, and I have shell acces. But server is not crashing, so I don't know if there is a crash somewhere.


Quote:
Originally Posted by AtomicStryker View Post
Why on earth use a IsConnected global array when IsClientConnected checks the game internal array.
That code was a fix attemp to be sure the player is really in game, to edit the listen flag.
Quote:
Originally Posted by AtomicStryker View Post
There is multiple redundancies, like, you loop from 1 to MaxClients, only to check if its > 0 and < MaxClients in the next function
I usually use the IsValidClient from a personnal include, so I haven't check it about that
Quote:
Originally Posted by AtomicStryker View Post
You dont need to check if a client is a valid edict
You dont need to check Conncted, InGame, and Authorized all ... Ingame is entirely enough
I've added much check to prevent crash, but I didn't know about that, thanks.

Last edited by kossolax; 02-03-2011 at 01:26.
kossolax is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 02-03-2011 , 04:29   Re: SetListenOverride Issues
Reply With Quote #16

Here, look at this.

I've used SetListenOverride in Snaretalk Plugins and never experienced any crashes with it. I think your brutal 0.1 timer simply overloaded the engine after a time.


PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

const Float:CHECK_INTERVAL    1.0;
const 
Float:MAX_AREA_DIST     500.0;

public 
OnPluginStart()
{
    
CreateTimer(CHECK_INTERVALTimer_UpdateListeners_TIMER_REPEAT);
}

public 
Action:Timer_UpdateListeners(Handle:timer)
{
    for (new 
client 1client <= MaxClientsclient++)
    {
        if(!
IsClientInGame(client)
        || 
IsFakeClient(client))
        {
            continue;
        }
        
        
IsPlayerAlive(client) ? check_area(client) : check_dead(client);
    }
}

static 
check_area(client)
{
    
decl Float:originA[3], Float:originB[3];

    for (new 
1<= MaxClientsi++)
    {
        if(
== client
        
|| !IsClientInGame(i)
        || 
IsFakeClient(i))
        {
            continue;
        }
        
        
GetClientAbsOrigin(clientoriginA);
        
GetClientAbsOrigin(ioriginB);
        
        if(
IsPlayerAlive(i)
        && 
GetVectorDistance(originAoriginB) < MAX_AREA_DIST)
        {    
//In Range
            
SetListenOverride(clientiListen_Yes);
        }
        else
        {    
//Out of Range or Dead
            
SetListenOverride(clientiListen_No);
        }
    }
}

static 
check_dead(client)
{
    for (new 
1<= MaxClientsi++)
    {
        if(
== client
        
|| !IsClientInGame(i)
        || 
IsFakeClient(i))
        {
            continue;
        }
        
        
SetListenOverride(clientiListen_No);
    }

AtomicStryker is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 02-03-2011 , 06:12   Re: SetListenOverride Issues
Reply With Quote #17

I've already tried to change. But it has no effect, still crash.
Even with 2.5, or 5.0 Interval.

It doesn't even changing how often it crash.
kossolax is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 02-03-2011 , 11:06   Re: SetListenOverride Issues
Reply With Quote #18

zeroibis and myself don't use timers and we experience the VoiceServer error. When kossolax said "crashing" earlier, he just means that VoiceServer no longer works. (Overrides and client listen flags (even mutes) no longer function.) Atomic, I've looked over the snaretalk plugins. As I've said already, a plugin with a *small* number of over-rides such as this or Admin Setinel seem to work. When you start doing over-rides in for loops for all clients on spawn and death (or in timers), the VoiceServer becomes inoperable after some time.
databomb is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 02-03-2011 , 11:11   Re: SetListenOverride Issues
Reply With Quote #19

To add info, VoiceServer, as you tell it, has a problem in Source-Mod side.

If you set : sv_voiceenable 0: Voice are fully mutted.
If you set back to 1, SetListenOverride still not working correctly.
kossolax is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-03-2011 , 15:54   Re: SetListenOverride Issues
Reply With Quote #20

Correct, regardless of the method used between any of out plugins. It randomly stops working after some time without producing any errors or crashing. My print outs still occur so I know as a fact that the mod is running and functioning correctly. It is the SetLIstenOverride command that stops working.

This as stated previously IS a problem with SOURCEMOD. While we can help to try to pinpoint it the issue can really only be solved by the SOURCEMOD developers. Hopefully we can attract their attention and get to the bottom of this.
__________________
zeroibis is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode