AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin doesn't work properly under linux (https://forums.alliedmods.net/showthread.php?t=187894)

Backstabnoob 06-19-2012 11:53

Plugin doesn't work properly under linux
 
1 Attachment(s)
I don't have a clue where the problem is. This code works perfectly fine under Windows but on linux:

1) When selecting a value from the menu that is to get a weapon (ak47/m4a1 and deagle in the secondary menu, handler is _Show[Prim|Sec]MenuHandler, the selected key is 1 or 3), the existing doesn't get destroyed with ham function StripWeapons( )

2) When selecting a value from the menu that is to get a weapon and save the menu state (which is to get a weapon automatically or do not without showing the menu next rounds), the server crashes

amxx logs are empty.

Both 1 and 2 work under Windows flawlessly.

Uses custom API but I think it's not needed now. If it is, just tell me and I'll update the post.

PHP Code:



#pragma library "aivip_func"


/* FUNKCE AiVIP software */



/* KONSTANTY, NUMERICKE PREVODY (ENUM) */

enum AiVIP_ReturnTypes
{
    
AiVIP_Success,
    
AiVIP_Failure
}




/* NATIVNI FUNKCE */


#define DEF_PREFIX    1
#define DEF_MAXPLAYERS    2
#define DEF_DBPREFIX    3

native ReturnTypesAiVIP_GetDefinitionValue( const def, const where[], const maxlength )


/*
client : ID klienta ( 1 <= client <= 32 )
key : Trie key

vraci pouze urcity klic z Trie, pouziti podobne jako v predchozim prikladu. Efektivni pouze pro ziskavani jednoho key handleru,
chcete-li ziskat vice nez jeden, pouzijte predchozi funkci a pote pouzijte TrieGetString( )

new Key[ 2 ]
AiVIP_GetConnectionData( id, "admin", Key, 1 )

new Admin = str_to_num( Key )

if( Admin )
  // hrac je admin v AiVIP systemu

*/

native ReturnTypesAiVIP_GetConnectionData( const client, const key[], const where[], maxlength )


/*
vraci SQL handler z jadra, neni tudiz nutne pripojovat se k databazi znovu; jedine reseni, ktere byste meli pouzivat
Doporucene pouziti v plugin_cfg( )

POUZITI:

new Handle: g_SqlHandle

public plugin_cfg( )
{
    g_SqlHandle = AiVIP_ShareSqlHandle( )
    
    SQL_ThreadQuery( g_SqlHandle, ... )
    
}

*/

native HandleAiVIP_ShareSqlHandle( )


/*

client: ID klienta ( 1 <= client <= 32 )


aktualizuje informace v Trie data handleru uzivatele
POUZITI:

new AiVIP_ReturnTypes: Status = AiVIP_RefreshTrieData( id )

if( Status == AiVIP_Success )
 // data hrace s id 'id' byla aktualizovana
 
NEBO:

new const MAX_PLAYERS = 32
new AiVIP_ReturnTypes: Status

for( new i = 1; i <= MAX_PLAYERS; i ++ )
    if( is_user_connected( i ) )
    {
        Status = AiVIP_RefreshTrieData( i )
        
        if( Status == AiVIP_Failure )
            // zalogujeme chybu a prerusime funkci pluginu, aby byla diagnostika jednodussi
            AiVIP_HandleLastError( true )
    }
 

*/

native AiVIP_ReturnTypesAiVIP_RefreshTrieData( const client )


/*

SetFailState (BOOL) : vypnout plugin pomoci set_fail_state ( chyba ) TRUE/FALSE

zobrazi posledni zachycenou chybu
pouziti v prikladu u funkce AiVIP_GetConnectionData() (druhy priklad)



*/

native ReturnTypesAiVIP_HandleLastErrorwhere512 ], const boolSetFailState false )


