public ActionResult SignOnToDefendEarth(string userName) { var encryption = new SymmetricEncryption("blahblah"); var decryptedUserName = encryption.Decrypt(userName); var server = new AlienInvasionServer(); var cityId = server.GetCurrentCity(decryptedUserName); return File(BitConverter.GetBytes(cityId), "application/x-alien-invasion-city"); }
public ActionResult ReportInvasionResultAndGetNextCity(string userName, bool failedToDefend) { var encryption = new SymmetricEncryption("blahblah" + failedToDefend); var decryptedUserName = encryption.Decrypt(userName); var server = new AlienInvasionServer(); var cityId = server.ReportInvasionResultAndGetNextCity(decryptedUserName, failedToDefend); return File(BitConverter.GetBytes(cityId), "application/x-alien-invasion-city"); }