AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [Help] Use one sqlite with two gameservers.. (https://forums.alliedmods.net/showthread.php?t=240902)

TheWho 05-24-2014 09:52

[Help] Use one sqlite with two gameservers..
 
Hello,

I want to use one sql located in addons/sourcemod/data/sqlite for another Server too.

How do i realize it?

I know some of you hate sqlite but if I would use mysql it would be laggy as hell, and delayed as much possible, cuz I have no clear mysql code and I have to save every second a for loop of players. So I use sqlite and it is okay.

ecca 05-24-2014 09:59

Re: [Help] Use one sqlite with two gameservers..
 
Use mysql and threaded queryes , this will not cause any lags. For an answer to the topic you could try to link the file , but i recommend mysql for sharing.

TheWho 05-24-2014 10:08

Re: [Help] Use one sqlite with two gameservers..
 
So with threaded queryes I could update every seconds the players row in the db?

SQL_TConnect is for the threaded querieing and SQL_Connect for the real time querieing?

ecca 05-24-2014 10:26

Re: [Help] Use one sqlite with two gameservers..
 
Threaded queryes could also be used for realtime updating.

https://wiki.alliedmods.net/SQL_(Sou...ing)#Threading

There are info you could read

TheWho 05-24-2014 10:35

Re: [Help] Use one sqlite with two gameservers..
 
Yes thank you I already read it.

Do I really need that in my callback if I check before the SQL_TQuery if the client is Valid..
PHP Code:

public T_CheckSteamID(Handle:ownerHandle:hndl, const String:error[], any:data)
{
    new 
client;
 
    
/* Make sure the client didn't disconnect while the thread was running */
    
if ((client GetClientOfUserId(data)) == 0)
    {
        return;
    }
 
    if (
hndl == INVALID_HANDLE)
    {
        
LogError("Query failed! %s"error);
        
KickClient(client"Authorization failed");
    } else if (!
SQL_GetRowCount(hndl)) {
        
KickClient(client"You are not a member");
    }


Because at the moment I only use a empty callback.

xf117 05-24-2014 10:40

Re: [Help] Use one sqlite with two gameservers..
 
It is not about real time. It is about waiting for response from database. If you want multiple clients, use MySQL.
But you can, if you want use SqLite. You will probably going to stuck with locks.

TheWho 05-24-2014 10:50

Re: [Help] Use one sqlite with two gameservers..
 
Yes I know, one lock is the thread title ^^
But I tought I would never need to connect from another Server but now I need it,
and I will change to MySQL and give it a chance again. And then I "unlock" me the
ability to create a table on my webpage with the database, that would be nice too now.
Anyways thanks.


All times are GMT -4. The time now is 18:30.

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