Player Profile [Contribution]

Hello everyone!

I hope all of you are having a good day. If you could, please spare a moment or two to go through this thread. And if it’s possible share your thoughts and feedback.

Recently PMU released it’s source code snapshot. I think this was a good step because it allowed us players to gain some understanding of how PMU functions. I tried to take hold of this opportunity and decided to work on something. I was having my exams for the past few months but even now when my vacations started, the idea was still on my mind and so I gained experience on a separate server (not directly affiliated with PMU). The first thing I noticed was that many commands in PMU such as “/map”, “/info”, “/getip” and few others are aimed to gain information regarding a certain client who is online but these commands flood the chat too much which is why I wanted to create a more visual way to be able to get a hold of information.

The player profile is created using the custom-menu-manager. I’m not sure but I assume the basis of this was laid by Raiblu or so I think. Here’s how it looks like on a separate server:

It’s a staff command. Meaning it can only be used by moderators and above. You could say that it’s a good stalking gear for any rank that is not ‘player’ or ‘admin’ but anywhere in between. I think it would be useful as it would allow middle staff ranks to check information about players that they can’t currently do. (At least they can’t in the released version of the code.) The menu pops up using a command:

/profile “playername”

Here’s the code for it: http://textuploader.com/2fbe

You just need to copy paste it in the Commands.CS (server file) after the main switch statement. Don’t worry. Even though it has 36 labels, it still shows up without delay. There are a few limitations such as character count but only for very exceptional cases. It was my first attempt at working something like this and if you have some new ideas, I would love to hear them. You may use this on any server.

Tell me what you guys think about it!

Thanks.
~Festi.

oh i think it would be cool if there was a player version of this too (of course it wouldnt have all that good stuff on it)

This is a brilliant Contribution nice work!

That’s an interesting idea, Alex!

Thanks Blaze! :3

~Festi.

Nice contribution!

I’ve made a variant that is suitable for use by players (below mod), which is currently in use on MDX. It will only work if both you and the person whose profile you want to see are in each others friends lists. Any server can use this, and it’ll work if you have both the mod+ and player version active at the same time (just change /profile to /playerprofile)

