Tool to Save/Load SWC Base Layout

General topics, questions, suggestions, bugs, or anything Star Wars Commander related.

Poll: Usage statistics

I play on Windows server and I use Layout Manager
61
13%
I play on Windows server and I don't use it
44
9%
I play on iOS/Android server and I use Layout Manager
153
33%
I play on iOS/Android server and I don't use it
207
45%
Total votes: 465

User avatar
Rebelscummer
Major General
Posts: 382

Re: Tool to Save/Load SWC Base Layout

Post#11 » Fri Mar 31, 2017 5:59 pm

DeathStriker wrote:
Sigma582 wrote:
Rebelscummer wrote:I would suggest you post that info on your private FB page and not on this forum. Many Windows players relay on the playerprefs.dat file to recover their accounts from fatal crashes. Who knows what the devs would do about it now. Why would you temper with the code and post it here??? I do believe it's a copyrighted program.

Why post here? Because I want to make players' life easier obviously.

Info about playerprefs-based recovery was on Playdom forum for ages. It also has been mentioned on this forum quite a few times. Devs know it's public and don't seem to have problems with it.

Sigma582 is correct - the info about the Windows SWC Playerspref file has long been advertised.


I know, but I don't think we should brag about it. I've never heard devs commenting or encouraging people to search for playerprefs.dat file in your hidden root folders on your PC. This file is the only option, for people who have no FB, to recover their accounts.


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#12 » Fri Mar 31, 2017 6:21 pm

Rebelscummer wrote:
DeathStriker wrote:
Sigma582 wrote:Why post here? Because I want to make players' life easier obviously.

Info about playerprefs-based recovery was on Playdom forum for ages. It also has been mentioned on this forum quite a few times. Devs know it's public and don't seem to have problems with it.

Sigma582 is correct - the info about the Windows SWC Playerspref file has long been advertised.


I know, but I don't think we should brag about it. I've never heard devs commenting or encouraging people to search for playerprefs.dat file in your hidden root folders on your PC. This file is the only option, for people who have no FB, to recover their accounts.



why not? :oops:


User avatar
DarthVacc
Major General
Posts: 258

Re: Tool to Save/Load SWC Base Layout

Post#13 » Fri Mar 31, 2017 6:25 pm

Posting on here simply so I don't miss when this tool becomes available for iOS/Android users. :)

Great idea! Corrects a void the game should've filled a long time ago... in a galaxy... oh nm...
Image

Rank 15 Commander - Lvl10 HQ - 57k+ Medals
Officer - EastCoastRaiders - #272 Squad Worldwide - lvl48 Perks - 490k+ Squad Medals


User avatar
Midge
Grand Admiral
Posts: 1244

Re: Tool to Save/Load SWC Base Layout

Post#14 » Fri Mar 31, 2017 6:29 pm

Wow ... this would be awesome for iOS ... looking forward to it!!
Leader of The Mob Syndicate

Home of TheMidnightMob, TheMorningMob, TheMiddayMob and TheMobWantsYou

Level X Rebel : Medal Maxed


User avatar
SFOne
Commodore
Posts: 111

Re: Tool to Save/Load SWC Base Layout

Post#15 » Sat Apr 01, 2017 3:23 pm

Gonna test this out for windows! Awesome work rebelscummer. Even in my short time I've seen this requested so many times and awesome to see it now exists!
Rebel Level 10 80k+
Proud member of TheMidnightMob

SWC Tools For Android
  • Releases: https://github.com/DaveCMo/Android-SWC-Tools/releases
  • https://youtu.be/8rPACDDEWhg


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#16 » Sat Apr 01, 2017 3:32 pm

SFOne wrote: Gonna test this out for windows! Awesome work rebelscummer


