code
stringlengths 57
237k
|
|---|
package projects.tanks.client.panel.model.bonus.showing.info {
public interface IBonusInfoModelBase {
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.helper {
public interface IHelpService {
function registerHelper(param1:String, param2:int, param3:Helper, param4:Boolean) : void;
function unregisterHelper(param1:String, param2:int) : void;
function showHelper(param1:String, param2:int, param3:Boolean = false) : void;
function showHelperIfAble(param1:String, param2:int, param3:Boolean = false) : void;
function hideHelper(param1:String, param2:int) : void;
function hideAllHelpers() : void;
function showHelp() : void;
function hideHelp() : void;
function pushState() : void;
function popState() : void;
function lock() : void;
function unlock() : void;
function manuallyShutDownHelper(param1:Helper) : void;
}
}
|
package alternativa.tanks.utils.objectpool
{
import flash.utils.Dictionary;
public class ObjectPool
{
private var pools:Dictionary;
public function ObjectPool()
{
this.pools = new Dictionary();
super();
}
public function getObject(objectClass:Class) : Object
{
var pool:Pool = this.pools[objectClass];
if(pool == null)
{
this.pools[objectClass] = pool = new Pool();
}
var object:Object = pool.getObject();
return object == null ? new objectClass(this) : object;
}
function putObject(objectClass:Class, object:Object) : void
{
var pool:Pool = this.pools[objectClass];
if(pool == null)
{
this.pools[objectClass] = pool = new Pool();
}
pool.putObject(object);
}
public function clear() : void
{
var key:* = undefined;
for(key in this.pools)
{
Pool(this.pools[key]).clear();
delete this.pools[key];
}
}
}
}
class Pool
{
private var objects:Vector.<Object>;
private var numObjects:int;
function Pool()
{
this.objects = new Vector.<Object>();
super();
}
public function getObject() : Object
{
if(this.numObjects == 0)
{
return null;
}
var object:Object = this.objects[--this.numObjects];
this.objects[this.numObjects] = null;
return object;
}
public function putObject(object:Object) : void
{
var _loc2_:* = this.numObjects++;
this.objects[_loc2_] = object;
}
public function clear() : void
{
this.objects.length = 0;
this.numObjects = 0;
}
}
|
package _codec.projects.tanks.client.garage.models.item.modification {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.garage.models.item.modification.ModificationCC;
public class VectorCodecModificationCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecModificationCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(ModificationCC,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = int(LengthCodecHelper.decodeLength(param1));
var local3:Vector.<ModificationCC> = new Vector.<ModificationCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = ModificationCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:ModificationCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<ModificationCC> = Vector.<ModificationCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package _codec.projects.tanks.client.garage.models.item.premium {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.garage.models.item.premium.PremiumItemCC;
public class CodecPremiumItemCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_premiumItem:ICodec;
public function CodecPremiumItemCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_premiumItem = param1.getCodec(new TypeCodecInfo(Boolean,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:PremiumItemCC = new PremiumItemCC();
local2.premiumItem = this.codec_premiumItem.decode(param1) as Boolean;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:PremiumItemCC = PremiumItemCC(param2);
this.codec_premiumItem.encode(param1,local3.premiumItem);
}
}
}
|
package projects.tanks.client.entrance.model.entrance.loginbyhash {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
public class LoginByHashModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:LoginByHashModelServer;
private var client:ILoginByHashModelBase = ILoginByHashModelBase(this);
private var modelId:Long = Long.getLong(1662174151,-1895153624);
private var _loginByHashFailedId:Long = Long.getLong(2026019693,504774578);
private var _loginBySingleUseHashFailedId:Long = Long.getLong(1347129984,911924633);
private var _rememberAccountId:Long = Long.getLong(1836812020,986666173);
private var _rememberAccount_hashCodec:ICodec;
private var _rememberUsersHashId:Long = Long.getLong(55211289,-1109675316);
private var _rememberUsersHash_hashCodec:ICodec;
public function LoginByHashModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new LoginByHashModelServer(IModel(this));
this._rememberAccount_hashCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
this._rememberUsersHash_hashCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._loginByHashFailedId:
this.client.loginByHashFailed();
break;
case this._loginBySingleUseHashFailedId:
this.client.loginBySingleUseHashFailed();
break;
case this._rememberAccountId:
this.client.rememberAccount(String(this._rememberAccount_hashCodec.decode(param2)));
break;
case this._rememberUsersHashId:
this.client.rememberUsersHash(String(this._rememberUsersHash_hashCodec.decode(param2)));
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package _codec.projects.tanks.client.panel.model.payment.modes.sms.types {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.payment.modes.sms.types.SMSOperator;
public class VectorCodecSMSOperatorLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecSMSOperatorLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(SMSOperator,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = LengthCodecHelper.decodeLength(param1);
var local3:Vector.<SMSOperator> = new Vector.<SMSOperator>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = SMSOperator(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:SMSOperator = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<SMSOperator> = Vector.<SMSOperator>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.view.forms {
import alternativa.osgi.service.display.IDisplay;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.controller.events.AccountLoginPressed;
import alternativa.tanks.controller.events.LoginButtonPressed;
import alternativa.tanks.controller.events.NavigationEvent;
import alternativa.tanks.controller.events.google.GoogleLoginEvent;
import alternativa.tanks.controller.events.socialnetwork.StartExternalEntranceEvent;
import alternativa.tanks.loader.ILoaderWindowService;
import alternativa.tanks.service.IExternalEntranceService;
import alternativa.tanks.service.IRegistrationUXService;
import alternativa.tanks.view.bubbles.Bubble;
import alternativa.tanks.view.bubbles.EntranceBubbleFactory;
import alternativa.tanks.view.forms.commons.RegistrationCommonElementsSection;
import alternativa.tanks.view.forms.primivites.Alert;
import alternativa.tanks.view.forms.primivites.ValidationIcon;
import alternativa.tanks.view.registration.ExternalEntranceForm;
import controls.base.DefaultButtonBase;
import controls.base.LabelBase;
import controls.base.PasswordInput;
import controls.base.TankInputBase;
import controls.checkbox.CheckBoxBase;
import controls.dropdownlist.AccountsList;
import flash.display.Bitmap;
import flash.display.InteractiveObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.external.ExternalInterface;
import flash.net.SharedObject;
import flash.ui.Keyboard;
import flash.utils.Timer;
import forms.TankWindowWithHeader;
import forms.events.LoginFormEvent;
import org.robotlegs.core.IInjector;
import projects.tanks.clients.flash.commons.models.captcha.CaptchaSection;
import projects.tanks.clients.flash.commons.models.captcha.RefreshCaptchaClickedEvent;
import projects.tanks.clients.flash.commons.services.validate.IValidateService;
import projects.tanks.clients.flash.commons.services.validate.ValidateService;
import projects.tanks.clients.fp10.libraries.TanksLocale;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
public class LoginForm extends Sprite {
[Inject]
public static var externalEntranceService:IExternalEntranceService;
[Inject]
public static var display:IDisplay;
[Inject]
public static var validateService:IValidateService;
[Inject]
public static var registrationUXService:IRegistrationUXService;
[Inject]
public static var storageService:IStorageService;
[Inject]
public static var loaderWindowService:ILoaderWindowService;
[Inject]
public var localeService:ILocaleService;
[Inject]
public var injector:IInjector;
public var _callSignOrEmail:TankInputBase;
public var restoreLink:LabelBase;
private var _password:PasswordInput;
public var checkRemember:CheckBoxBase;
public var playButton:DefaultButtonBase;
public var registerButton:LabelBase;
private var checkRememberLabel:LabelBase;
private var accountsList:AccountsList;
private var window:TankWindowWithHeader;
private var snPanel:ExternalEntranceForm;
public var captchaSection:CaptchaSection;
private var accountSelected:Boolean = false;
private var _margin:int = 25;
private var _windowWidth:int = 372;
private var _windowHeight:int = 193;
private var _inputsLeftMargin:int = 72;
private var _symbolIsNotAllowedBubble:Bubble;
private var _callSignCheckIcon:ValidationIcon;
private var _notAllowedShowDelayTimerTimer:Timer;
private var _isAddLoginButtonPressedEventListeners:Boolean;
public function LoginForm() {
super();
}
[PostConstruct]
public function postConstruct() : void {
var buttonWidth:int;
this.window = TankWindowWithHeader.createWindow(TanksLocale.TEXT_HEADER_LOGIN,this._windowWidth,this._windowHeight);
this.restoreLink = new LabelBase();
this.restoreLink.htmlText = this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_RESTORE_LINK_TEXT);
this.restoreLink.x = this._windowWidth - this.restoreLink.width - this._margin;
this.restoreLink.y = this._margin;
this.window.addChild(this.restoreLink);
buttonWidth = 115;
this._callSignOrEmail = new TankInputBase();
this._callSignOrEmail.label = this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_CALLSIGN);
this._callSignOrEmail.maxChars = RegistrationCommonElementsSection.MAX_CHARS_EMAIL;
this._password = new PasswordInput();
this._password.label = this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_PASSWORD);
this._inputsLeftMargin = this._margin - 3 + (Math.abs(this._callSignOrEmail._label.x) > Math.abs(this._password._label.x) ? Math.abs(this._callSignOrEmail._label.x) : Math.abs(this._password._label.x));
this.registerButton = new LabelBase();
this.registerButton.htmlText = "<a href=\'event:\'><font color=\'#59ff32\'><u>" + this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_BUTTON_NEW_PLAYER_TEXT) + "</u></font></a>";
this.registerButton.width = Math.max(this.registerButton.width,buttonWidth);
this.registerButton.x = this._inputsLeftMargin;
this.registerButton.y = this._margin;
this.registerButton.visible = false;
this.window.addChild(this.registerButton);
this._callSignOrEmail.width = this._windowWidth - this._inputsLeftMargin - this._margin;
this._callSignOrEmail.x = this._inputsLeftMargin;
this._callSignOrEmail.y = this._margin + this.restoreLink.height + this._margin / 3;
this._callSignOrEmail.restrict = "@А-Яа-я.0-9a-zA-z_\\-";
this._callSignOrEmail.addEventListener(LoginFormEvent.TEXT_CHANGED,this.onCallsignChanged);
this.accountsList = new AccountsList(this._callSignOrEmail);
this.accountsList.tabChildren = false;
this.accountsList.x = this._callSignOrEmail.x;
this.accountsList.y = this._callSignOrEmail.y + 3;
this.accountsList.addEventListener(Event.CHANGE,this.onAccountChange);
this.accountsList.width = this._windowWidth - this._inputsLeftMargin - this._margin;
this.accountsList.initialize();
this._password.width = this._windowWidth - this._inputsLeftMargin - this._margin;
this._password.x = this._inputsLeftMargin;
this._password.y = this._callSignOrEmail.y + this._callSignOrEmail.height + this._margin / 3;
this._password.hidden = true;
this._password.addEventListener(LoginFormEvent.TEXT_CHANGED,this.onPasswordChanged);
this.window.addChild(this._password);
this._callSignCheckIcon = new ValidationIcon();
this._callSignCheckIcon.x = this._windowWidth - this._margin - this._callSignCheckIcon.width - 10 - (this.accountsList.visible ? 31 : 0);
this._callSignCheckIcon.y = this._callSignOrEmail.y + 7;
this.window.addChild(this._callSignCheckIcon);
this.checkRemember = new CheckBoxBase();
this.checkRemember.x = this._inputsLeftMargin;
this.checkRemember.y = this._windowHeight - this.checkRemember.height - this._margin - 2;
this.window.addChild(this.checkRemember);
this.checkRememberLabel = new LabelBase();
this.checkRememberLabel.x = this.checkRemember.x + this.checkRemember.width;
this.checkRememberLabel.y = this.checkRemember.y + 5;
this.checkRememberLabel.text = this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_REMEMBER);
this.window.addChild(this.checkRememberLabel);
this.playButton = new DefaultButtonBase();
this.playButton.label = this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORD_FORM_PLAY_BUTTON);
this.playButton.width = this.registerButton.width = Math.max(this.playButton.width,this.registerButton.width);
this.playButton.x = this._windowWidth - this._margin - this.playButton.width;
this.playButton.y = this._windowHeight - this.playButton.height - this._margin;
this.window.addChild(this.playButton);
this.captchaSection = this.injector.instantiate(CaptchaSection);
if(Boolean(externalEntranceService.vkontakteEnabled) || Boolean(externalEntranceService.facebookEnabled) || Boolean(externalEntranceService.googleEnabled)) {
this.snPanel = new ExternalEntranceForm(this._windowWidth - 40,85,this.localeService.getText(TanksLocale.TEXT_CHECK_PASSWORK_FORM_LOGIN_VIA));
addChild(this.snPanel);
this.snPanel.y = this.window.y + this.window.height - 15;
this.snPanel.x = this.window.x + (this._windowWidth - this.snPanel.width) / 2;
if(externalEntranceService.vkontakteEnabled) {
this.snPanel.vkButton.addEventListener(MouseEvent.CLICK,this.onVkButtonClick);
}
if(externalEntranceService.facebookEnabled) {
this.snPanel.fbButton.addEventListener(MouseEvent.CLICK,this.onFbButtonClick);
}
if(externalEntranceService.googleEnabled) {
this.snPanel.googleButton.addEventListener(MouseEvent.CLICK,this.onGoogleButtonClick);
}
}
this.window.addChild(this._callSignOrEmail);
this.window.addChild(this.accountsList);
addChild(this.window);
this.registerButton.visible = true;
this.registerButton.addEventListener(MouseEvent.CLICK,this.onRegistrationClicked);
this.restoreLink.addEventListener(MouseEvent.CLICK,this.showRestoreForm);
this.captchaSection.refreshButton.addEventListener(MouseEvent.CLICK,function(param1:MouseEvent):void {
dispatchEvent(new RefreshCaptchaClickedEvent());
});
this._symbolIsNotAllowedBubble = EntranceBubbleFactory.symbolIsNotAllowedBubble();
this._notAllowedShowDelayTimerTimer = new Timer(1000,1);
this._notAllowedShowDelayTimerTimer.addEventListener(TimerEvent.TIMER_COMPLETE,this.onCallsignCheckTimerComplete);
this.addLoginButtonPressedEventListeners();
display.stage.addEventListener(Event.RESIZE,this.alignYourself);
this.alignYourself();
addEventListener(Event.REMOVED_FROM_STAGE,this.onRemoveFromStage);
registrationUXService.logNavigationFinish();
}
private function onAccountChange(param1:Event) : void {
if(!this.accountsList.selectedItem) {
this.accountSelected = false;
if(this.accountsList.length == 0) {
this.callsign = "";
this.password = "";
this._password.enable = true;
this.accountsList.visible = false;
this.accountsList.removeEventListener(Event.CHANGE,this.onAccountChange);
this._callSignCheckIcon.x += 31;
} else {
this.accountsList.selectItemAt(0);
}
return;
}
this.callsign = this.accountsList.selectedItem.data.userName;
this._password.enable = false;
this.password = "12345678";
this.accountSelected = true;
}
private function onRemoveFromStage(param1:Event) : void {
removeEventListener(Event.REMOVED_FROM_STAGE,this.onRemoveFromStage);
display.stage.removeEventListener(Event.RESIZE,this.alignYourself);
this.registerButton.removeEventListener(MouseEvent.CLICK,this.onRegistrationClicked);
this.restoreLink.removeEventListener(MouseEvent.CLICK,this.showRestoreForm);
this._callSignOrEmail.removeEventListener(LoginFormEvent.TEXT_CHANGED,this.onCallsignChanged);
this.accountsList.removeEventListener(Event.CHANGE,this.onAccountChange);
this.removeLoginButtonPressedEvenListeners();
this._notAllowedShowDelayTimerTimer.removeEventListener(TimerEvent.TIMER_COMPLETE,this.onCallsignCheckTimerComplete);
this._notAllowedShowDelayTimerTimer.stop();
if(externalEntranceService.vkontakteEnabled) {
this.snPanel.vkButton.removeEventListener(MouseEvent.CLICK,this.onVkButtonClick);
}
if(externalEntranceService.facebookEnabled) {
this.snPanel.fbButton.removeEventListener(MouseEvent.CLICK,this.onFbButtonClick);
}
loaderWindowService.showDelayed(100);
}
private function onVkButtonClick(param1:MouseEvent) : void {
dispatchEvent(new StartExternalEntranceEvent(StartExternalEntranceEvent.START_LOGIN,"vkontakte",this.rememberMe));
}
private function onFbButtonClick(param1:MouseEvent) : void {
dispatchEvent(new StartExternalEntranceEvent(StartExternalEntranceEvent.START_LOGIN,"facebook",this.rememberMe));
}
private function onGoogleButtonClick(param1:MouseEvent) : void {
if(ExternalInterface.available) {
ExternalInterface.call("onGoogleButtonClicked");
ExternalInterface.addCallback("onGoogleTokenReceived",this.onGoogleTokenReceived);
}
}
private function onGoogleTokenReceived(param1:String) : void {
dispatchEvent(new GoogleLoginEvent(param1,this.rememberMe));
}
private function onCallsignCheckTimerComplete(param1:TimerEvent) : void {
this.hideBubbles();
}
private function onCallsignChanged(param1:LoginFormEvent) : void {
if(this.accountSelected) {
this._password.enable = true;
this.password = "";
this.accountSelected = false;
}
this.hideBubbles();
this._notAllowedShowDelayTimerTimer.reset();
this._notAllowedShowDelayTimerTimer.start();
if(!validateService.isValidIdentificationStringForLogin(this._callSignOrEmail.value)) {
this._callSignOrEmail.value = this._callSignOrEmail.value.replace(ValidateService.NOT_ALLOWED_PATTERN_FOR_LOGIN,"");
this._callSignOrEmail.validValue = false;
this._callSignCheckIcon.markAsInvalid();
this._callSignCheckIcon.addChild(this._symbolIsNotAllowedBubble);
}
}
private function onPasswordChanged(param1:LoginFormEvent) : void {
this.accountSelected = false;
}
private function hideBubbles() : void {
this._callSignOrEmail.validValue = true;
this._symbolIsNotAllowedBubble.hide();
this._callSignCheckIcon.turnOff();
}
private function addLoginButtonPressedEventListeners() : void {
if(!this._isAddLoginButtonPressedEventListeners) {
this._isAddLoginButtonPressedEventListeners = true;
this.playButton.enable = true;
this.playButton.addEventListener(MouseEvent.CLICK,this.onPlayClicked);
this._password.addEventListener(KeyboardEvent.KEY_DOWN,this.onPlayClickedKey);
this.captchaSection.captchaAnswer.addEventListener(KeyboardEvent.KEY_DOWN,this.onPlayClickedKey);
}
}
private function removeLoginButtonPressedEvenListeners() : void {
if(this._isAddLoginButtonPressedEventListeners) {
this._isAddLoginButtonPressedEventListeners = false;
this.playButton.enable = false;
this.playButton.removeEventListener(MouseEvent.CLICK,this.onPlayClicked);
this._password.removeEventListener(KeyboardEvent.KEY_DOWN,this.onPlayClickedKey);
this.captchaSection.captchaAnswer.removeEventListener(KeyboardEvent.KEY_DOWN,this.onPlayClickedKey);
}
}
private function onPlayClicked(param1:MouseEvent) : void {
this.removeLoginButtonPressedEvenListeners();
if(this.accountSelected) {
this.saveAccount();
dispatchEvent(new AccountLoginPressed());
} else {
dispatchEvent(new LoginButtonPressed());
}
}
private function saveAccount() : void {
var local1:SharedObject = storageService.getStorage();
var local2:Object = this.accountsList.selectedItem.data;
local1.data.userName = local2.userName;
local1.data.userHash = local2.userHash;
if(!this.rememberMe) {
local1.data.userHash = null;
}
local1.flush();
}
private function onPlayClickedKey(param1:KeyboardEvent) : void {
if(param1.keyCode == Keyboard.ENTER && this.playButton.enable) {
this.removeLoginButtonPressedEvenListeners();
if(this.accountSelected) {
this.removeLoginButtonPressedEvenListeners();
this.saveAccount();
dispatchEvent(new AccountLoginPressed());
} else {
dispatchEvent(new LoginButtonPressed());
}
}
}
private function onRegistrationClicked(param1:MouseEvent) : void {
dispatchEvent(new NavigationEvent(NavigationEvent.GO_TO_REGISTRATION_FORM));
}
public function get captchaAnswer() : String {
if(Boolean(this.captchaSection)) {
return this.captchaSection.captchaAnswer.value;
}
return "";
}
public function get mainPassword() : String {
return this._password.value;
}
public function set password(param1:String) : void {
this._password.value = param1;
}
public function get callsign() : String {
return this._callSignOrEmail.value;
}
public function set callsign(param1:String) : void {
if(param1 != null) {
this._callSignOrEmail.value = param1;
display.stage.focus = this._callSignOrEmail.textField.length == 0 ? this._callSignOrEmail.textField : this._password.textField;
}
}
public function get password() : String {
return this._password.value;
}
public function get hash() : String {
return this.accountsList.selectedItem.data.userHash;
}
public function set enableRegistration(param1:Boolean) : void {
this.registerButton.visible = param1;
if(param1) {
this.registerButton.addEventListener(MouseEvent.CLICK,this.onRegistrationClicked);
} else {
this.registerButton.removeEventListener(MouseEvent.CLICK,this.onRegistrationClicked);
}
}
private function showRestoreForm(param1:MouseEvent) : void {
dispatchEvent(new NavigationEvent(NavigationEvent.GO_TO_RESTORE_PASSWORD_FORM));
}
public function alertAboutWrongPassword() : void {
this.showErrorWindow(Alert.ERROR_PASSWORD_INCORRECT);
this._password.clear();
this._password.enable = true;
this.accountSelected = false;
this.addLoginButtonPressedEventListeners();
if(this.window.contains(this.captchaSection)) {
this.captchaSection.captchaAnswer.clear();
dispatchEvent(new RefreshCaptchaClickedEvent());
}
}
private function showErrorWindow(param1:int) : void {
var local2:Alert = new Alert(param1);
this.injector.injectInto(local2);
parent.addChild(local2);
}
private function alignYourself(param1:Event = null) : void {
this.x = int((display.stage.stageWidth - this.windowWidth) / 2);
this.y = int((display.stage.stageHeight - this.windowHeight) / 2);
}
public function get rememberMe() : Boolean {
return this.checkRemember.checked;
}
public function set remember(param1:Boolean) : void {
this.checkRemember.checked = param1;
}
public function get windowWidth() : int {
return this._windowWidth;
}
public function get windowHeight() : int {
return this._windowHeight;
}
public function set captchaImage(param1:Bitmap) : void {
if(Boolean(this.captchaSection)) {
this.captchaSection.captcha = param1;
}
}
public function captchaFailed() : void {
this.addLoginButtonPressedEventListeners();
}
public function showCaptchaSection() : void {
if(!this.window.contains(this.captchaSection)) {
this.window.addChild(this.captchaSection);
this.addLoginButtonPressedEventListeners();
this.captchaSection.y = this._password.y + this._password.height + this._margin - 5;
this.captchaSection.x = this._inputsLeftMargin;
this.captchaSection.width = this._windowWidth - this._inputsLeftMargin - this._margin;
this.captchaSection.visible = true;
this.playButton.y = this.captchaSection.y + this.captchaSection.height + this._margin - 5;
this.checkRemember.y = this.playButton.y + 2;
this.checkRememberLabel.y = this.checkRemember.y + 5;
this._windowHeight = this._windowHeight + this.captchaSection.height + this._margin - 5;
this.window.height = this._windowHeight;
if(this.snPanel != null) {
this.snPanel.y = this.window.y + this.window.height - 15;
}
this.alignYourself();
dispatchEvent(new RefreshCaptchaClickedEvent());
}
}
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapSmallRank01.png")]
public class PremiumRankBitmaps_bitmapSmallRank01 extends BitmapAsset {
public function PremiumRankBitmaps_bitmapSmallRank01() {
super();
}
}
}
|
package alternativa.tanks.gui.notinclan.dialogs {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.notinclan.dialogs.ClanLicenseDialog_licenseImageClass.png")]
public class ClanLicenseDialog_licenseImageClass extends BitmapAsset {
public function ClanLicenseDialog_licenseImageClass() {
super();
}
}
}
|
package _codec.projects.tanks.client.battleselect.model.matchmaking.group.notify {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.battleselect.model.matchmaking.group.notify.MatchmakingUserData;
public class VectorCodecMatchmakingUserDataLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecMatchmakingUserDataLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(MatchmakingUserData,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = LengthCodecHelper.decodeLength(param1);
var local3:Vector.<MatchmakingUserData> = new Vector.<MatchmakingUserData>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = MatchmakingUserData(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:MatchmakingUserData = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<MatchmakingUserData> = Vector.<MatchmakingUserData>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.gui.device.list {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
public class DeviceBorder extends Sprite {
private static const MIN_SINGLE_BUTTON_HEIGHT:int = 104;
private static const MIN_DOUBLE_BUTTON_HEIGHT:int = 150;
private static const WIDTH:int = 474;
private static const topClass:Class = DeviceBorder_topClass;
private static const topData:BitmapData = Bitmap(new topClass()).bitmapData;
private static const centerClass:Class = DeviceBorder_centerClass;
private static const centerData:BitmapData = Bitmap(new centerClass()).bitmapData;
private static const bottomClass:Class = DeviceBorder_bottomClass;
private static const bottomData:BitmapData = Bitmap(new bottomClass()).bitmapData;
public const top:Shape;
public const bottom:Shape;
public const center:Shape;
public function DeviceBorder(param1:int, param2:Boolean) {
var local4:Graphics = null;
this.top = new Shape();
this.bottom = new Shape();
this.center = new Shape();
super();
var local3:int = Math.max(param1,param2 ? MIN_SINGLE_BUTTON_HEIGHT : MIN_DOUBLE_BUTTON_HEIGHT);
addChild(this.top);
addChild(this.center);
addChild(this.bottom);
local4 = this.top.graphics;
local4.clear();
local4.beginBitmapFill(topData);
local4.drawRect(0,0,WIDTH,5);
local4.endFill();
this.top.x = 0;
this.top.y = 0;
local4 = this.center.graphics;
local4.clear();
local4.beginBitmapFill(centerData);
local4.drawRect(0,0,WIDTH,local3 - 10);
local4.endFill();
this.center.x = 0;
this.center.y = 5;
local4 = this.bottom.graphics;
local4.clear();
local4.beginBitmapFill(bottomData);
local4.drawRect(0,0,WIDTH,5);
local4.endFill();
this.bottom.x = 0;
this.bottom.y = local3 - 5;
}
}
}
|
package alternativa.tanks.models.weapon.railgun
{
public class RailgunData
{
public var chargingTime:int;
public var weakeningCoeff:Number;
public function RailgunData()
{
super();
}
}
}
|
package controls
{
import flash.events.MouseEvent;
public class TypeBattleButton extends BigButton
{
public function TypeBattleButton()
{
super();
_label.multiline = true;
_label.wordWrap = true;
_label.height = 45;
}
override protected function removeListeners() : void
{
super.removeListeners();
setState(3);
_label.y = int(25 - _label.textHeight / 2) + 1;
_info.y = 25;
}
override protected function addListeners() : void
{
super.addListeners();
_label.y = int(25 - _label.textHeight / 2);
_info.y = 24;
}
override protected function onMouseEvent(event:MouseEvent) : void
{
if(_enable)
{
switch(event.type)
{
case MouseEvent.MOUSE_OVER:
setState(2);
_label.y = int(25 - _label.textHeight / 2);
_info.y = 24;
break;
case MouseEvent.MOUSE_OUT:
setState(1);
_label.y = int(25 - _label.textHeight / 2);
_info.y = 24;
break;
case MouseEvent.MOUSE_DOWN:
setState(3);
_label.y = int(25 - _label.textHeight / 2) + 1;
_info.y = 25;
break;
case MouseEvent.MOUSE_UP:
setState(1);
_label.y = int(25 - _label.textHeight / 2);
_info.y = 24;
}
if(_icon != null)
{
_icon.y = int(25 - _icon.height / 2) + (event.type == MouseEvent.MOUSE_DOWN ? 1 : 0);
}
}
}
}
}
|
package controls.statassets
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.locale.constants.TextConst;
import flash.display.Sprite;
import flash.events.MouseEvent;
import forms.events.StatListEvent;
public class ReferralStatHeader extends Sprite
{
protected var tabs:Array;
protected var headers:Array;
protected var _currentSort:int = 1;
protected var _oldSort:int = 1;
protected var _width:int = 800;
public function ReferralStatHeader()
{
var cell:StatHeaderButton = null;
this.tabs = new Array();
super();
var localeService:ILocaleService = ILocaleService(Main.osgi.getService(ILocaleService));
this.headers = [localeService.getText(TextConst.REFERAL_STATISTICS_HEADER_CALLSIGN),localeService.getText(TextConst.REFERAL_STATISTICS_HEADER_INCOME)];
for(var i:int = 0; i < 2; i++)
{
cell = new StatHeaderButton(i == 1);
cell.label = this.headers[i];
cell.height = 18;
cell.numSort = i;
addChild(cell);
cell.addEventListener(MouseEvent.CLICK,this.changeSort);
}
this.draw();
}
protected function draw() : void
{
var cell:StatHeaderButton = null;
var infoX:int = int(this._width - 345);
this.tabs = [0,this._width - 120,this._width - 1];
for(var i:int = 0; i < 2; i++)
{
cell = getChildAt(i) as StatHeaderButton;
cell.width = this.tabs[i + 1] - this.tabs[i] - 2;
cell.x = this.tabs[i];
cell.selected = i == this._currentSort;
}
}
protected function changeSort(e:MouseEvent) : void
{
var trgt:StatHeaderButton = e.currentTarget as StatHeaderButton;
this._currentSort = trgt.numSort;
if(this._currentSort != this._oldSort)
{
this.draw();
dispatchEvent(new StatListEvent(StatListEvent.UPDATE_SORT,0,0,this._currentSort));
this._oldSort = this._currentSort;
}
}
override public function set width(w:Number) : void
{
this._width = Math.floor(w);
this.draw();
}
}
}
|
package projects.tanks.client.battlefield.models.inventory.sfx {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
public class InventorySfxModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function InventorySfxModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
}
}
}
|
package alternativa.tanks.models.weapons.targeting.direction.sector {
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleUtils;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.models.tank.ITankModel;
import alternativa.tanks.models.weapon.AllGlobalGunParams;
import alternativa.tanks.models.weapon.WeaponObject;
import alternativa.tanks.models.weapon.angles.verticals.autoaiming.VerticalAutoAiming;
import alternativa.tanks.services.tankregistry.TankUsersRegistry;
import platform.client.fp10.core.type.IGameObject;
public class TargetingSectorsCalculator {
[Inject]
public static var tankUsersRegistry:TankUsersRegistry;
private var upDirection:Vector3 = new Vector3();
private var self:IGameObject;
private var maxDistance:Number;
private var weapon:WeaponObject;
public function TargetingSectorsCalculator(param1:IGameObject, param2:WeaponObject, param3:Number) {
super();
this.self = param1;
this.weapon = param2;
this.maxDistance = param3;
}
public function getSectors(param1:AllGlobalGunParams) : Vector.<TargetingSector> {
var local3:IGameObject = null;
var local2:Vector.<TargetingSector> = new Vector.<TargetingSector>();
this.upDirection.cross2(param1.elevationAxis,param1.direction);
for each(local3 in tankUsersRegistry.getUsers()) {
if(local3 != this.self) {
this.calculateSectorAndAdd(param1,this.upDirection,this.getTank(local3),local2);
}
}
return local2;
}
private function calculateSectorAndAdd(param1:AllGlobalGunParams, param2:Vector3, param3:Tank, param4:Vector.<TargetingSector>) : void {
var local5:Vector3 = BattleUtils.tmpVector;
local5.diff(param3.getBody().state.position,param1.barrelOrigin);
var local6:Number = local5.length();
var local7:Number = Math.max(0,local5.length() - param3.getBoundSphereRadius());
if(local7 > this.maxDistance) {
return;
}
var local8:Vector3 = param1.elevationAxis;
var local9:Vector3 = param1.direction;
var local10:Number = local5.dot(local8);
var local11:Number = local5.dot(local9);
var local12:Number = local5.dot(param2);
var local13:Number = Math.atan2(local10,local11);
var local14:Number = Math.atan2(local12,local11);
var local15:Number = Math.min(param3.getBoundSphereRadius(),local6);
var local16:Number = Math.asin(local15 / local6);
var local17:Number = local16;
var local18:Number = local16;
if(Math.abs(local13) > local17) {
return;
}
var local19:VerticalAutoAiming = this.weapon.verticalAutoAiming();
var local20:Number = Math.max(local14 - local18,-local19.getElevationAngleDown());
var local21:Number = Math.min(local14 + local18,local19.getElevationAngleUp());
if(local20 < local21) {
param4.push(new TargetingSector(local20,local21,local7,param3));
}
}
private function getTank(param1:IGameObject) : Tank {
var local2:ITankModel = ITankModel(param1.adapt(ITankModel));
return local2.getTank();
}
}
}
|
package alternativa.tanks.models.weapon.gauss.state.targetselection {
import alternativa.tanks.models.weapon.gauss.LocalGaussWeapon;
import alternativa.tanks.models.weapon.gauss.state.TargetSelectionState;
public class TargetSearchState implements IGaussAimState {
private var weapon:LocalGaussWeapon;
private var parentState:TargetSelectionState;
private var lockResult:* = new LockResult();
public function TargetSearchState(param1:LocalGaussWeapon, param2:TargetSelectionState) {
super();
this.weapon = param1;
this.parentState = param2;
}
public function enter(param1:int, param2:GaussAimEventType, param3:*) : void {
this.weapon.weaponStatus = 1;
}
public function update(param1:int, param2:int) : void {
if(this.weapon.isTriggerPulled()) {
if(this.weapon.lockTarget(this.lockResult)) {
this.weapon.showAim();
this.parentState.processEvent(GaussAimEventType.TARGET_FOUND,new TargetFoundData(this.lockResult,true));
}
} else {
this.parentState.processEvent(GaussAimEventType.DEACTIVATED);
}
}
}
}
|
package assets.button {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.button.bigbutton_DOWN_CENTER.png")]
public dynamic class bigbutton_DOWN_CENTER extends BitmapData {
public function bigbutton_DOWN_CENTER(param1:int = 201, param2:int = 50) {
super(param1,param2);
}
}
}
|
package forms.buttons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class MainPanelFriendsButton_normalBtn extends BitmapAsset
{
public function MainPanelFriendsButton_normalBtn()
{
super();
}
}
}
|
package alternativa.tanks.gui.settings.tabs {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.settings.controls.CheckBoxSetting;
import alternativa.tanks.gui.settings.controls.SettingControl;
import alternativa.tanks.service.settings.ISettingsService;
import alternativa.tanks.service.settings.SettingEnum;
import base.DiscreteSprite;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
public class SettingsTabView extends DiscreteSprite {
[Inject]
public static var settingsService:ISettingsService;
[Inject]
public static var localeService:ILocaleService;
public static const MARGIN:int = 8;
public static const MARGIN_BEFORE_PARTITION_LABEL:int = 10;
public static const MARGIN_AFTER_PARTITION_LABEL:int = 3;
protected var settingsWithEvent:Vector.<DisplayObject> = new Vector.<DisplayObject>();
public function SettingsTabView() {
super();
}
public function show() : void {
}
public function hide() : void {
}
protected function createCheckBox(param1:SettingEnum, param2:String, param3:Boolean, param4:int = 0, param5:int = 0) : CheckBoxSetting {
var local6:CheckBoxSetting = new CheckBoxSetting(param1,param2);
local6.checked = param3;
local6.addEventListener(MouseEvent.CLICK,this.onControlClick);
local6.x = param4;
local6.y = param5;
this.settingsWithEvent.push(local6);
local6.label = param2;
return local6;
}
protected function onControlClick(param1:MouseEvent) : void {
var local2:SettingControl = null;
if(param1.currentTarget is SettingControl) {
local2 = SettingControl(param1.currentTarget);
settingsService.setClientSetting(local2.getSetting(),local2.getSettingValue());
}
}
public function destroy() : void {
var local1:DisplayObject = null;
for each(local1 in this.settingsWithEvent) {
local1.removeEventListener(MouseEvent.CLICK,this.onControlClick);
}
}
}
}
|
package _codec.projects.tanks.client.panel.model.shop.kitview.localized {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.shop.kitview.localized.KitViewResourceLocalizedCC;
public class VectorCodecKitViewResourceLocalizedCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecKitViewResourceLocalizedCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(KitViewResourceLocalizedCC,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = LengthCodecHelper.decodeLength(param1);
var local3:Vector.<KitViewResourceLocalizedCC> = new Vector.<KitViewResourceLocalizedCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = KitViewResourceLocalizedCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:KitViewResourceLocalizedCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<KitViewResourceLocalizedCC> = Vector.<KitViewResourceLocalizedCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.