Correct way to get player skin name from the server

Discussions about Coding and Scripting
Post Reply
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Correct way to get player skin name from the server

Post by iloveut99 »

Hello,

Somebody knows a simple way to get the skin name of a client in the server?

I'm using right now

Code: Select all

p.GetDefaultURL("Skin")
(where p is a TournamentPlayer), but seems that it doesn't work in a server, just in practice section.

Code: Select all

p.MultiSkins[].name
seems to only retrieve the name of the skin, not the package name.

Thanks.
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Correct way to get player skin name from the server

Post by Feralidragon »

Well, you can try:

Code: Select all

String(p.MultiSkins[])
That should get you something like: Texture'SomePackage.SomeTex'

I am not sure though, but since I use logs many times for debugging, I use something like "log(SomeActorOrClass)" and it always prints the full thing, so I assume "log" makes a string coersion (by calling the internal toString() getter of the object) and String(something) must do the same thing. Just assuming though, but give it a try.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Correct way to get player skin name from the server

Post by JackGriffin »

When players join you get lines like this:
Login request: Index.unr?Name=pucka?Class=MultiMesh.TSkaarj?team=1?skin=tskmskins.MekS?Face=tskmskins.Disconnect?Voice=MultiMesh.SkaarjVoice
The proper replicated values are MeshName, SkinName, and FaceName. Grab those and you ought to see what you need. It's just as easy though to look at the logs. Oh, and mods like Val Av or Dane's Skin Changer can obviously override the player's chosen settings.
So long, and thanks for all the fish
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Correct way to get player skin name from the server

Post by iloveut99 »

Feralidragon tip worked fine:

Code: Select all

string(p.MultiSkins[0])
:)

JackGriffin I thought in that log but what I could find more similar was ProcessServerTravel in GameInfo class. Where is that log being written?
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Correct way to get player skin name from the server

Post by JackGriffin »

That's the main feed from the UCC.log.
So long, and thanks for all the fish
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Correct way to get player skin name from the server

Post by iloveut99 »

I meant the class that was writing it. :lol: :tu:
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Correct way to get player skin name from the server

Post by JackGriffin »

I took a quick glance through the public source and I don't see it. It may be native code creating the log file.
So long, and thanks for all the fish
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Correct way to get player skin name from the server

Post by iloveut99 »

JackGriffin wrote:I took a quick glance through the public source and I don't see it. It may be native code creating the log file.
Yeah you may be right.

When you say to I use the replicated variables MeshName, SkinName, and FaceName you mean to I get them (at least skin name) from the function

Code: Select all

GetMultiSkin( Actor SkinActor, out string SkinName, out string FaceName )
right? I will probably continue with Feralidragon method however.
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Correct way to get player skin name from the server

Post by JackGriffin »

In a decision over who to listen to ALWAYS listen to Ferali versus anyone else. My money is on him.

The values I listed are simply the replicated variables that the player sends to the server. Neither is wrong, but I prefer to grab default values when I can. Certain mods could reassign the multiskins (like I said above) and using defaults will always let you see what the player has chosen to use.
So long, and thanks for all the fish
iloveut99
Skilled
Posts: 231
Joined: Mon Aug 16, 2010 10:25 pm

Re: Correct way to get player skin name from the server

Post by iloveut99 »

Oh ok got it. Yes in this case I need to check what's the actual skin and not the what the player chose I believe.
Post Reply