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
46
13%
I play on Windows server and I don't use it
34
10%
I play on iOS/Android server and I use Layout Manager
119
34%
I play on iOS/Android server and I don't use it
147
42%
Total votes: 346

User avatar
Sigma582
Admiral
Posts: 600

Tool to Save/Load SWC Base Layout

Post#1 » Wed Mar 29, 2017 7:11 pm

Hello Fellow Commanders,

Let me introduce you SWC Layout manager - my new tool designed to quickly save and load SWC base layout. It has been tested by me and my squadmates, and other Players on many bases of different levels and both factions and works pretty well.

  • Layout manager allows you to save your current regular/war layout to a file on your hard drive and quickly update your regular/war base with previously saved layout.
  • It now only works for iOS/Android accounts (Windows Support has been removed) and doesn't support exchanging layouts between different players.
The current version can be found at the bottom of this Main Thread Post.

I promise I didn't add any malicious code but it's always a good idea to check archives and programs downloaded from the Internet with your antivirus before opening.

To access your base Layout manager needs playerprefs.dat file which contains account logon info along with some settings. The program works locally on your PC and doesn't send your data anywhere except SWC game server.

Warnings and Cautions:

    Don't share your playerprefs.dat file or its contents with anyone. It's also a good idea to store a copy of this file somewhere on your private cloud, on a flash drive or at any other safe and private location. In case of data loss (hard drive died, bad update screwed the game, kids deleted the game, etc.) this file will allow you to easily restore your base. Facebook sync does fail sometimes but playerprefs file always works.
Known limitations:

  • Junk/rocks on your base may affect the process if they get in the way of buildings (will cause Status 1010 error). It's better to remove the junk before loading another layout.
  • If you add a new structure to the base and try to load previously saved layout which doesn't contain the new structure the latter won't be moved. If it gets in the way of other buildings the layout won't be applied (Status 1010 error).
Bottom line:

Although the tool is stable and does perform its core function, it's still being developed and improved. There are a lot of features to add, including proper user interface.

Please leave your feedback, success stories, issues, ideas and whatever you have to say.

May the Force be with you.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

LATEST RELEASE - VERSION HISTORY - MANUALS

  1. Latest Release - 2017-09-18:

  2. Layout Manager Version History:

    • 2017-09-18 - Version 1.4.1

    • 2017-08-29 - Version 1.3. - Added ability to read Player Id and Player Secret from FB Gameroom if you have it installed (see Manual Below).
    • 2017-08-29 - Version 1.2. - Fixed saving war layout during active phase of a war.
    • 2017-08-28 - Version 1.1. - Now it supports loading layouts across bases.

      • Layout file from other Faction can now be loaded.
      • Layout file format optimized to take up less space. You still can load files saved by previous versions though, they are 100% compatible.
      • Additional config parameter called "messageManagerRetryCount". It's a bit geeky and most people can disregard this but increasing it may help those who still experience Status 909/911 errors.
    • 2017-06-27 - Version 1.0. - First Stable Release

      • Fixed Status 909/911 error.
      • Removed Windows server support.
      • Tidied up the UI a bit.
    • 2017-04-12 - Version 0.6. - Added support for Android/iOS accounts.
    • 2017-03-29 - Version 0.5. - Windows support Only.
  3. Instruction Manuals:

    1. The tool has pretty simple and self-explanatory interface but here's a short list of instructions:

      1. First of all you need to obtain your Player ID and Player Secret. Follow instruction guides linked below to get them (it has to be done once and takes about 10-15 minutes).

        • After you have Player ID and Player Secret written down somewhere just start LayoutManager, paste them to corresponding fields and click Login.
      2. Click Save Regular or Save War to save your current normal/war layout to a file on your disk. Buildings location is saved in a text file with *.json extension.

      3. Click Load Regular or Load War and select a previously saved layout file to apply its contents to normal or war base respectively.
    2. How To Use New Gameroom Feature:

      1. Connect your SWC base to your Facebook account (you should do it anyway to be able to recover your base in case you lose it due to device issues or SWC failure).
      2. Install Facebook Gameroom.
      3. Log in to Gameroom with the same FB account you have connected your base to.
      4. Find Star Wars Commander in Gameroom and click Play Now.
      5. After that you will be able to start Layout Manager, click "FB Gameroom" button and it will populate Player Id and Player Secret fields for you. No need to go deep with android emulators and other geeky stuff!
    3. Instructions on Obtaining Player Secret for Android/iOS/FB Gameroom Users
      Credit goes to lrspartan aka Shock Trp Will from sith_squad for writing the above manual.

    4. Guide on Obtaining Player Secret for iOS Users.
      I must thank Sabony from VaderMarines squad for writing the above manual. This method doesn't involve root access or emulators but you still need to install some Apple software on your PC.
Last edited by DeathStriker on Mon Sep 18, 2017 3:00 pm, edited 24 times in total.


User avatar
Spock
Admiral
Posts: 690

Re: Tool to save/load SWC base loadout

Post#2 » Wed Mar 29, 2017 7:15 pm

While I am not a Windows player and this tool won't help me I want to be the first to congratulate you! What an amazing tool and a great idea!
Thanks for putting the time into making it a reality and good luck with making an iOS/android version.
Keep us posted with your progress :)
Image

Leader of the imperial_enclave. Flagship of the enclave brotherhood of squads.
Always looking for active lvl10 commanders. Line app required.


User avatar
Sigma582
Admiral
Posts: 600

Re: Tool to save/load SWC base loadout