/*
client : ID klienta ( 1 <= client <= 32 )
UNIQUE_STRING:    unikatni stringu serveru tak, jak je v administraci; ponechejte zakladni hodnotu ('^0') pro automaticke zjisteni serveru
        na kterem je plugin spusten

Vrati timestamp, do kdy je VIP platne. 

POUZITI:

new Time = AiVIP_GetUserVipStatus( id )

if( Time > get_systime() || Time == -1 )
 // hrac ma vip aktivovano ( Time == -1 je nutne; hraci s neomezenou platnosti VIP maji prirazeno -1 )

*/
native AiVIP_GetUserVipStatus( const client, const UNIQUE_STRING[] = '^0' )


/*
client : ID klienta ( 1 <= klient <= 32 )
UNIQUE_STRING:    unikatni stringu serveru tak, jak je v administraci; ponechejte zakladni hodnotu ('^0') pro automaticke zjisteni serveru
        na kterem je plugin spusten
time : cas v sekundach od Unix Epochu, takzvany Timestamp; ponechejte -1 pro nastaveni na neomezenou dobu
Save : Pokud je true, hodnota se ulozi do databaze; je-li ponechano false, bude platit pouze do prenacteni Trie bud reconnectem nebo funkci

Nastavi cas do vyprseni VIP hrace. Lze nastavit i u hrace, ktery nema VIP aktivovano. -1 nastavi cas na neomezeny.

POUZITI: 

new AiVIP_ReturnTypes: SetTime = AiVIP_SetUserVipStatus( id, _, 1292177532 )

if( SetTime == AiVIP_Success )
  // VIP hrace bylo uspesne zmeneno, 1292177532 znamena, ze vyprsi dne 12 / 12 / 2012 12:12:12

  
*/

native AiVIP_ReturnTypesAiVIP_SetUserVipStatus( const client, const UNIQUE_STRING[] = '^0', const time = -1, const boolSave false )


/*
client: ID klienta ( 1 <= klient <= 32 )

Vraci, jestli je klient pripojeny (bool true/false)

POUZITI:

new bool: IsLogged = AiVIP_IsUserLogged( id )

if( IsLogged )
 // uzivatel je prihlaseny ve hre
 
*/

native boolAiVIP_IsUserLogged( const client )


/* FORWARDY */


/*
client: ID klienta ( 1 <= klient <= 32 )

Vola se v momente, kdy je uzivatel schvalen AiVIP systemem

POUZITI:


public AiVIP_OnLoginHook( id )
    // uzivatel 'id' se prave prihlasel do systemu (automaticky nebo manualne)
    
*/


forward AiVIP_OnLoginHookclient 

The code is in czech but only the hardcoded strings. If something needs explanation or wants me to translate the code overally, I'll be glad to do so. Same goes for the natives.

fysiks 06-19-2012 19:01

Re: Plugin doesn't work properly under linux
 
And everything except OS specific files are identical?

Backstabnoob 06-20-2012 05:59

Re: Plugin doesn't work properly under linux
 
What do you mean?

fysiks 06-20-2012 19:19

Re: Plugin doesn't work properly under linux
 
Quote:

Originally Posted by Backstabnoob (Post 1732270)
What do you mean?

Modules, plugins, resources, etc. You can't always blame one plugin if you don't have at least a very similar other things running. It's a debugging thing.

I really don't know if it will solve anything but that's something that I would consider. It's extremely unlike that a plugin only works on one OS and not the other.

claudiuhks 06-20-2012 19:34

Re: Plugin doesn't work properly under linux
 
I think you really have to use FakeMeta or Fun instead of HamSandwich...

fysiks 06-21-2012 18:32

Re: Plugin doesn't work properly under linux
 
Quote:

Originally Posted by claudiuhks (Post 1732876)
I think you really have to use FakeMeta or Fun instead of HamSandwich...

HamSandwich works perfectly fine on Linux.

Backstabnoob 06-22-2012 06:30

Re: Plugin doesn't work properly under linux
 
I'm going to check the modules on the Linux server. I'll also compare the versions of each module and AMXX itself. Pretty weird though, closing the menu with not showing it again next round doesn't do anything but unset a simple global variable. Even more weird is it doesn't log a single error.


All times are GMT -4. The time now is 06:16.

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