AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Engine invalid player (https://forums.alliedmods.net/showthread.php?t=276301)

Netsys 12-19-2015 00:30

Engine invalid player
 
What's the problem? I check if the player is connected and alive, but i have the error. This happens sometimes when a player crash with some kind of error keeps on timeout un the server anda then disconnects

PHP Code:

L 12/19/2015 02:13:03: [ENGINEInvalid player 2 (not in-game)
L 12/19/2015 02:13:03: [AMXXDisplaying debug trace (plugin "semiclip.amxx"version "0.7")
L 12/19/2015 02:13:03: [AMXXRun time error 10native error (native "entity_range")
L 12/19/2015 02:13:03: [AMXX]    [0semiclip.sma::thinkSemiclip (line 3803

PHP Code:

/* Bits Management */
#define setBit(%1,%2)                             (%1 |= (1<<(%2 & 31)))
#define getBit(%1,%2)                             (%1 & (1<<(%2 & 31)))
#define delBit(%1,%2)                             (%1 &= ~(1<<(%2 & 31)))

#define is_user_valid_alive(%1)                 ((1 <= %1 <= MaxClients) && getBit(g_iPlayerBits[%1], bPlayerIsConnected) && getBit(g_iPlayerBits[%1], bPlayerIsAlive))


public client_putinserveriPlayerID )
{
    
/* Reset bits */
    
g_iPlayerBits[iPlayerID] = 0;

    
/* Set the default bits value */
    
setBit(g_iPlayerBits[iPlayerID], bPlayerIsConnected);
}

public 
client_disconnectediPlayerID )
{
    
/* Reset the bits */
    
g_iPlayerBits[iPlayerID] = 0;
}

/* Ham Player Spawn Post Forward */
public fw_PlayerSpawn_Post( const iPlayerID )
{
    
/* Not alive or didn't join a team yet */
    
if (!is_user_alive(iPlayerID) || !get_user_team(iPlayerID))
        return;

    
/* Update bits */
    
setBit(g_iPlayerBits[iPlayerID], bPlayerIsAlive);
}

/* Ham Player Killed Forward */
public fw_PlayerKilled( const iVictimID, const iAttackerID, const iShouldgib )
{
    
/* Update bits */
    
delBit(g_iPlayerBits[iVictimID], bPlayerIsAlive);
}

public 
thinkSemiclip( const iEntityID )
{
    static 
iTargetIDiDistance;
    
    for (
iPlayerID 1iPlayerID MaxClientsiPlayerID++)
    {
        if (!
is_user_valid_alive(iPlayerID)) continue;
        
        for (
iTargetID iPlayerID 1iTargetID <= MaxClientsiTargetID++)
        {
            if (!
is_user_valid_alive(iTargetID)) continue;
            
            
/* Get the distance between the players */
            
iDistance floatround(entity_range(iPlayerIDiTargetID)); // This line

            
g_iPlayerRange[iPlayerID][iTargetID] = ((iDistance <= 250) ? iDistance : -1);
            
g_iPlayerRange[iTargetID][iPlayerID] = g_iPlayerRange[iPlayerID][iTargetID];
        }
    }

    
entity_set_float(iEntityIDEV_FL_nextthinkget_gametime() + 0.1);



Chihuahuax 12-19-2015 03:42

Re: Engine invalid player
 
PHP Code:

((iDistance <= 250) ? iDistance : -1); 

-->
PHP Code:

((iDistance <= 250.0) ? iDistance : -1.0); 


Arkshine 12-19-2015 06:08

Re: Engine invalid player
 
Are you sure you don't have error in log about client_disconnected? Normal log. If you don't have the gamedatas or for some reason some signatures/symbols could not be found, it will say it in log.

PartialCloning 12-19-2015 06:54

Re: Engine invalid player
 
Your #define is_user_valid_alive(%1) doesn't do anything special, it just checks if the user is a player, alive and connected.

1. You can't be alive if you're not connected.
2. It doesn't really matter because you then go on and loop through all the players.

A better solution is to use http://www.amxmodx.org/api/amxmodx/get_players

You should check out the other semiclip plugins as yours might be glitchy with that 0.1 sec check. There is also a semiclip module or two around.

Netsys 12-19-2015 14:43

Re: Engine invalid player
 
Quote:

Originally Posted by Arkshine (Post 2373908)
Are you sure you don't have error in log about client_disconnected? Normal log. If you don't have the gamedatas or for some reason some signatures/symbols could not be found, it will say it in log.

This happend 1 or 2 times per day.

PHP Code:

L 12/19/2015 02:13:03"Monkey D. Lucho<10><STEAM_0:0:38848036><TERRORIST>" disconnected
186.19.66.223
:27005:reconnect
L 12
/19/2015 02:13:03"Monkey D. Lucho<19><STEAM_0:0:38848036><>" connectedaddress "186.19.66.223:27005"
L 12/19/2015 02:13:03: [ENGINEInvalid player 2 (not in-game)
L 12/19/2015 02:13:03: [AMXXDisplaying debug trace (plugin "semiclip.amxx"version "0.7")
L 12/19/2015 02:13:03: [AMXXRun time error 10native error (native "entity_range")
L 12/19/2015 02:13:03: [AMXX]    [0semiclip.sma::thinkSemiclip (line 3803)
L 12/19/2015 02:13:03: [client_disconnectedPlayer"Monkey D. Lucho" (UserID19

HLDS 6153
Metamod v1.21p37
AMX Mod X 1.8.3-dev+4968

Arkshine 12-19-2015 17:37

Re: Engine invalid player
 
Do you have only that in the log? Nothing more complete? What happens after client_disconnected?

How is registered thinkSemiclip? Can you show more code, please, if you don't want to post, feel free to PM me.

Is your server a 32 slot? If so, does it happen always with the 31th player or something?

Since you're using client_disconnected, you can have 2 params you can output as well (https://github.com/alliedmodders/amx...xmodx.inc#L180)
You could also type "meta_debug 3" in your server console (or server.cfg, but make sure it's applied) to get some debug log for knowing which engine functions are called.
It would likely help if you could put some temporary debug for others forards like client_connect/authorized/putinserver/disconnect.

There is something weird happening. Like error happens because AMXX considers internally you are no more "in-game", but AMXX updated such state only when a player disconnects. Though here, disconnected seems to happen after, so it's quite confusing.

Arkshine 12-23-2015 09:33

Re: Engine invalid player
 
No news?


All times are GMT -4. The time now is 17:51.

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