gee, kids nevah read ; (


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#17 » Sat Apr 01, 2017 4:17 pm

Rebelscummer wrote: hidden root


it gets worse :(

Code: Select all

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\joshu> Get-AppxPackage *dis*


Name              : Disney.StarWarsCommander
Publisher         : CN=58DECE39-D5D0-4293-AAA0-9AF8484F12E2
Architecture      : X86
ResourceId        :
Version           : 4.7.0.2
PackageFullName   : Disney.StarWarsCommander_4.7.0.2_x86__6rarf9sa4v8jt
InstallLocation   : C:\Program Files\WindowsApps\Disney.StarWarsCommander_4.7.0.2_x86__6rarf9sa4v8jt
IsFramework       : False
PackageFamilyName : Disney.StarWarsCommander_6rarf9sa4v8jt
PublisherId       : 6rarf9sa4v8jt
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
Dependencies      : {Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe}



PS C:\Users\joshu>


PS

note im not on a admin account


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#18 » Sat Apr 01, 2017 8:37 pm

Quick update on the project status.

Before adding new functionality I decided to focus on Android/iOS accounts support. Obtaining player prefs directly from devices turned out to require root access to application files. I think it's not a good idea to root your device just for the sake of added convenience when playing a game, and many players would reasonably refuse to go that way.

So I took alternative route - utilize Facebook authorization to connect to player's base. In order to use the layout tool with an Android/iOS SWC account you will need to connect your game to Facebook via in-game settings (if you haven't done it yet) and then connect Layout Manager to the same FB account just once. Layout Manager will use Facebook's response to obtain your SWC logon data and save this data on your PC. After that you will be able to manipulate your layout via Layout manager with no additional hassle.

After some substantial f*ckung with Andydroid, Fiddler and SSL certificates I managed to capture network traffic from Android version of SWC and learned which messages should be sent to SWC server to load base using FB auth data. It will take me a while to figure out how Facebook login works and to implement all necessary stuff, but at least now I know what to do.

Stay tuned!

PS: while we wait, I'd love to see opinions about the application idea and this connection method - will it be convenient for you, do you have any concerns, what kind of functionality would you like to have in this tool?
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


User avatar
DeathStriker
Moderator
Posts: 7186

Re: Tool to Save/Load SWC Base Layout

Post#19 » Sun Apr 02, 2017 7:25 am

Sigma582 wrote:Quick update on the project status.

Before adding new functionality I decided to focus on Android/iOS accounts support.

...

Stay tuned!

PS: while we wait, I'd love to see opinions about the application idea and this connection method - will it be convenient for you, do you have any concerns, what kind of functionality would you like to have in this tool?

Sigma582 - I applaud your efforts.

As a iOS User I occasionally login to Facebook to update "On-Line Back-Up Copy" but I don't play day-to-day with me being logged in to Facebook. I don't use iOS - Game Center (another source of Base Data).

Even with me not being logged into Facebook my Base continues to be able to Upgraded and as such the Client Copy of the Base remains "current" while the Back-Up Copy remains "snapshots" in time.

Now if I used (for iOS) constant Login to Facebook and/or Game Center than both the Client Copy and Back-Up copy would remain "current".

MY CONCERNS:

  1. Security: If someone provide your Application / Program their Login Credentials for Facebook or Game Center (which use a users Apple ID) or Google Play, how will they know that these Login Credentials will NOT be used by "others" to do malicious acts.
  2. Safety: It would be far better to develop something that only reads the Client Copy, and not the On-Line Back-Up Copy requiring the input of User-ID's/Passwords, and simply performs a duplication / storage of the Client Copy on the Clients Device (Client Back-Up Copy) which has its own Back-Up system (like iCloud) and do the reverse of read Client Back-Up Copy and overwrite Client-Copy. If a failure occurs with the latter (restore from Client-Back-Up) the User will still be able to use the un-touch On-Line Back-Up Copies on Facebook and/or Game Center / Google-Play.
  3. Cheating: It is possible for someone to use your Tool to "cheat" in that they will have access to the "Base Data" and by use of various means manipulate the "data" to enable them to "cheat" like have more structures than normal like 2 or more Cantinas or 5 more Turrets, etc. The use of some "encryption" with the Client Back-Up Copy may prevent this.
I would consider looking at your Tool provided you could make it a iTunes downloadable App and the same for Android Users being able to download it from Google Play.

As you move forward perhaps you should address my CONCERNS not only for iOS/Android but Windows as well.

One last thing... perhaps this Tool Development could get help via use of GitHub.

Here's to your efforts and interest in trying to make things better for Players everywhere.
 
Image
It has been an honor and a privilege helping the SWC Community. MTFBWYA


User avatar
Sigma582
Admiral
Posts: 595

Re: Tool to Save/Load SWC Base Layout

Post#20 » Sun Apr 02, 2017 11:18 am

Thanks DS for things to think about.
I'll try to go through your post to work out unclear points. Sorry in advance, there will be lots of words. I'll try to highlight the most important bits though.

First of all, I'm afraid you are a bit confused by how your base is "backed up" by FB link. Facebook (or Game Center) doesn't hold your base. When you log in to the game via FB the following sequence occurs:

  1. SWC tells FB: this guy wants to authorize via your OAuth. Gimme your authentication page.
  2. FB replies with a small web page and SWC displays it right in the game.
  3. You enter your FB login and password. They don't go to SWC server, you send them directly to FB.
  4. FB checks your username and password and tells SWC: This is John Smith, FB ID 1234567890.
  5. SWC tells SWC server: FB said that this player has FB ID 1234567890. Let's register him.
  6. SWC server saves info that the said FB ID corresponds to your base (links the FB ID to your player ID)

When you have wiped your game or gt a new device and log in to SWC via FB to load your old base the sequence is almost the same but differs in the end:

  1. -
  2. -
  3. -
  4. -
  5. -
  6. SWC server replies to the game: I already have another player ID linked to the same FB ID. (passes info about the old base)
  7. SWC shows you a message: This base is linked to your FB account. Do you want to load your old base or overwrite it with the new one?
  8. You click Load and the game uses info from step 6 to log in to your old base. It saves this login info locally on your device so that when you open the game the next time you will log in to the loaded (old) base.

This means, it doesn't matter how long ago you established link to FB, if you use FB link to load your base on another device you always get the latest (and the only) version of your base.
When you click Disconnect from FB in SWC this link between Player ID and FB ID is supposed to be removed from SWC server and you will no longer be able to load that base via FB login.

Now let's get to the concerns mentioned.

DeathStriker wrote:Security: If someone provide your Application / Program their Login Credentials for Facebook or Game Center (which use a users Apple ID) or Google Play, how will they know that these Login Credentials will NOT be used by "others" to do malicious acts.

Answer to this question will consist of three parts.
First, as shown above, when you login to any application/website via FB, OAuth mechanism is used to prevent this application/website from obtaining your FB credentials. Neither SWC nor Layout Manager will ever get access to your FB password.
Second, all communications LM engaged in will remain between your PC and SWC server (and FB in one partticular scenario). No data will be sent to any other network location or 3rd party server. I don't even want to gather "anonymous usage statistics". No connections except SWC server and FB, period.
The last but not the least, having all the source code published on GitHub allows "community audit" to ensure the first two principles are followed. Everyone who can read code will be able to inspect what the application actually programmed to do and in case they suspect any dodgy bits and pieces they would alarm everyone against using the software.

DeathStriker wrote:Safety: It would be far better to develop something that only reads the Client Copy, and not the On-Line Back-Up Copy requiring the input of User-ID's/Passwords, and simply performs a duplication / storage of the Client Copy on the Clients Device (Client Back-Up Copy) which has its own Back-Up system (like iCloud) and do the reverse of read Client Back-Up Copy and overwrite Client-Copy. If a failure occurs with the latter (restore from Client-Back-Up) the User will still be able to use the un-touch On-Line Back-Up Copies on Facebook and/or Game Center / Google-Play.

Again,there are no other copies of the base, except the one stored on SWC server(DI folks are supposed to make back ups of their data but this is out of our scope). SWC client only stores your login info (player ID and player secret) and uses them to load your base from the server every time you open the app. As LM can't obtain this login data from SWC client directly (due to Android and iOS platforms restrictions), we have to utilize FB sync feature to get them. Once LM obtains player ID and player secret it will store them on your PC and use to send SWC server commands to move structures on your base. (I think of encrypting login data held by LM but it's probably an overkill)

