We need to use local storage when testing our works. To use local storage, perform the following steps:
1 – Install Azure Storage Emulator and put the installation path in the Path environment.
2 – We have the following Apps: Server, Website, WebAPI, the Bootstrapper, the GAME, and other tools.
3 – To test something on the Web API, run it in Visual Studio and it will work in local storage automatically (if you test by Swagger, Fiddler, Postman …・etc.)
4 – To test the Website, make sure that you have a record in the Player table and UserIdToPlayerId table. If you need to be an Admin, ask the Project Leader.
Login to the game by any login Provider to register yourself. If you run from the website the data will appear to come from Production Storage. To change that, run the webapi locally from Visual Studio and make the website listen to it.
– To can make the website listen to the Local webapi:
From app settings in Web.Config file change the value of Key WebApiUrl to Local url.
5 – To test the Server, run the Bootstrapper on your physical device. This will ensure you are registering your server id to local storage. in BallisticServer Table.
Note: To make Server Authenticated to the web api, use public & private Keys by requesting POST method of SecurityApiController, store the returns Keys in app.config file.
– To run the Bootstrapper, first make BallisticAgentServer.exe listen to the WebAPI that is running locally (by change the value of the key “SyncAPIBaseAddress” in App.Config file to API local url), build changes
– Second, install Bootstrapper service in Windows, from “InstallBootsrapper.ps1” (just run this file by Powershell as Administrator ). Note: if error raised solve it by that
– after making sure it is running as a background app, make sure from running the Api locally as well.
Third, start Photon as an application and it will run locally.
Note: check the log as needed (we have 3 logs first one for the Server in C:\Temp and the 2nd one for the photon itself you will find it in the Photon bits “C:\Photon\bin_Win64\log”, the last one for the bootstrapper this will be inside the bin folder of your ballistic server agent project )
6- you don’t need to run the server with Bootstrapper all the time. as long as the server node has record in “BallisticServer” table, you can run any photon in your device in local storage .
7 – If you want to make the local server work on Staging or Production, change the connection string type (from the dashboard web page) for your server Id / server Name. If you are not an Admin, you may ask an Admin to do this for you.