Author Topic: OHSystem - Main Features  (Read 3932 times)

Grief-Code

  • Guest
OHSystem - Main Features
« on: December 15, 2013, 02:32:45 pm »
OpenHosting is now a major modification of the official GHost++ source.

Modification has many more options like:

  • GameList-Patch ( patch by uakf.b )
  • Update statistics directly from the bot
  • Commands through MySQL ( patch by uakf.b )
  • View current games live
  • Crossover chat (send messages directly from the website)
  • Detailed player statistics on the website ( php script OpenStats )
  • Message System (inbox) – save all messages and displays them when the user is online (with notification).
  • Password protection protect user account and stats from other spoofing players (also allows players to connect/verify their bnet account with the website account )
  • Simple user registration system - users can register via the form on the website, or via bot (at BNET) with command !reg, or log in with facebook account (and optionally verify bnet account). User profiles with verified bnet account were connected with statistics and protected.
  • Flame/Insult/Spam Check disallow custom word on the bot which arent displayed to other players
  • Penality System Punish users by breaking rules
  • Detailed parsing of dota stats parsing live double, tripple, ultra or rampage skills
  • Remote Bot Control Kick/Mute/Unmute or chat to players directly form the website
  • Feeder Warn System early wanrs for users who are might feeding
  • Smart voekick system no more abusive usage of the votekick command
  • Monthly statistics view user statistics monthly or allover
  • Smart autoend system games will automatically autoend on too many leavers

Bot Sources: https://github.com/OHSystem/ohsystem

We also accept improvement ideas an requests.
Please use the issue list on GitHub if you have issues.
Installation guide for UNIX Systems: https://github.com/OHSystem/ohsystem/wiki/Installation---UNIX

Regards
« Last Edit: December 18, 2013, 11:16:08 am by Grief-Code »

Grief-Code

  • Guest
Re: Main Features
« Reply #1 on: December 17, 2013, 07:20:43 am »
We had some times and redesigned a bit our own homepage:
http://ohsystem.net/

This is currently only temporarily, we will add soon all features and changes to have one complete list.
Might later we will add a section for .patch/.diff pages.

Regards

Profforg

  • Average Member
  • ***
  • Posts: 187
  • Karma: +23/-27
    • View Profile
