Raised This Month: $ Target: $400
 0% 

Teamswitch Bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-19-2013 , 15:56   Teamswitch Bug
Reply With Quote #1

Hey, on our furienmod when we are 15+ people and teamchanges after win/defuse what ever
people always gets kicked with message "
Reliable Channel Overflowed



and this in log

PHP Code:
Errorserver failed to transmit file 'AY&SYg******************'
Last 32 messages parsed.
71886 0090 TeamInfo
71886 0103 TeamInfo
71886 0109 TeamInfo
71886 0122 TeamInfo
71886 0135 svc_updateuserinfo
71886 0322 svc_updateuserinfo
71886 0494 svc_updateuserinfo
71886 0648 svc_updateuserinfo
71886 0810 svc_updateuserinfo
71886 0994 svc_updateuserinfo
71886 1190 svc_updateuserinfo
71886 1365 svc_updateuserinfo
71886 1541 svc_updateuserinfo
71886 1713 svc_updateuserinfo
71886 1936 svc_updateuserinfo
71886 2101 svc_updateuserinfo
71886 2256 svc_updateuserinfo
71886 2417 svc_updateuserinfo
71886 2578 svc_updateuserinfo
71886 2739 svc_updateuserinfo
71886 2926 svc_updateuserinfo
71886 3122 svc_updateuserinfo
71886 3306 svc_updateuserinfo
71886 3493 svc_updateuserinfo
71886 3689 svc_time
71886 3694 svc_clientdata
71886 3702 svc_deltapacketentities
71886 3747 svc_temp_entity
71894 0008 CurWeapon
71894 0012 CurWeapon
71894 0016 svc_filetxferfailed
BAD
:   27:svc_bad
Host_Error
CL_ParseServerMessageIllegible server message svc_bad 
Teamchange code:
PHP Code:
new iPlayers[32], iNumid
    get_players
(iPlayersiNum"h")

    for(new 
ii<iNumi++)
    {
        
id iPlayers[i]
        switch( 
get_pdata_int(idOFFSET_TEAMXTRA_OFS_PLAYERS) )
        {
            case 
TEAM_T:
            {
                
set_pdata_int(idOFFSET_TEAMTEAM_CTXTRA_OFS_PLAYERS)
            }
            case 
TEAM_CT:
            {
                
set_pdata_int(idOFFSET_TEAMTEAM_TXTRA_OFS_PLAYERS)
            }
        }
    } 
EDIT: Btw we also use alot of models which they get at spawn like, nade models, weapon models, skin models, 2 different knife models if they move and dont move, maybe it overflows cause of too many models?

Last edited by UchihaSkills; 07-19-2013 at 16:56.
UchihaSkills is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-19-2013 , 17:16   Re: TeamChange bug, please help
Reply With Quote #2

Try this and tell me :

PHP Code:
    new players[32], numid;
    
get_players(playersnum"h");

    new 
count;
    for(--
numnum>=0num--)
    {
        
id players[num];
        switch( 
get_pdata_int(idm_iTeam) )
        {
            case 
TEAM_T:
            {
                
set_pdata_int(idm_iTeamTEAM_CT);
                if( ++
count 20 )
                {
                    
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));
                }
            }
            case 
TEAM_CT:
            {
                
set_pdata_int(idm_iTeamTEAM_T);
                if( ++
count 20 )
                {
                    
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));
                }
            }
        }
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-19-2013 , 17:17   Re: TeamChange bug, please help
Reply With Quote #3

I will try it right now, can i also try it with BOTS now? cause we cant get over 16 players now.
UchihaSkills is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-19-2013 , 17:20   Re: TeamChange bug, please help
Reply With Quote #4

Dunno, i've tested with 31 bots, had crashes with previous code at 23 players, but no kicks.
With actual code; i have no crashes, so would be better if you could test with real players.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-19-2013 , 17:22   Re: TeamChange bug, please help
Reply With Quote #5

Ok thx, we will test with bots now and tomorrow with Players, i will reply later or tomorrow if it works. and btw, Why does this bug in the code i use now appears?
UchihaSkills is offline
Old 07-19-2013, 18:47
ConnorMcLeod
This message has been deleted by ConnorMcLeod. Reason: wrong code
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-19-2013 , 19:23   Re: TeamChange bug, please help
Reply With Quote #6

I get this error Connor
error 017: undefined symbol "m_iModelName"
UchihaSkills is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-19-2013 , 19:51   Re: TeamChange bug, please help
Reply With Quote #7

Use m_iInternalModel instead.

And try that one :

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < cstrike >

#pragma semicolon 1

#define PLUGIN ""
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

const m_iTeam 114;
const 
m_iModelName 126;

enum _:teamIndexes
{
    
TEAM_UNASSIGNED 0,
    
TEAM_TERRORIST 1,
    
TEAM_CT 2,
    
TEAM_SPECTATOR 3
};

