Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 23:32

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

Advertisement



[C++] Statistics server for players + fake edition

Discussion on [C++] Statistics server for players + fake edition within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Lightbulb [C++] Statistics server for players + fake edition

Here is a small playground for owners of servers . xD

I made a small improvements statics for players via command.


Code:
//@svn/Server/common/service.h
#define ENABLE_ONLINE_COMMAND
#define ENABLE_COUNTER_FAKE //@ DISABLE IF YOU NOT WANT TO HAVE FAKE PLAYER ON COMMAND
//@svn/Server/game/src/cmd.cpp
//1.) Search:
	{ "messenger_auth",	do_messenger_auth,	0,			POS_DEAD,	GM_PLAYER	},
//2.)  Add bellow:
#ifdef ENABLE_ONLINE_COMMAND
	{ "online",	do_online,	0,			POS_DEAD,	GM_PLAYER	},
#endif
//1.) Search:
ACMD(do_messenger_auth);
//2.) Add bellow:
#ifdef ENABLE_ONLINE_COMMAND
	ACMD(do_online);
#endif
  
//@svn/Server/game/src/cmd_general.cpp
//1.) Add where you want:
ACMD(do_online)
{
/*********************************************************************
* date        : 2016.10.25
* file        : cmd_general.cpp
* author      : VegaS
* description : Statistics server + configuration for fake
*/
	time_t currentTime;
	struct tm *localTime;
	
	time(&currentTime);
	localTime = localtime(&currentTime);
#define ENABLE_OFFLINE_SHOP_SYSTEM //@disable if you not have offlineShop
#ifdef ENABLE_OFFLINE_SHOP_SYSTEM
	std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM player.offline_shop_npc WHERE owner_id and channel = %d", g_bChannel));
	MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
	
	int	mShopsOffline = 0;
	str_to_number(mShopsOffline, row[0]);
#endif
	int mResultHour = localTime->tm_hour, mResultMin = localTime->tm_min, mResultSec = localTime->tm_sec;	
	int mTotalOnline;
	int * mEmpire;
	int mLocal;

	DESC_MANAGER::instance().GetUserCount(mTotalOnline, &mEmpire, mLocal);
/*
	0 = 00:00	1 = 01:00	2 = 02:00	3 = 03:00	4 = 04:00	5 = 05:00
	6 = 06:00	7 = 07:00	8 = 08:00	9 = 09:00	10 = 10:00	11 = 11:00
	12 = 12:00	13 = 13:00	14 = 14:00	15 = 15:00	16 = 16:00	17 = 17:00	
	18 = 18:00	19 = 19:00	20 = 20:00	21 = 21:00	22 = 22:00	23 = 23:00		
*/
#ifdef ENABLE_COUNTER_FAKE
    static int arrayDesc[23 + 1][2] =
     {	/* 
          First row -> Current hour | Second row -> Value added for players fake 
          Example: From 15:00 until 15:59:59 will be added on statics + 75 players online fake. Because -> { 15, 75 }
		*/
        { 0, 190  },     { 1, 175  },    { 2, 160  },	{ 3, 140  },     { 4, 130  },    { 5, 100  },
        { 6, 80   },     { 7, 75   },    { 8, 60   },	{ 9, 55   },     { 10, 40  },    { 11, 30  },
        { 12, 50  },     { 13, 60  },    { 14, 70  },	{ 15, 75  },     { 16, 80  },    { 17, 90  },
        { 18, 105 },     { 19, 120 },    { 20, 135 },	{ 21, 155 },     { 22, 175 },    { 23, 180 }
     };
	
    for (int i=0; i<_countof(arrayDesc); i++) {
        if (mResultHour == arrayDesc[i][0])
        {
            for (int j=1; j<=3; j++)
                mEmpire[i] += arrayDesc[i][1] / 3;
            mTotalOnline += arrayDesc[i][1];
            break;
        }
    }
#endif
	if (ch->IsGM())
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "[i] Current time on server: %d:%d:%d", mResultHour, mResultMin, mResultSec);
	}

	ch->ChatPacket(CHAT_TYPE_INFO, "[i] Current channel: [%d]", g_bChannel);	
	ch->ChatPacket(CHAT_TYPE_INFO, "[i] Current players online on this channel (all empire): [%d]", mTotalOnline);
	ch->ChatPacket(CHAT_TYPE_INFO, "[i] Current players online on empire: Shinshoo - [%d] | Chunjo - [%d] | Jinno - [%d]", mEmpire[1], mEmpire[2], mEmpire[3]);