DeathStriker wrote:Cheating: It is possible for someone to use your Tool to "cheat" in that they will have access to the "Base Data" and by use of various means manipulate the "data" to enable them to "cheat" like have more structures than normal like 2 or more Cantinas or 5 more Turrets, etc. The use of some "encryption" with the Client Back-Up Copy may prevent this.

Luckily SWC server does all necessary validation when you tell it to manipulate your base.It's impossible to make the server do things it doesn't allow.To move buildings both SWC client and LM send the server a command which is called "player.building.multimove". Parameters to the command are a list of new coordinates for the buildings you move in the following format: "bld_123" : { x:10, z:20 } where bld_123 is structure's ID (unique within your base), 10 and 20 are new coordinates for the structure. There is no way to say "place lvl10 turret here", the server knows that bld_123 is a lvl7 barrack and bld_456 is lvl8 turret (for example). If building with the specified ID doesn't exist in the base - the whole command won't be executed and the base won't change. So you just can't make the server add you new structures or change the existing ones. (Theoretically you can issue a command to start upgrading one but the server will validate if your HQ level allows that, you have enough resources and a free droid; I'm not going to implement this type of commands in LM - SWC client does that well.)

DeathStriker wrote:I would consider looking at your Tool provided you could make it a iTunes downloadable App and the same for Android Users being able to download it from Google Play.

I write LM using C# language and .Net platform. SWC is based on Unity Framework which in turn uses Mono which is a cross-platform .Net runtime. This means that theoretically I can get LM running on iOS/Android too. But I'm completely unfamiliar with iTunes and Google Play certification process so it will be a fair bit of hassle.
In terms ofprioritymy list is:
  1. Allow iOS/Android accounts owners to manipulate their bases via Windows-based application (everyone has a Windows PC/laptop at home, right?).
  2. Add additional functionality (exchange layouts with friends and some smaller but useful things).
  3. When everything is functional I will look into delivering the tool to Windows Store, iTunes and Google Play.

DeathStriker wrote:Perhaps this Tool Development could get help via use of GitHub.

The source code is already on GitHub and everyone can inspect it. I don't accept pull requests yet (i.e. others can't commit their changes to the code) but will consider doing that after I sort out the basics. If there are people willing to contribute of course. :)
Image
New home of former Windows IMPERIALS® squad. PM me to join us on Android server.
-
Layout Manager
http://www.swcommander.com/viewtopic.php?f=31&t=19986
-
Defense Tracker
http://www.swcommander.com/viewtopic.php?f=31&t=20403


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 49 guests