Raised This Month: $12 Target: $400
 3% 

[Help] Use one sqlite with two gameservers..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-24-2014 , 09:52   [Help] Use one sqlite with two gameservers..
Reply With Quote #1

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.
TheWho is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-24-2014 , 09:59   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #2

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.
__________________

Last edited by ecca; 05-24-2014 at 09:59.
ecca is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-24-2014 , 10:08   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #3

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?

Last edited by TheWho; 05-24-2014 at 10:13.
TheWho is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-24-2014 , 10:26   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #4

Threaded queryes could also be used for realtime updating.

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

There are info you could read
__________________
ecca is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-24-2014 , 10:35   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #5

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.

Last edited by TheWho; 05-24-2014 at 10:36.
TheWho is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 05-24-2014 , 10:40   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #6

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.
xf117 is offline
Send a message via ICQ to xf117
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-24-2014 , 10:50   Re: [Help] Use one sqlite with two gameservers..
Reply With Quote #7

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.
TheWho 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 08:48.


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