Web Save basic

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Web Save basic

Post by Joel »

If you're using UploadFile, you will only be able to download the entire file, not the individual tags from the file.

Just a quick note: If you're uploading each tag individually, you can append the user's username to the tag instead. It's also valid to upload some data with UploadFile, and other pieces of data with the normal Upload method.

- Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Web Save basic

Post by gozda »

Why in PhpMyAdmin i cant see any data under Tag "myTag" from your example scene? i just see empty field.

thanks
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Web Save basic

Post by Joel »

Data is stored in binary format, so the data itself won't be readable in PHPMyAdmin, but it is there.

If you require readable data, you can upload raw strings to the database using ES2Web.UploadRaw and ES2Web.LoadRaw. To do this, you will also need to change the type of the data field from MEDIUMBLOB to VARCHAR(1024).

- Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Web Save basic

Post by gozda »

So the best things for what you can use DB is keep save progres from player and load it when you need. But what if i want use DB for other stuff, like get list of players what are stored in DB.

For example: Simple game. player1 search for online or offline player2 (in DB) and make a challenge(just who get highter number)
When player1 find any player2, system pick random number for player1, and send challegne to player2. Player2 can accept this challenge or decline (now or in future, even if player1 is offline), when player2 accept challenge, system pick for this player random number and just recotnized who win.

How can i use DB for this kind of game?
i want to get list of all players in DB, challenge someone and keept my random number in DB. When player2 accept challenge he must just get p1 number from DB and put in player1 DB his random number. But he need everytime download file, put variables in it and upload to server? What if 20 ppl will challenge me in the same time?

This kind of game is even possible?

Thanks.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Web Save basic

Post by Joel »

Generally you would make a bespoke solution to do something like this, because there isn't really going to be an 'ready-made' solution for this (not a secure solution anyway).

As mentioned before, Easy Save's database integration is only intended to store save data. Communication between players in that way isn't really the intended use of a Save/Load plugin.

If you use the user's username as the webfilename, you may be able to use ES2Web.GetFilenames to get a list of all players and perform your logic on the client side, but I really wouldn't advise it.

- Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
gozda
Posts: 45
Joined: Wed Jun 24, 2015 3:14 pm

Re: Web Save basic

Post by gozda »

Ok, very thanks for help i think i know all what i want to know.
Still i thinking ES2 is one of best must have plugin for Unity.
Thanks for your time and your patient.

Best regards,
Gozda
Locked