Register for your free account! | Forgot your password?

You last visited: Today at 02:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE]Real player counter with quest

Discussion on [RELEASE]Real player counter with quest within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
MT2SRV's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
Talking [RELEASE]Real player counter with quest

Hey there.
I would like you, then I say that his first work.

Quest and I wrote a database with the help of a simple quest

Is to find out exactly determine when a game is up

Code:
quest status begin
    state start begin
        when login begin
	local mysql_user = "mt2"
	local mysql_pw = "metin2"
	local player_id = tonumber(pc.get_player_id())
	local status = 1 
	local mysql_query = "UPDATE player.player SET status ="..status.." WHERE id = "..player_id..";"
	os.execute("mysql --host=localhost --user="..mysql_user.." --password="..mysql_pw.." --execute='"..mysql_query.."'")
	chat("Log In")
	end
		when logout begin
	local mysql_user = "mt2"
	local mysql_pw = "metin2"
	local player_id = tonumber(pc.get_player_id())
	local status = 0
	local mysql_query = "UPDATE player.player SET status ="..status.." WHERE id = "..player_id..";"
	os.execute("mysql --host=localhost --user="..mysql_user.." --password="..mysql_pw.." --execute='"..mysql_query.."'")
	chat("Log Out")
	end
    end
end

Oh, and to give the player the status of a table column named integer type

Sorry about Google Translate :S

Happy new year EPVP :3
MT2SRV is offline  
Thanks
4 Users
Old 01/03/2015, 06:04   #2
 
elite*gold: 0
Join Date: Aug 2014
Posts: 16
Received Thanks: 11
It can cause performance problems, because each time someone logins or logouts the quest executes a query.
*Denis* is offline  
Old 01/03/2015, 10:44   #3
 
elite*gold: 11
Join Date: Nov 2010
Posts: 1,709
Received Thanks: 3,828
The real player count is in the file db/usage.txt or you can fetch it with the web api like WoM does.

.Shōgun is offline  
Thanks
1 User
Old 01/03/2015, 12:58   #4
 
MT2SRV's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
Quote:
Originally Posted by .Shōgun View Post
The real player count is in the file db/usage.txt or you can fetch it with the web api like WoM does.


Problem is P2P ports ... :3

Quote:
Originally Posted by *Denis* View Post
It can cause performance problems, because each time someone logins or logouts the quest executes a query.

My VPS :

Ram : 4Gb
HDD :45Gb
CPU : 4 Cores
Mysql verzion : 5.5 + fastmx and full calibrate a vps.
MT2SRV is offline  
Old 01/03/2015, 13:53   #5
 
elite*gold: 11
Join Date: Nov 2010
Posts: 1,709
Received Thanks: 3,828
Quote:
Originally Posted by MT2SRV View Post
Problem is P2P ports ... :3
I don't understand what you mean. You have to set ADMINPAGE_IP and ADMINPAGE_PASSWORD to authenticate when using the Web API, that's all. And yeah your P2P must be working of course.
.Shōgun is offline  
Thanks
2 Users
Old 01/03/2015, 16:41   #6
 
Alergix2's Avatar
 
elite*gold: 103
Join Date: Aug 2014
Posts: 1,425
Received Thanks: 315
Nice very Usefull!
Alergix2 is offline  
Old 01/03/2015, 16:42   #7
 
clad3815's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 290
Received Thanks: 227
Quote:
Originally Posted by .Shōgun View Post
The real player count is in the file db/usage.txt or you can fetch it with the web api like WoM does.

You really need do promotion of your game on every post you do ? Not only you use this method.

If you use WEB API directly on your website without cache system, that is same than do a query
clad3815 is offline  
Old 01/03/2015, 17:02   #8
 
MT2SRV's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
I think just the quest basis

It's just an Update query is me .... I is extended with an INSERT INTO na and very hard to use SQL

But thank you, at least some people like it.

The problem is that many in Hungary is crippled, and I do not dare to P2P is at risk

Sory bad english :/
MT2SRV is offline  
Old 01/03/2015, 17:12   #9
 