Re: Main Features
« Reply #2 on: December 17, 2013, 07:23:09 pm »
Here's some your topics from codelain. I've just backup it there (it's a hard work to write all text again) , so we don't lose it if codelain will dead forever. If you don't want them to be there, just remove it. As i understand, you can (you looks like administrator).









Colored Names of Users

Hm i think this would be the correct section.

Maybe some people already recognize that some hosters have colored names of single users. Here is a patch what would be an example solution to solve this:
http://ohsystem.net/patches/ohsystem_patches/coloredname.diff

This patch is not hardcoded, and is reloaded with the admin list.
Just add on the file coloredname.txt new lines like the already excisting.

The Colourcode should be the same as on the virtualhost.
The '|cFF' is automatically added.
The name itself shouldnt have more than 5 caracters, because 6 numbers for the colourcode+ '|cFF' = 10 chars, more than 15 chars will not be displayed/changed.
Its not possible / WC3 relating.

Have fun with this patch
















[Patch] Simple Commands

Hey community,

The code:
here is another patch which is included in our Project.
It is one Threaded vector for mysql which allow you to create fast and simple commands for your bot to show display statistical things from the database.
The project is commited on the source here:
https://code.google.com/p/oh-system/source/detail?r=8 (https://code.google.com/p/oh-system/source/detail?r=8)
or you could use this patch file:
http://ohsystem.net/patches/ohsystem_patches/simplecommand.diff (http://ohsystem.net/patches/ohsystem_patches/simplecommand.diff)

The usage:
We can input
  • 2 strings
  • 2 ints
When you start use this command you should also create a small list which include all information about that, if you adding multiply commands to it, it will be more difficult to split them from each other.
To add a command you simple need to modify the bnet.cpp/game.cpp & ghostdbmysql.cpp, the first file is relating if this should be an ingame or a channel command.

Commands:
Code: [Select]
# Type SubType Usage

1 1 1 Top Stats Command
2 1 2 Top Win Percentage
3 2 1 Streak
4 2 2 Score/Rank

The first code i will show is the code which should be added here(ghostdbmysql.cpp):
Code: [Select]
string MySQLQuerySystem( void *conn, string *error, uint32_t botid, uint32_t type, uint32_t subtype, string string_one, string string_two, uint32_t int_one, uint32_t int_two )
{
        string EscString_One = MySQLEscapeString( conn, string_one );
        string EscString_Two = MySQLEscapeString( conn, string_two );
        <HERE>
        return "failed";
}
The second is the one which should be placed here (bnet.cpp&game.cpp):
Code: [Select]
uint32_t IntTwo = i->second->GetIntTwo( );
<HERE>
if( Result == "failed" )
The last is the command, it should be placed on bnet.cpp&game.cpp where you want, if this should be an admin or public command.

Top Stats/Win% Command:
Code: [Select]
if( EscType == 1 )
{
        string Return;
string Query;
if( EscSubType == 1 )
Query = "SELECT player, "+EscString_One+" FROM oh_stats ORDER BY "+EscString_One+" DESC LIMIT 5";
else if( EscSubType == 2 )
Query = "SELECT player, ROUND(((100*wins)/(games-draws)), 2) as winperc FROM oh_stats ORDER BY winperc DESC LIMIT 5";
else
return "failed";

        if( mysql_real_query( (MYSQL *)conn, Query.c_str( ), Query.size( ) ) != 0 )
        {
*error = mysql_error( (MYSQL *)conn );
return "failed";
        }
        else
        {
     MYSQL_RES *Result = mysql_store_result( (MYSQL *)conn );

            if( Result )
            {
vector<string> Row = MySQLFetchRow( Result );
uint32_t counter = 1;
while( Row.size( ) == 2 )
                {
if( Return.empty() )
Return = UTIL_ToString(counter)+". "+Row[0]+": "+Row[1];
else
Return += ", "+UTIL_ToString(counter)+". "+Row[0]+": "+Row[1];

couner++;
Row = MySQLFetchRow( Result );
                }
mysql_free_result( Result );
            }
            else
    {
*error = mysql_error( (MYSQL *)conn );
return "failed";
            }
        }
return Return;
}
Code: (bnet.cpp) [Select]
if( Type == 1 && Result != "failed" )
{
if( SubType == 1 )
QueueChatCommand( "Top "+StringOne+": "+Result, i->first, !i->first.empty( ) );
else if( SubType == 2 )
QueueChatCommand( "Top Win%: "+Result, i->first, !i->first.empty( ) );
else
goto debug;
}
Code: (game.cpp) [Select]
if( Type == 1 && Result != "failed" )
{
if( SubType == 1 )
SendAllChat( "Top "+StringOne+": "+Result );
else if( SubType == 2 )
SendAllChat( "Top Win%: "+Result );
else
goto debug;
}
Code: (Command) [Select]
//
// !TOP
//
else if( Command == "top" || Command == "top5" )
{
transform( Payload.begin( ), Payload.end( ), Payload.begin( ), (int(*)(int))tolower );
string String_One = "score";
uint32_t Sub = 1;
if( !Payload.empty() && ( Payload == "kills" || Payload == "deaths" || Payload == "assists" || Payload == "creeps" || Payload == "denies" || Payload == "neutrals" || Payload == "streak" || Payload == "maxstreak" || Payload == "losingstreak" || Payload == "maxlosingstreak" || Payload == "zerodeaths" || Payload == "winperc" || Payload == "win" || Payload == "wins" || Payload == "losses" || Payload == "draws" ) )
{
String_One = Payload;
if( Payload == "win" || Payload == "winperc )
Sub = 2;
}
m_PairedQSChecks.push_back( PairedQS( Whisper ? User : string( ), m_GHost->m_DB->ThreadedQuerySystem( 1, Sub, String_One, "", 0, 0 ) ) );
}
Streak/Score/Rank Command:
Code: [Select]
if( EscType == 2 )
{
transform( EscString_One.begin( ), EscString_One.end( ), EscString_One.begin( ), (int(*)(int))tolower )
string Return;
string Query;
if( EscSubType == 1 )
Query = "SELECT player,score FROM oh_stats WHERE player_lower = '"+EscString_One+"';";
else if( EscSubType == 2 )
Query = "SELECT player,streak,maxstreak,maxlosingstreak FROM oh_stats WHERE player_lower = '"+EscString_One+"';";
else
return "failed";

if( mysql_real_query( (MYSQL *)conn, Query.c_str( ), Query.size( ) ) != 0 )
{
*error = mysql_error( (MYSQL *)conn );
return "failed";
}
else
{
MYSQL_RES *Result = mysql_store_result( (MYSQL *)conn );

if( Result )
{
vector<string> Row = MySQLFetchRow( Result );

if( EscSubType == 1 )
{
if( Row.size( ) == 2 )
{
string name = Row[0];
uint32_t score = UTIL_ToUInt32( Row[1] );
uint32_t allcount = 0;
uint32_t rankcount = 0;
if( score != 0 )
{
string ALLQuery = "SELECT COUNT(*) FROM oh_stats";
string CountQuery = "SELECT COUNT(*) FROM oh_stats WHERE score > '"+UTIL_ToString(score, 0)+"';";
if( mysql_real_query( (MYSQL *)conn, ALLQuery.c_str( ), ALLQuery.size( ) ) != 0 )
*error = mysql_error( (MYSQL *)conn );
else
{
MYSQL_RES *Result = mysql_store_result( (MYSQL *)conn );
if( Result )
{
vector<string> Row = MySQLFetchRow( Result );
if( Row.size( ) == 1 )
allcount = UTIL_ToUInt32( Row[0] );
}
}
if( mysql_real_query( (MYSQL *)conn, CountQuery.c_str( ), CountQuery.size( ) ) != 0 )
*error = mysql_error( (MYSQL *)conn );
else
{
MYSQL_RES *Result = mysql_store_result( (MYSQL *)conn );
if( Result )
{
vector<string> Row = MySQLFetchRow( Result );
if( Row.size( ) == 1 )
rankcount = UTIL_ToUInt32( Row[0] );
}
}
}
return "["+name+"] Score: "+UTIL_ToString(score)+" | Rank: #"+UTIL_ToString(rankcount)+"/"+UTIL_ToString(allcount);
}
}
else if( EscSubType == 2 )
{
if( Row.size( ) == 3 )
return "["+Row[0]+"] Current Streak: "+Row[1]+" | Max Streak: "+Row[2]+" | Max Loosing Streak: "+Row[3];
}
else
return "failed";
}
else
return "failed";
}
}
Code: (bnet.cpp) [Select]
if( Type == 2 && Result != "failed" )
{
if( SubType == 1 )
QueueChatCommand( Result, i->first, !i->first.empty( ) );
else if( SubType == 2 )
QueueChatCommand( Result, i->first, !i->first.empty( ) );
else
goto debug;
}
Code: (game.cpp) [Select]
if( Type == 2 && Result != "failed" )
{
if( SubType == 1 )
SendAllChat( Result );
else if( SubType == 2 )
SendAllChat( Result );
else
goto debug;
}
Code: (Command) [Select]
//
// !RANK !SCORE !STREAK
//
else if( Command == "rank" || Command == "score" || Command == "streak" )
{
string StatsUser = User;
uint32_t Sub = 1;
if( Command == "streak" )
Sub = 2;
if( !Payload.empty( ) )
StatsUser = Payload;

// check for potential abuse

if( !StatsUser.empty( ) && StatsUser.size( ) < 16 && StatsUser[0] != '/' )
m_PairedQSChecks.push_back( PairedQS( Whisper ? User : string( ), m_GHost->m_DB->ThreadedQuerySystem( 2, Sub, StatsUser, "", 0, 0 ) ) );
}

If you have suggestions for other commands, do not hesitate to comment here, i would make them then and add it here ;)

Regards





















!ready, !wim and !rmk Command

Well just some code from my project:

!wff || !whoff to see which people actually ffed and which not, it does show also the current status like 1 of 3 players at sentinel ffed.

Code: [Select]
        //
        // !WFF !WHOFF
        //
        else if( ( Command == "whoff" || Command == "wff" ) && m_GameLoaded )
        {
                int Votes=0;
                int SeVotes=0;
                int ScVotes=0;
                int SePlayers=0;
                int ScPlayers=0;
                string SeNames;
                string ScNames;
                bool twoteammap = true;
                for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); i++)
                {
                        char sid = GetSIDFromPID( (*i)->GetPID( ) );
                        if (sid <= 4 && sid >= 0)
                        {
                          if( (*i)->GetForfeitVote( ))
                          {
                                if( !SeNames.empty() )
                                        SeNames = SeNames+", "+(*i)->GetName();
                                else
                                        SeNames = (*i)->GetName();
                                SeVotes++;
                                Votes++;
                          }
                          SePlayers++;
                        }
                        else if(sid >= 5 && sid <= 9)
                        {
                         if( (*i)->GetForfeitVote( ))
                          {

                                if( !SeNames.empty() )
                                        ScNames = ScNames+", "+(*i)->GetName();
                                else
                                        ScNames = (*i)->GetName();
                                ScVotes++;
                                Votes++;
                          }
                          ScPlayers++;
                        }
                        else if( !m_Slots[sid].GetTeam( ) != 12 )
                                twoteammap = false;
                }
                if( Votes == 0 )
                        SendChat( player, "No one voted yet for forfeiting the game" );
                else if( !twoteammap )
                        SendChat( player, "Error, this isnt a two-team-map, you may not forfeit here" );
                else
                {
                        SendChat( player, "Forfeits:" );
                        SendChat( player, "[Sentinel ("+UTIL_ToString(SeVotes)+"/"+UTIL_ToString(SePlayers)+"): "+SeNames );
                        SendChat( player, "[Scourge ("+UTIL_ToString(ScVotes)+"/"+UTIL_ToString(ScPlayers)+"): "+ScNames );
                }
        }

 Or you can use this link:
http://ohsystem.net/patches/ohsystem_patches/whoff-command.txt

Regards


























[Patch] StatsUpdate on BotSide

Hey,

this is a first small patch which is really one of our basic ideas,
the stats are now finally updated via the bot and this is a huge optimizing on the relation between the bot & openstats.
The statsupdate is delayed up to 5 seconds after a game finished, so player who will join the next game will already see the new stats.

Probably i just needed to cut the statsupdate a bit (this are not basic things) but it would be later anyway removed. We dont update if someone is an admin/safelist or if someone got warned.
Furtheremore you need to compile it by urself.
For Linux-based servers its simple. Just join update_stats-direction & use 'make' after that you can simple copy the file.
For Windows-based servers the file should be automatically compiled on the botcompile, i added it to ghost.sln (if there is any issue please report it)

If you have any questions, do not hesitate to comment.

SVN-Commit can be found here: https://code.google.com/p/oh-system/source/detail?r=4
Edit: Updated a small fix, look also here: https://code.google.com/p/oh-system/source/detail?r=5

Regards,
Grief-Code

Edit: use the latest patch file:
http://ohsystem.net/patches/ohsystem_patches/botstatsupdate.diff
I'm offering most advanced Warcraft 3 bot hosting.

Feel free to contact me:
E-Mail: admin@rusdota.net