#ifdef ENABLE_OFFLINE_SHOP
	ch->ChatPacket(CHAT_TYPE_INFO, "[i] Current shops offline on this channel: [%d]", mShopsOffline);
#endif
}
Have fun ^^ (not tested full, sorry for shit code, It was quickly made fun)
VegaS ♆ is offline  
Thanks
7 Users
Old 11/02/2016, 06:57   #2
 
elite*gold: 0
Join Date: Oct 2013
Posts: 132
Received Thanks: 306
I think it´s very usefull, thank u mate.
SexStatus is offline  
Old 11/02/2016, 13:12   #3
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
And how can I remove this with the fake?
{ 0, 0 },
{ 1, 0 },
{ 2, 0 }
???
thespeedyy is offline  
Old 11/02/2016, 16:46   #4
 
elite*gold: 0
Join Date: Nov 2012
Posts: 29
Received Thanks: 7
Quote:
Originally Posted by thespeedyy View Post
And how can I remove this with the fake?
{ 0, 0 },
{ 1, 0 },
{ 2, 0 }
???
Delete for

Hachiwari is offline  
Old 11/03/2016, 05:59   #5
 
elite*gold: 0
The Black Market: 105/0/0
Join Date: May 2016
Posts: 8,679
Received Thanks: 1,638
Looks good, thanks for the Release
悪地城 is offline  
Old 11/03/2016, 10:28   #6
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
Und das stört sonst nichts wegen Empire etc?
Code:
for (int i=0; i < _countof(arrayDesc); i++)
{
	if (mResultHour == arrayDesc[i][0])
	{
		for (int j=1; j<=3; j++)
		mEmpire[i] += arrayDesc[i][1] / 3;
		mTotalOnline += arrayDesc[i][1];
		break;
	}
}
thespeedyy is offline  
Old 11/03/2016, 13:26   #7
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Quote:
Originally Posted by thespeedyy View Post
And how can I remove this with the fake?
Check first posted, i edited.
VegaS ♆ is offline  
Old 11/03/2016, 13:27   #8

 
TheFallenShadow's Avatar
 
elite*gold: 2505
Join Date: Oct 2016
Posts: 132
Received Thanks: 66
Thank you mate.
TheFallenShadow is offline  
Old 11/03/2016, 16:52   #9
 
elite*gold: 0
Join Date: Nov 2016
Posts: 6
Received Thanks: 1
Is it possible to calculate online from all channels ?
Lajku is offline  
Reply

Tags
c++, epvp, metin2 fake


Similar Threads Similar Threads
CSS Fake Players Plugin?
10/10/2014 - Counter-Strike - 6 Replies
Sers Leute. Ich denke mal manche Server Admins kennen dieses Script noch. Es funktionierte ca. 2009-2012. Ich selbst hatte/hab dieses Plugin noch. Allerdings funktioniert es nicht mehr. Da Valve ja dagegen vorging um Server auf die Blacklist zu setzen , sofern manche Server Betreiber dieses Plugin weiterhin laufen lassen. (Zur Erklärung) Dieses Plugin bewirkte das der Server diese Bots als echte Spieler angezeigt hatte). Meine Frage ist dennoch ob es für Sourcemod/Metamod noch eine Art...
Tips & Tricks for new players (NA edition)
05/21/2012 - Tera - 0 Replies
Hey everyone, I recently had a chance to participate in the TERA closed beta 1 for its upcoming North American release and wrote a little tips & tricks guide for it which I think will be helpful for many players new to TERA. It covers alot of the game mechanics which I thought were unique to TERA and alot of people may not be familiar with it. The guide is published in our wonderful gamezone section and here is the link for it :) mmogarden



All times are GMT +1. The time now is 23:38.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.