#how can i store webrequest downloadhandlertext
13 messages · Page 1 of 1 (latest)
I don't know what all you're retrieving, but perhaps the server should be retrieving it if server needs it, and storing it into fields in a script on the player object.
lack of context leads to good or bad guesses 🙂
ah yeah - let server fetch all that
if client fetches all that for char creation / customization / selection, they can do that in an offline scene with a UI that shows all that, and eventually just pass an id to server for which one they want spawned for them to play, and server would fetch data for that one and spawn it
you can put your code in https://pastie.io/ and share the link back here.
looking now...
ok I think I see what you're doing...you are fetching everything on server, you just need a struct to store it in conn.authenticationData.
public struct AllPlayerData
{
public KarakterleriGoster msg;
public string[] playerNames;
public string[] playerClasses;
}
AllPlayerData allPlayerData = new AllPlayerData();
Then you can store data in that allPlayerData struct as you get it
When calling ServerAccept, you can store allPlayerData
conn.authenticationData = allPlayerData;
May not be perfect translation from your code, but you can get the idea from that
later you can cast it back so you can read the parts out of it
AllPlayerData allPlayerData = conn.authenticationData as AllPlayerData;
var lst = JsonConvert.DeserializeObject<List<string>>(www.downloadHandler.text);//karakter isimlerini liste şeklinde çekiyorum
allplayerdata.playernames= lst.toArray();
something like that?
looks fine where they are