Grief-Code

  • Guest
Re: Main Features
« Reply #3 on: December 18, 2013, 12:34:41 am »
Nice thx ;-)

Yea indeed, im an Administrator, i will split these diffrent topics and remake the threads ;-)

Grief-Code

  • Guest
Re: OHSystem - Main Features
« Reply #4 on: December 21, 2013, 05:09:18 pm »
Im proud to finally inform you that we have FINALLY fixed our CPU issues. It was a thing back in 5 months i didnt touch since then and i didnt thought about it, just expanded it over and over.

Today i just noticed a thing on our logs and i reviewed the code and boom, i found it :-)
There were some checks which were just spammed in the lobby while the game didnt start and there some more players in the libby, password protection, game amount, banned country etc.
Its now a check until the player has been marked as checked after 21 seconds, currently our bot is hosting 3 games with 1% CPU on a full lobby, this does mean we did it :-)

Regards

69

  • Member
  • **
  • Posts: 76
  • Karma: +5/-4
    • View Profile
Re: OHSystem - Main Features
« Reply #5 on: December 29, 2013, 05:37:30 am »
Im proud to finally inform you that we have FINALLY fixed our CPU issues. It was a thing back in 5 months i didnt touch since then and i didnt thought about it, just expanded it over and over.

Today i just noticed a thing on our logs and i reviewed the code and boom, i found it :-)
There were some checks which were just spammed in the lobby while the game didnt start and there some more players in the libby, password protection, game amount, banned country etc.
Its now a check until the player has been marked as checked after 21 seconds, currently our bot is hosting 3 games with 1% CPU on a full lobby, this does mean we did it :-)

Regards
yeah love to hear this, now i use this for my ghost++ :D
thanks grief....

grief maybe you want planning ranks for game like Legion , Pimp my Peon, Green TD or other games??
« Last Edit: December 29, 2013, 05:40:22 am by 69 »

Grief-Code

  • Guest
Re: OHSystem - Main Features
« Reply #6 on: December 29, 2013, 05:43:19 am »
We are already in planing progress, just be patient.

Grief-Code

  • Guest
Re: OHSystem - Main Features
« Reply #7 on: January 04, 2014, 04:18:11 am »
Just as small note:

We have now our own forum which is a bit more specific for certain questions:
http://ohsystem.net/forum/index.php

I also added redirect on the child board.


Another note:
Our system is currently still in a beta phase and we hadnt our first release yet, we just made it open source.
We do not support or help on any cusomizations. If you modify the bot sources/statspage you need to fix things yourself and also solve things yourself.
If you are including support for other software you need to solve that yourself.
You can always request new ideas, but it will take time, we are working a lot on the project and we dont have the additional time to support and help on things we have never done or even implented. After we have our release and we have our first stable version we have more time and can/try to support you on your points and ideas, but still all should be handled as requests for the project.

It is always recommended on any problems to use the latest version, we have daily minor fixes which does improve small things, if you using older versions please update first and see if this is fixed before you are reporting an issue. We have also several reported issues which where fixed already weeks ago.

Regards
« Last Edit: January 04, 2014, 07:05:42 am by Grief-Code »