case “/profile”: {
string playerName = joinedArgs;
Client n = ClientManager.FindClient(playerName, true);

                        if (n != null) {
                        	if (client.Player.Friends.HasFriend(playerName) && n.Player.Friends.HasFriend(client.Player.Name) || client == n) {
                                //Basic information about menu.
                              	Server.CustomMenus.CustomMenu menu = n.Player.CustomMenuManager.CreateMenu("mnuRandomu", "", true);
                                menu.UpdateSize(400, 450);
                                menu.AddLabel(0, 20, 10, 210, 50, "Player Profile", "PMU", 38, System.Drawing.Color.WhiteSmoke);
                               	
                               	//Loading player name.
                               	menu.AddLabel(1, 20, 60, 210, 30, "Character name:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(2, 150, 62, 210, 30, n.Player.Name, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	
                               	//Loading player level.
                               	string plyr_lvl = n.Player.GetActiveRecruit().Level.ToString();
                               	menu.AddLabel(3, 20, 80, 210, 30, "Level:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(4, 70, 82, 210, 30, plyr_lvl, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	
                               	//Loading player location.
                               	string player_location = n.Player.Map.Name;
                               	menu.AddLabel(5, 20, 100, 210, 30, "Location:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(6, 90, 102, 300, 30, player_location, "PMU", 24, System.Drawing.Color.WhiteSmoke); 
                               	
                               	//Loading player play-time.
                               	string player_playtime = n.Player.Statistics.TotalPlayTime.ToString();
                               	menu.AddLabel(7, 20, 120, 210, 30, "Play time:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(8, 100, 122, 210, 30, player_playtime, "PMU", 24, System.Drawing.Color.WhiteSmoke); 
                                                        
                               	//Loading active recruit details.
                            	string player_nickname;
                            	string player_species = Pokedex.GetPokemon(n.Player.GetActiveRecruit().Species).Name;
                            	player_nickname = n.Player.GetActiveRecruit().Name + " (" + player_species + ")";
                            	menu.AddLabel(9, 20, 140, 210, 30, "Nickname:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                            	menu.AddLabel(10, 100, 142, 210, 30, player_nickname, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                            	
                            	//Loading player"s explorer rank.
                            	string player_rank;
                            	player_rank = n.Player.ExplorerRank.ToString();
                            	menu.AddLabel(11, 20, 160, 210, 30, "Rank:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                            	menu.AddLabel(12, 70, 162, 210, 30, player_rank, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                            	
                               	//Loading player"s HP, Belly, Gender.
                               	string player_belly = n.Player.GetActiveRecruit().Belly.ToString() + "/" + n.Player.GetActiveRecruit().MaxBelly;
                               	string player_HP = n.Player.GetActiveRecruit().HP.ToString() + "/" + n.Player.GetActiveRecruit().MaxHP;
                               	string player_gender = n.Player.GetActiveRecruit().Sex.ToString();
                               	menu.AddLabel(13, 20, 220, 210, 30, "Belly:", "PMU", 26, System.Drawing.Color.WhiteSmoke); 
                               	menu.AddLabel(14, 20, 240, 210, 30, "HP:", "PMU", 26, System.Drawing.Color.WhiteSmoke); 
                               	menu.AddLabel(15, 70, 222, 210, 30, player_belly, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(16, 50, 242, 210, 30, player_HP, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(17, 20, 260, 210, 30, "Gender:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(18, 80, 262, 210, 30, player_gender, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	
                               	//Loading player"s team members.(Slot 2,3,4 since slot 1 is already covered in "Nickname")
                                string player_slot_2 = Pokedex.GetPokemon(n.Player.Team[1].Species).Name + " (" + n.Player.Team[1].Sex.ToString() + ")";
                                string player_slot_3 = Pokedex.GetPokemon(n.Player.Team[2].Species).Name + " (" + n.Player.Team[2].Sex.ToString() + ")";
                                string player_slot_4 = Pokedex.GetPokemon(n.Player.Team[3].Species).Name + " (" + n.Player.Team[3].Sex.ToString() + ")";
                                menu.AddLabel(19, 20, 280, 210, 30, "Slot 2:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                                menu.AddLabel(20, 20, 300, 210, 30, "Slot 3:", "PMU", 26, System.Drawing.Color.WhiteSmoke); 
                               	menu.AddLabel(21, 20, 320, 210, 30, "Slot 4:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                                menu.AddLabel(22, 75, 282, 210, 30, player_slot_2, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(23, 75, 302, 210, 30, player_slot_3, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(24, 75, 322, 210, 30, player_slot_4, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               		
                               	//Loading player stats. Atk, Def, SpDef, Spd, SpDef, SpAtk.
                                string pokemon_atk_stats = "Atk - " + n.Player.Team[0].Atk + " / " + "SpAtk - " + n.Player.Team[0].SpclAtk;
                                string pokemon_def_stats = "Def - " + n.Player.Team[0].Def + " / " + "SpDef - " + n.Player.Team[0].SpclDef; 
                               	menu.AddLabel(25, 20, 340, 210, 30, "Attack:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(26, 73, 342, 210, 30, pokemon_atk_stats, "PMU", 24, System.Drawing.Color.WhiteSmoke);	
                               	menu.AddLabel(27, 20, 360, 210, 30, "Defense:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(28, 20, 380, 210, 30, "Speed:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(29, 85, 362, 210, 30, pokemon_def_stats, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	menu.AddLabel(30, 70, 382, 210, 30, n.Player.Team[0].Spd.ToString(), "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	
                                //Loading player guild.
                               	string player_guild_name = n.Player.GuildName;
                               	if (string.IsNullOrEmpty(n.Player.GuildName)) {
                               		player_guild_name = "None";
                               	}
                               	menu.AddLabel(31, 20, 400, 210, 30, "Guild:", "PMU", 26, System.Drawing.Color.WhiteSmoke);
                                menu.AddLabel(32, 70, 402, 210, 30, player_guild_name, "PMU", 24, System.Drawing.Color.WhiteSmoke);
                               	
                               	//Loading menu back to player.
                               	client.Player.CustomMenuManager.AddMenu(menu);
                                menu.SendMenuTo(client);
               				} else {
               					Messenger.PlayerMsg(client, "Both you and " + playerName + " need to be in each others friends list!", Text.BrightRed);
               				}
	                   	} else {
	                   		Messenger.PlayerMsg(client, "Player is offline.", Text.Grey);
               			} 	
            		}
            		break;

This sounds like a great idea as well.

Pikachu, could you make a variant of this that would allow players to view other’s profiles regardless of the friends list? The idea would be to allow players to view profiles of players not in their friends lists, but the profile would contain less information (only name, guild, and Pokémon). Players that have each other in their lists would be shown the full profile which would be the one that you created.

Thanks Pikablu! Also, I really like your idea about players being able to visit their friend’s profiles. But I guess like all things, it would have limitations. Since there are only so many friends you can have in your friend list. Even so, it’s a great idea and gives more use to the current friend list which at the moment only allows you to see if you’re friend is online or not.

Maybe this could work. But the whole concept of the friend list being involved here is so that not everyone can view your profile, and it’s only limited to people who you choose to be friends with.

~Festi.

I really like the whole profile idea, it"d really make grabbing information useful especially for moderation. Though, I do have one suggestion. As we sometimes have to check inventories (I.e. when a player loses an item, or for a player-held tournament.), the command spams the chat. You could possibly try to add extra pages to accommodate for the inventory? ( Not necessarily list the whole inventory - but more, “20 max ethers, 12 big apples, 5 reviver seeds” or something.)

Overall, I really like the idea. ^^
P.S. I"d like it if the levels/pokemon weren"t including if we introduced a player version too because some people like to keep the pokemon they are training secret. :<

Sounds like a great idea, I hope staff will put it in