Page 1 of 1

Little addtion to /info with multiple accounts on 1 ip.

Posted: October 7th, 2011, 8:45 am
by Intertoothh
I would be superduper if /info would not only show the other accounts on a ip, but also show if they are online at the moment!

Code: Select all

About intertoothh: Online now from x.x.x.x
loads of info
Shared accounts on ip: inter-work, interalsoonline (O), inter-offline
This would help to catch griefing teams, and help with the 'no the other account was my brothers' but you never seen them online together.

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: October 28th, 2011, 1:47 pm
by Intertoothh
Hmm
trying to implement this myself, but its harder then i tought at first.
Becouse the ClassyName:get is used for this, and thats used for everything.
But i cant see what object/command triggerd the ClassyName.

Best solution i got atm is, but i dont think this is a goodone.

Code: Select all

  public string ClassyName {
            get {
                StringBuilder sb = new StringBuilder();
                if( ConfigKey.RankColorsInChat.Enabled() ) {
                    sb.Append( Rank.Color );
                }
                if( ConfigKey.RankPrefixesInChat.Enabled() ) {
                    sb.Append( Rank.Prefix );
                }
                if( DisplayedName.Length > 0 ) {
                    sb.Append( DisplayedName );
                } else {
                    sb.Append( Name );
                }
                if( IsBanned ) {
                    sb.Append( Color.Warning ).Append( '*' );
                }
                if( IsFrozen ) {
                    sb.Append( Color.Blue ).Append( '*' );
                }
                if (!IsOnline)
                {
                    sb.Append(Color.Gray).Append('*');
                }
                return sb.ToString();
            }
        }
Maybe i could clone the altNames playerlist, to change it, but thats not nice and i hate cloning.

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: October 29th, 2011, 6:32 pm
by Jonty800
could you not add something into CdInfo, like

if (playerFromSameIP.IsOnline)
{
StringBuilder sb = new StringBuilder();
sb.Append(Color.Green).Append('*');
}

I dunno if this works

Code: Select all

foreach( PlayerInfo playerFromSameIP in PlayerDB.FindPlayers( info.LastIP, 25 ) ) {
                    if( playerFromSameIP == info ) continue;
                    altNames.Add( playerFromSameIP );
                    if (playerFromSameIP.IsOnline)
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.Append(Color.Blue).Append('*');
                    }
                    if( playerFromSameIP.IsBanned ) {
                        bannedAltCount++;
                    }
                }

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: October 31st, 2011, 9:20 am
by Intertoothh
Nope, becouse the list is made by the iclassy interface.

Its a interface created to make neat lists with color codes etc for all the lists.

The user part of it, has the neat banned stuff and frozen stuff on it. But it will show Everywhere you display a user. Not only in the /info alt list.

A neat solution would be if the list would know where its called from, so you can check why the list is generated. I could use debug/callstack/traceback for that, but those are slow and resource heavy in my experiance.

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: November 1st, 2011, 12:12 am
by Jonty800
Would this work?
(I cant test because my University doesnt allow open ports)

Code: Select all

if( info.LastIP.ToString() != IPAddress.None.ToString() ) {
                // Show alts
                List<PlayerInfo> altNames = new List<PlayerInfo>();
                List<PlayerInfo> OnlineNames = new List<PlayerInfo>();
                int bannedAltCount = 0;
                foreach( PlayerInfo playerFromSameIP in PlayerDB.FindPlayers( info.LastIP, 25 ) ) {
                    if( playerFromSameIP == info ) continue;
                    altNames.Add( playerFromSameIP );

                    if (playerFromSameIP.IsOnline) continue;
                    OnlineNames.Add(playerFromSameIP);

                    if( playerFromSameIP.IsBanned ) {
                        bannedAltCount++;
                    }
                }

                if( altNames.Count > 0 ) {
                    altNames.Sort( new PlayerInfoComparer( player ) );
                    if( bannedAltCount > 0 ) {
                        player.Message( "  {0} accounts ({1} banned, {3} online) on IP: {2}",
                                        altNames.Count,
                                        bannedAltCount,
                                        altNames.ToArray().JoinToClassyString(),
                                        OnlineNames.Count);
                    } else {
                        player.Message( "  {0} accounts on IP: {1}",
                                        altNames.Count,
                                        altNames.ToArray().JoinToClassyString() );
                    }
                }
            }

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: November 1st, 2011, 12:59 am
by boblol0909
Jonty800 wrote:Would this work?
(I cant test because my University doesnt allow open ports)

Code: Select all

if( info.LastIP.ToString() != IPAddress.None.ToString() ) {
                // Show alts
                List<PlayerInfo> altNames = new List<PlayerInfo>();
                List<PlayerInfo> OnlineNames = new List<PlayerInfo>();
                int bannedAltCount = 0;
                foreach( PlayerInfo playerFromSameIP in PlayerDB.FindPlayers( info.LastIP, 25 ) ) {
                    if( playerFromSameIP == info ) continue;
                    altNames.Add( playerFromSameIP );

                    if (playerFromSameIP.IsOnline) continue;
                    OnlineNames.Add(playerFromSameIP);

                    if( playerFromSameIP.IsBanned ) {
                        bannedAltCount++;
                    }
                }

                if( altNames.Count > 0 ) {
                    altNames.Sort( new PlayerInfoComparer( player ) );
                    if( bannedAltCount > 0 ) {
                        player.Message( "  {0} accounts ({1} banned, {3} online) on IP: {2}",
                                        altNames.Count,
                                        bannedAltCount,
                                        altNames.ToArray().JoinToClassyString(),
                                        OnlineNames.Count);
                    } else {
                        player.Message( "  {0} accounts on IP: {1}",
                                        altNames.Count,
                                        altNames.ToArray().JoinToClassyString() );
                    }
                }
            }
localhost?

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: November 1st, 2011, 1:35 am
by Jonty800
Online players?

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: November 1st, 2011, 2:34 am
by boblol0909
You can run more than one wom on the same computer at a time.

Re: Little addtion to /info with multiple accounts on 1 ip.

Posted: November 1st, 2011, 9:37 am
by Intertoothh
Hmmm Jonty800 good idea.
We could just splitup the list indeed..

I'll have a go at it when i have time.