Sanchez_x's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 33
Received Thanks: 106
Quote:
Originally Posted by clad3815 View Post
You really need do promotion of your game on every post you do ? Not only you use this method.

If you use WEB API directly on your website without cache system, that is same than do a query

The execution of USER_COUNT does not runs any query.
Sanchez_x is offline  
Old 01/03/2015, 17:25   #10
 
Tuora's Avatar
 
elite*gold: 0
Join Date: Jun 2014
Posts: 1,045
Received Thanks: 954
Usefull,thanks
Tuora is offline  
Old 01/03/2015, 17:27   #11
 
MT2SRV's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
Quote:
Originally Posted by Sanchez_x View Post
The execution of USER_COUNT does not runs any query.
It is absolutely true, but even P2P ... you know what you are crippled ... once you find out what the P2P port end ..: /

//////////////////////HU//////////
Teljesen igaz , de akkor is P2P ... tudod te is milyen nyomorékok vannak ... egyszer megtudja mi a P2P port akkor vége.. :/
MT2SRV is offline  
Old 01/03/2015, 20:02   #12
 
elite*gold: 26
Join Date: Oct 2011
Posts: 1,262
Received Thanks: 1,064
Quote:
Originally Posted by clad3815 View Post
You really need do promotion of your game on every post you do ? Not only you use this method.

If you use WEB API directly on your website without cache system, that is same than do a query

What is your problem?
Shogun did nothing wrong.
He pointed out that there is a better way to do this and mentioned an example (WOM).

Using the Web API is still more efficient than using a query directly to the database.
Another advantage is the higher accuracy. (last_play updates every 5m i think (?))

Yours faithfully,
Crysis
He3o Crysis is offline  
Thanks
1 User
Old 01/03/2015, 20:25   #13
 
MT2SRV's Avatar
 
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
Quote:
Originally Posted by .He3o Crysis View Post
What is your problem?
Shogun did nothing wrong.
He pointed out that there is a better way to do this and mentioned an example (WOM).

Using the Web API is still more efficient than using a query directly to the database.
Another advantage is the higher accuracy. (last_play updates every 5m i think (?))

Yours faithfully,
Crysis

\___________/ < Cry box :3

This is a solution that I showed you do not have reason to wage war : D
MT2SRV is offline  
Old 01/04/2015, 03:46   #14
 
Noa_'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 605
Received Thanks: 580
u can use flags to
Noa_ is offline  
Old 01/04/2015, 09:36   #15
 
elite*gold: 11
Join Date: Nov 2010
Posts: 1,709
Received Thanks: 3,828
Quote:
Originally Posted by .He3o Crysis View Post
What is your problem?
Shogun did nothing wrong.
He pointed out that there is a better way to do this and mentioned an example (WOM).
He works for sg, that's his problem.

Quote:
Originally Posted by .He3o Crysis View Post
Using the Web API is still more efficient than using a query directly to the database.
Another advantage is the higher accuracy. (last_play updates every 5m i think (?))

Yours faithfully,
Crysis
The last_play query just doesn't make any sense, but it gives a higher playercount than real (and you can stretch it even further by changing the interval) so most people don't really want to use the proper way. I see every day servers with less people than ours claiming to have 1000 or 2000 online at the same time.
.Shōgun is offline  
Reply


Similar Threads Similar Threads
[Quest-Release]Wartungsmodus Quest /Kick all Player/Spieler login nach Char..W. kick
04/02/2018 - Metin2 PServer Guides & Strategies - 30 Replies
Hallo da mir langweilig war und ich eine quest auf meinem PC gesehn habe durch diese eine Idee ausgelöst wurde Release ich nun die Idee falls public Sry -.- Ablauf Beim NPC Wartungsmodus aktivieren eine Zeit (minuten) angeben über 30.. alle 5 minuten wird ein notice all ausgegeben nach der angebenen Zeit werden alle Spieler gekickt und Und das Spielen Ingame gesperrt...



All times are GMT +2. The time now is 02:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.