enum _:playerModelIndexes
{
    
CLASS_UNASSIGNED 0,
    
CLASS_URBAN 1,
    
CLASS_TERROR 2,
    
CLASS_LEET 3,
    
CLASS_ARCTIC 4,
    
CLASS_GSG9 5,
    
CLASS_GIGN 6,
    
CLASS_SAS 7,
    
CLASS_GUERILLA 8,
    
CLASS_VIP 9,
    
CLASS_MILITIA 10,
    
CLASS_SPETSNAZ 11
};

new 
g_iTeamModels[][] = 
{
    {
CLASS_TERRORCLASS_LEETCLASS_ARCTICCLASS_GUERILLACLASS_MILITIA},
    {
CLASS_URBANCLASS_GSG9CLASS_GIGNCLASS_SASCLASS_SPETSNAZ}
};

// new g_szTeamModels[][][] = 
// {
    // {"terror", "leet", "arctic", "guerilla", "militia"},
    // {"urban", "gsg9", "gign", "sas", "spetsnaz"}
// };

new g_iMaxModels 4;

new 
gmsgTeamInfo;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
register_logevent("Event_Round_End"2"1=Round_End");

    
gmsgTeamInfo get_user_msgid("TeamInfo");

    if( 
is_running("czero") )
    {
        
g_iMaxModels 5;
    }
}

public 
Event_Round_End()
{
    new 
players[32], numid;
    
get_players(playersnum"h");

    new 
count;
    for(--
numnum>=0num--)
    {
        
id players[num];
        switch( 
get_pdata_int(idm_iTeam) )
        {
            case 
TEAM_TERRORIST:
            {
                if( ++
count )
                {
                    
cs_set_user_team(idTEAM_CTg_iTeamModels[1][random(g_iMaxModels)]);
                }
                else
                {
                    
set_pdata_int(idm_iTeamTEAM_CT);
                    
set_pdata_int(idm_iModelNameg_iTeamModels[1][random(g_iMaxModels)]);
                    
set_task(0.1"SetPlayerModel"id);

                    
message_begin(MSG_ALLgmsgTeamInfo);
                    
write_byte(id);
                    
write_string("CT");
                    
message_end();
                }
            }
            case 
TEAM_CT:
            {
                if( ++
count )
                {
                    
cs_set_user_team(idTEAM_TERRORISTg_iTeamModels[0][random(g_iMaxModels)]);
                }
                else
                {
                    
set_pdata_int(idm_iTeamTEAM_TERRORIST);
                    
set_pdata_int(idm_iModelNameg_iTeamModels[0][random(g_iMaxModels)]);
                    
set_task(0.1"SetPlayerModel"id);
                    
                    
message_begin(MSG_ALLgmsgTeamInfo);
                    
write_byte(id);
                    
write_string("TERRORIST");
                    
message_end();
                }
            }
        }
    }
}

public 
SetPlayerModel(id)
{
    if( 
is_user_connected(id) )
    {
        
dllfunc(DLLFunc_ClientUserInfoChangedidengfunc(EngFunc_GetInfoKeyBufferid));
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-19-2013 at 20:43.
ConnorMcLeod is offline
UchihaSkills
Senior Member
Join Date: May 2013
Location: Germany
Old 07-19-2013 , 21:16   Re: TeamChange bug, please help
Reply With Quote #8

Hey Connor, we tested it and it works fine .
Why is your code working and the old not? Where was the bug?
And big thanks to you conor you really helped us alot
i changed the thread name to xxxxxxx by mistake sorry

Last edited by UchihaSkills; 07-19-2013 at 21:40.
UchihaSkills is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-19-2013 , 21:19   Re: TeamChange bug, please help
Reply With Quote #9

Thanks Connor for that piece, ill surely use that some day!
I have one question: Can you say that in the aspect of Server/Plugins a bot is the same as a player? Ive testet your Code with 31 Bots and it worked fine. Do you think it would also work fine with normal players instead of bots?
mottzi is offline
Send a message via MSN to mottzi
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-20-2013 , 05:11   Re: Teamswitch Bug
Reply With Quote #10

No, podbots (dunno for csbots) are setting their model (using set_user_info "model") before the 0.1 task has been executed, but in fine result is the same with that code.

cs_set_user_team is sending userinfochange (that sends set_user_info "model"), so half of players are proceeded like this, the other half is proceeded either on next frame or something like that for podbots, either when task is executed.

]UchihaSkills
In old code, "model" was updated on next frame for bots, and at spawn (new round) for players, so all at same time for bots and all at same time for players, result was that when there are too many bots, or too many players, server was crashing or players were kicked, at round end if too many bots, or at new round if too many players.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-20-2013 at 05:14.
ConnorMcLeod 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 06:32.


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