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

Post all ideas and suggestions for fCraft here
Post Reply
User avatar
Intertoothh
Trustee
Offline
Posts: 1149
Joined: May 24th, 2011, 5:51 am

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

Post 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.
McLaughlinKid wrote:You put roar on everything don't you?

User avatar
Intertoothh
Trustee
Offline
Posts: 1149
Joined: May 24th, 2011, 5:51 am

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

Post 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.
McLaughlinKid wrote:You put roar on everything don't you?

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post 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++;
                    }
                }
You cannot use certain BBCodes: [img].

User avatar
Intertoothh
Trustee
Offline
Posts: 1149
Joined: May 24th, 2011, 5:51 am

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

Post 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.
McLaughlinKid wrote:You put roar on everything don't you?

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post 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() );
                    }
                }
            }
You cannot use certain BBCodes: [img].

User avatar
boblol0909
SupOP
Offline
Posts: 314
Joined: June 24th, 2011, 10:27 pm

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

Post 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?

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

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

Post by Jonty800 »

Online players?
You cannot use certain BBCodes: [img].

User avatar
boblol0909
SupOP
Offline
Posts: 314
Joined: June 24th, 2011, 10:27 pm

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

Post by boblol0909 »

You can run more than one wom on the same computer at a time.

User avatar
Intertoothh
Trustee
Offline
Posts: 1149
Joined: May 24th, 2011, 5:51 am

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

Post by Intertoothh »

Hmmm Jonty800 good idea.
We could just splitup the list indeed..

I'll have a go at it when i have time.
McLaughlinKid wrote:You put roar on everything don't you?

Post Reply