Post#3 » Wed Mar 29, 2017 7:24 pm

Spock wrote:...

Thanks Spock.
I think I will make iOS/Android support my first priority but I have a technical issue blocking me. To connect to player's base we need playerprefs.dat file. I'm not an iOS or Android user myself and I struggle to find a way to retrieve this file from game data. Still experimenting with Bluestacks (Android emulator) but no luck so far. If any experienced iOS and Android users could guide me on this matter it would be tremendous help for the project.
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
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#4 » Wed Mar 29, 2017 8:23 pm

tat ok?

Code: Select all

using System.Linq;
using SWC.Tools.Common.Layout;
using SWC.Tools.Common.Networking;
using SWC.Tools.Common.Networking.Json.CommandArgs;

namespace SWC.Tools.TestConsole
{
    internal class Program
    {
        public static void Main(string[] args)
        {


        }
    }
}


User avatar
Rebelscummer
Commodore
Posts: 242

Re: Tool to Save/Load SWC Base Layout

Post#5 » Wed Mar 29, 2017 9:55 pm

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.


User avatar
Sigma582
Admiral
Posts: 600

Re: Tool to Save/Load SWC Base Layout

Post#6 » Thu Mar 30, 2017 4:16 am

joshuatee wrote:tat ok?

test console.
look in SWC.Tools.LayoutManager and SWC.Tools.Common folders for real stuff.

Rebelscummer 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.
What's the issue about copyright? I didn't use any bit of Disney's code. My app talks to server's API and in this sense it's no different from Kender's ranking site.
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: 4460

Re: Tool to Save/Load SWC Base Layout

Post#7 » Thu Mar 30, 2017 5:00 am

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.

The one "advantage" that Windows has over iOS/Android is access to the Players game data stored on their Game Device.

For Windows one could simply use a DOS Bat file to move a copy of "Playerspref" to another directory and rename the moved file as "Playerspref (Backup)". Another DOS Bat File could do the reverse.

For iOS/Android they must rely on other "Backup Methods" like syncing with Facebook.

I think this "tool" is just another way for SWC Windows Players to prepare for and recover from fatal crashes of their SWC game.

I applaud this effort.
 
Image
Death_Striker is looking for ALL Rebel Commanders
Sons_of_Death is looking for Level 8+ Rebel Commanders
If YOU Want to War - Apply Now!


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#8 » Thu Mar 30, 2017 6:01 am

Sigma582 wrote: ...

Great job! or at least nice idea -- I haven't had a look at it yet but I was thinking along the same lines :)

Rebelscummer wrote: Why would you temper with the code and post it here??? I do believe it's a copyrighted program.

BS, no one has ever "tempered" with the code. Sigma probably didn't even have a look at it


User avatar
Pirate
Major General
Posts: 491

Re: Tool to Save/Load SWC Base Layout

Post#9 » Thu Mar 30, 2017 9:00 am

Great work, thank you for sharing. I am interested to try this out.
ⒹⒶⓇⓀⓈⒾⒹⒺ
Imperial Squad

Windows Survivor


User avatar
joshuatee
Captain
Posts: 95

Re: Tool to Save/Load SWC Base Layout

Post#10 » Thu Mar 30, 2017 9:34 am

Sigma582 wrote:I plan to add support for iOS/Android accounts


the interesting part is if they have a playerprefs.dat file or the storage is provided by some platform specific mechanism. I'm unable to figure this out, not at first glance

Image

Code: Select all

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Internal;

namespace UnityEngine
{
   public sealed class PlayerPrefs
   {
      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      private static extern bool TrySetInt(string key, int value);

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      private static extern bool TrySetFloat(string key, float value);

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      private static extern bool TrySetSetString(string key, string value);

      public static void SetInt(string key, int value)
      {
         if (!PlayerPrefs.TrySetInt(key, value))
         {
            throw new PlayerPrefsException("Could not store preference value");
         }
      }

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern int GetInt(string key, [DefaultValue("0")] int defaultValue);

      [ExcludeFromDocs]
      public static int GetInt(string key)
      {
         int defaultValue = 0;
         return PlayerPrefs.GetInt(key, defaultValue);
      }

      public static void SetFloat(string key, float value)
      {
         if (!PlayerPrefs.TrySetFloat(key, value))
         {
            throw new PlayerPrefsException("Could not store preference value");
         }
      }

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern float GetFloat(string key, [DefaultValue("0.0F")] float defaultValue);

      [ExcludeFromDocs]
      public static float GetFloat(string key)
      {
         float defaultValue = 0f;
         return PlayerPrefs.GetFloat(key, defaultValue);
      }

      public static void SetString(string key, string value)
      {
         if (!PlayerPrefs.TrySetSetString(key, value))
         {
            throw new PlayerPrefsException("Could not store preference value");
         }
      }

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern string GetString(string key, [DefaultValue("\"\"")] string defaultValue);

      [ExcludeFromDocs]
      public static string GetString(string key)
      {
         string empty = string.Empty;
         return PlayerPrefs.GetString(key, empty);
      }

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern bool HasKey(string key);

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern void DeleteKey(string key);

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern void DeleteAll();

      [WrapperlessIcall]
      [MethodImpl(MethodImplOptions.InternalCall)]
      public static extern void Save();
   }
}



Return to “General Discussions”

Who is online

Users browsing this forum: Bing [Bot], Facebook [Bot], GER, Google [Bot], Google Adsense [Bot], jaybinx, Josketer, RMick3, shazahm1, TSQL, wesman21 and 39 guests