SHARE
TWEET

Everybody Edits - How to read ShopData

capasha Aug 21st, 2015 (edited) 195 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Welcome to this little tutorial how to use ShopDate/getShop.
  2.  
  3. First. There are two getShop one for normal use and one for crew.
  4. To get the normal one login to your account. Save the client data.
  5.  
  6. ////////////////////// getShop for normal use \\\\\\\\\\\\\\\\\\\\\\\\\
  7. ###################### Example (Save Client data) ######################
  8. Client client;
  9. client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "email", "password", null);
  10.  
  11. ###################### Example (Connect to lobby) ######################
  12. Connection con;
  13. con = client.Multiplayer.CreateJoinRoom(client.ConnectUserId, "Lobby" + client.BigDB.Load("config", "config")["version"], true, null, null);
  14. con.Send("getShop");
  15.  
  16. Don't forget to add a message handler. Add "getShop" and "useEnergy" to the message handler.
  17. Now when you sent getShop you should receive a lot of messages in message handler.
  18. To sort out them, so everything works like it should. Use following code.
  19.  
  20. The messages contains 23 lines, with shopData informations.
  21. And to start read the messages. We start at line 5 and goes to message count ends.
  22.  
  23.  
  24. ###################### Example (Sort out lines/Reading getShop) ######################
  25.  
  26. uint total = 24; // Messages contains 24 lines of data
  27. uint x = 5; // We start at 5 to read the data we need
  28. while (x < m.Count)
  29. {
  30.         if (m.GetString(x) == "world0")
  31.         {
  32.                 Console.WriteLine("This item is a world0 " + "And it costs: " + m.GetInt(x + 2));
  33.         }
  34.         x = x + total; // Here do we update the x with 23 so we can get the correct data from the lines.
  35. }
  36.  
  37. ////////////////////// getShop for crew \\\\\\\\\\\\\\\\\\\\\\\\\
  38. ###################### Example (Save Client data) ######################
  39. Client client;
  40. client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "email", "password", null);
  41.  
  42. ###################### Example (Connect to lobby) ######################
  43. Connection con;
  44. co = client.Multiplayer.CreateJoinRoom(CrewID, "CrewLobby" + client.BigDB.Load("config", "config")["version"], false, null, null);
  45. con.Send("getShop");
  46.  
  47. Don't forget to add a message handler. Add "getShop" and "useEnergy" to the message handler.
  48. Now when you sent getShop you should receive a lot of messages in message handler.
  49. To sort out them, so everything works like it should. Use following code.
  50.  
  51. The messages contains 15 lines, with shopData informations.
  52. And to start read the messages. We start at line 5 and goes to message count ends.
  53.  
  54.  
  55. ###################### Example (Sort out lines/Reading getShop) ######################
  56. uint total = 16; // Messages contains 16 lines of data
  57. uint x = 5; // We start at 5 to read the data we need
  58. while (x < m.Count)
  59. {
  60.         if (m.GetString(x) == "world0")
  61.         {
  62.                 Console.WriteLine("This item is a world0 " + "And it costs: " + m.GetInt(x + 2));
  63.         }
  64.         x = x + total; // Here do we update the x with 15 so we can get the correct data from the lines.
  65. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top