|
You last visited: Today at 02:20
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.
01/03/2015, 03:01
|
#1
|
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
|
[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
|
|
|
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.
|
|
|
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.
|
|
|
01/03/2015, 12:58
|
#4
|
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
|
Quote:
Originally Posted by .Shōgun
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*
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.
|
|
|
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
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.
|
|
|
01/03/2015, 16:41
|
#6
|
elite*gold: 103
Join Date: Aug 2014
Posts: 1,425
Received Thanks: 315
|
Nice very Usefull!
|
|
|
01/03/2015, 16:42
|
#7
|
elite*gold: 0
Join Date: Feb 2009
Posts: 290
Received Thanks: 227
|
Quote:
Originally Posted by .Shōgun
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
|
|
|
01/03/2015, 17:02
|
#8
|
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 :/
|
|
|
01/03/2015, 17:12
|
#9
|
elite*gold: 0
Join Date: Jul 2013
Posts: 33
Received Thanks: 106
|
Quote:
Originally Posted by clad3815
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.
|
|
|
01/03/2015, 17:25
|
#10
|
elite*gold: 0
Join Date: Jun 2014
Posts: 1,045
Received Thanks: 954
|
Usefull,thanks
|
|
|
01/03/2015, 17:27
|
#11
|
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
|
Quote:
Originally Posted by Sanchez_x
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.. :/
|
|
|
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
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
|
|
|
01/03/2015, 20:25
|
#13
|
elite*gold: 0
Join Date: Jan 2015
Posts: 8
Received Thanks: 4
|
Quote:
Originally Posted by .He3o Crysis
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
|
|
|
01/04/2015, 03:46
|
#14
|
elite*gold: 0
Join Date: May 2013
Posts: 605
Received Thanks: 580
|
u can use flags to
PHP Code:
quest status begin state start begin when login begin local current = game.get_event_flag("cur") game.set_event_flag("cur",current+1) end when logout or disconnect begin local current = game.get_event_flag("cur") game.set_event_flag("cur",current-1) end end end
|
|
|
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
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
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.
|
|
|
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.
|
|