Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.devm.cosmic.comm
- {
- import com.devm.cosmic.comm.commands.*;
- import com.devm.cosmic.game.*;
- import com.devm.cosmic.util.*;
- import com.devm.util.misc.*;
- import flash.display.*;
- import flash.events.*;
- import flash.utils.*;
- public class CosmicConnector extends Connector
- {
- private var _savedMessages:Dictionary;
- private var _username:String;
- private var _password:String;
- public static const MSG_SFS_INITIALIZED:String = "initialized";
- public static const MSG_SFS_CONNECTED:String = "connection success";
- public static const MSG_SFS_FAIL:String = "connection failure";
- public static const MSG_SRV_ALERT:String = "0";
- public static const MSG_SRV_LOGINFAIL:String = "1";
- public static const MSG_SRV_LOGINSUCCESS:String = "2";
- public static const MSG_SRV_COCKPITUPDATE:String = "3";
- public static const MSG_SRV_SHIPLANDED:String = "4";
- public static const MSG_SRV_SHIPLISTDETAIL:String = "5";
- public static const MSG_SRV_PLAYERLISTDETAIL:String = "6";
- public static const MSG_SRV_SENDPLAYERPROFILE:String = "7";
- public static const MSG_SRV_SENDSHIPCONFIG:String = "8";
- public static const MSG_SRV_ENTERSECTOR:String = "9";
- public static const MSG_SRV_SHIPFLIGHTCHANGE:String = "10";
- public static const MSG_SRV_SECTORUPDATE:String = "11";
- public static const MSG_SRV_PLAYERINVENTORY:String = "12";
- public static const MSG_SRV_TRADELIST:String = "13";
- public static const MSG_SRV_ENTERGAME:String = "14";
- public static const MSG_SRV_STOPEXTRACTION:String = "15";
- public static const MSG_SRV_OUTPOSTSHIPLIST:String = "16";
- public static const MSG_SRV_SHIPCONFIGDETAIL:String = "17";
- public static const MSG_SRV_SHIPDESTROYED:String = "18";
- public static const MSG_SRV_ENTERCOLONY:String = "19";
- public static const MSG_SRV_PLAYERSHIPLIST:String = "20";
- public static const MSG_SRV_WAREHOUSESTATUS:String = "21";
- public static const MSG_SRV_PM_SENDLIST:String = "22";
- public static const MSG_SRV_PM_SENDTHREAD:String = "23";
- public static const MSG_SRV_CHAT_ROOMLIST:String = "24";
- public static const MSG_SRV_CHAT_UPDATE:String = "25";
- public static const MSG_SRV_CHAT_ROOMROSTER:String = "26";
- public static const MSG_SRV_MRKT_ITEMOFFERLIST:String = "27";
- public static const MSG_SRV_MRKT_SHIPOFFERLIST:String = "28";
- public static const MSG_SRV_REGISTER_SUCCESS:String = "29";
- public static const MSG_SRV_BP_REQS:String = "30";
- public static const MSG_SRV_BASE_STRUCTURES:String = "31";
- public static const MSG_SRV_SCRAP_PREVIEW:String = "32";
- public static const MSG_SRV_TELEPORT_LIST:String = "33";
- public static const MSG_SRV_SALVAGEBOX:String = "34";
- public static const MSG_SRV_MISSION_OFFER:String = "35";
- public static const MSG_SRV_MISSION_DETAIL:String = "36";
- public static const MSG_SRV_MISSION_LIST:String = "37";
- public static const MSG_SRV_MISSION_COMPLETED:String = "38";
- public static const MSG_SRV_RELATIONS:String = "39";
- public static const MSG_SRV_BASEOPTIONS:String = "40";
- public static const MSG_SRV_REPORT_RESPONSE:String = "41";
- public static const MSG_SRV_PROMOTION:String = "42";
- public static const MSG_SRV_TUTORIAL:String = "43";
- public static const MSG_SRV_TUTORIAL_END:String = "44";
- public static const MSG_SRV_CREATECOLONYEXITGATE:String = "45";
- public static const MSG_SRV_CREATECOLONYOUTPOST:String = "46";
- public static const MSG_SRV_PRIORITYMESSAGE:String = "47";
- public static const MSG_SRV_LEADERBOARD:String = "48";
- public static const MSG_SRV_EVENTAWARD:String = "49";
- public static const MSG_SRV_MRKT_OFFERS:String = "50";
- public static const MSG_SRV_MRKT_ITEMS:String = "51";
- public static const MSG_SRV_GCE_STATUS:String = "52";
- public static const MSG_SRV_MRKT_FACTIONS:String = "53";
- public static const MSG_SRV_SIGNINGKEY:String = "54";
- public static const MSG_SRV_SETTING_EMAIL:String = "55";
- public static const MSG_SRV_SETTING_SET:String = "56";
- public static const MSG_SRV_NEW_EVENT:String = "57";
- public static const MSG_CLIENT_DEBUG:String = "d0";
- public static const MSG_CLIENT_DEBUGMAGICMOVE:String = "d1";
- public static const MSG_CLIENT_DEBUGTUORIAL:String = "d2";
- public static const MSG_CLIENT_PING:String = "ping";
- public static const MSG_SRV_PING:String = "ping";
- public static const MSG_CLIENT_CHANGECOURSE:String = "c1";
- public static const MSG_CLIENT_FIREWEAPON:String = "c2";
- public static const MSG_CLIENT_LAUNCH:String = "c3";
- public static const MSG_CLIENT_DOCK:String = "c4";
- public static const MSG_CLIENT_SHIPLISTDETAIL:String = "c5";
- public static const MSG_CLIENT_PLAYERLISTDETAIL:String = "c6";
- public static const MSG_CLIENT_GETMYPROFILE:String = "c7";
- public static const MSG_CLIENT_CHANGETARGET:String = "c8";
- public static const MSG_CLIENT_STOPWEAPON:String = "c9";
- public static const MSG_CLIENT_GETSHIPCONFIG:String = "c10";
- public static const MSG_CLIENT_ENTERWORMHOLE:String = "c11";
- public static const MSG_CLIENT_FOLLOWSHIP:String = "c12";
- public static const MSG_CLIENT_CHANGEFLIGHTTYPE:String = "c13";
- public static const MSG_CLIENT_EXTRACTRESOURCES:String = "c14";
- public static const MSG_CLIENT_TRADELIST:String = "c15";
- public static const MSG_CLIENT_TRADERESOURCES:String = "c16";
- public static const MSG_CLIENT_STOPEXTRACTION:String = "c17";
- public static const MSG_CLIENT_HANGARREQUEST:String = "c18";
- public static const MSG_CLIENT_GETSHIPCONFIGDETAIIL:String = "c19";
- public static const MSG_CLIENT_ENTERCOLONY:String = "c20";
- public static const MSG_CLIENT_BUILDSTRUCTURE:String = "c21";
- public static const MSG_CLIENT_LEAVECOLONY:String = "c22";
- public static const MSG_CLIENT_GETSTRUCTURESTATUS:String = "c23";
- public static const MSG_CLIENT_GETPLAYERSHIPS:String = "c24";
- public static const MSG_CLIENT_VAULTTRANSFER:String = "c25";
- public static const MSG_CLIENT_WAREHOUSETRANSFER:String = "c26";
- public static const MSG_CLIENT_REFINE:String = "c27";
- public static const MSG_CLIENT_UPGRADESTRUCTURE:String = "c28";
- public static const MSG_CLIENT_DESTROYSTRUCTURE:String = "c29";
- public static const MSG_CLIENT_CANCELSTRUCTURE:String = "c30";
- public static const MSG_CLIENT_PM_GETLIST:String = "c31";
- public static const MSG_CLIENT_PM_COMPOSE:String = "c32";
- public static const MSG_CLIENT_PM_REPLY:String = "c33";
- public static const MSG_CLIENT_PM_GETTHREAD:String = "c34";
- public static const MSG_CLIENT_PM_ARCHIVE:String = "c35";
- public static const MSG_CLIENT_PM_DELETE:String = "c36";
- public static const MSG_CLIENT_CHAT_SENDMESSAGE:String = "c37";
- public static const MSG_CLIENT_CHAT_GETROOMS:String = "c39";
- public static const MSG_CLIENT_MRKT_GETSHIPOFFERS:String = "c40";
- public static const MSG_CLIENT_MRKT_GETITEMOFFERS:String = "c41";
- public static const MSG_CLIENT_MRKT_GETMYITEMOFFERS:String = "c42";
- public static const MSG_CLIENT_MRKT_BUY:String = "c43";
- public static const MSG_CLIENT_MRKT_SELLITEM:String = "c44";
- public static const MSG_CLIENT_MRKT_SELLSHIP:String = "c45";
- public static const MSG_CLIENT_MRKT_CANCEL:String = "c46";
- public static const MSG_CLIENT_MRKT_GETMYSHIPOFFERS:String = "c47";
- public static const MSG_CLIENT_FLEET_HARVEST:String = "c48";
- public static const MSG_CLIENT_FLEET_CANCEL:String = "c49";
- public static const MSG_CLIENT_BP_PRODUCE:String = "c50";
- public static const MSG_CLIENT_EQUIP:String = "c51";
- public static const MSG_CLIENT_UNEQUIP:String = "c52";
- public static const MSG_CLIENT_BP_REQS:String = "c53";
- public static const MSG_CLIENT_BASE_STRUCTURES:String = "c54";
- public static const MSG_CLIENT_SCRAP_PREVIEW:String = "c55";
- public static const MSG_CLIENT_SCRAP_DO:String = "c56";
- public static const MSG_CLIENT_TELEPORT_LIST:String = "c57";
- public static const MSG_CLIENT_TELEPORT_GO:String = "c58";
- public static const MSG_CLIENT_SALVAGEBOX:String = "c59";
- public static const MSG_CLIENT_MISSION_REQUEST:String = "c60";
- public static const MSG_CLIENT_MISSION_RESPONSE:String = "c61";
- public static const MSG_CLIENT_MISSION_DETAIL:String = "c62";
- public static const MSG_CLIENT_MISSION_LIST:String = "c63";
- public static const MSG_CLIENT_RELATIONS:String = "c64";
- public static const MSG_CLIENT_BASEOPTIONS:String = "c65";
- public static const MSG_CLIENT_BUILDBASE:String = "c66";
- public static const MSG_CLIENT_REPORT_REQUEST:String = "c67";
- public static const MSG_CLIENT_MRKT_GETOFFERS:String = "c68";
- public static const MSG_CLIENT_MRKT_TYPEGETOFFERS:String = "c69";
- public static const MSG_CLIENT_GCE_STATUS:String = "c70";
- public static const MSG_CLIENT_GCE_CANCEL:String = "c71";
- public static const MSG_CLIENT_GCE_OFFER:String = "c72";
- public static const MSG_CLIENT_GCE_TRANSACTION:String = "c73";
- public static const MSG_CLIENT_MRKT_GETFACTIONS:String = "c74";
- public static const MSG_CLIENT_SIGNINGKEY:String = "c75";
- public static const MSG_CLIENT_GCUPDATE:String = "c76";
- public static const MSG_CLIENT_CHAT_SENDCOMMAND:String = "c77";
- public static const MSG_CLIENT_SETTING_SETAVATAR:String = "c78";
- public static const MSG_CLIENT_SETTING_SETPASSWORD:String = "c79";
- public static const MSG_CLIENT_SETTING_SETEMAIL:String = "c80";
- public static const MSG_CLIENT_SETTING_GETEMAIL:String = "c81";
- public static const MSG_CLIENT_LAUNCH_TO_COLONY:String = "c82";
- public static const ALERT_ANNOUNCEMENT:String = "a";
- public static const ALERT_DATAERROR:String = "de";
- public static const ALERT_SECTORACTIVITY:String = "sa";
- public static const ALERT_PLAYERPROMOTION:String = "pp";
- public static const ALERT_SHIPDESTROYED:String = "sd";
- public static const ALERT_SOW:String = "sow";
- private static var _this:CosmicConnector;
- private static const xtName:String = "cj";
- public function CosmicConnector(param1:Sprite)
- {
- super(param1);
- _this = this;
- this._savedMessages = new Dictionary();
- return;
- }// end function
- public function retryLogin() : void
- {
- this.login(this._username, this._password);
- return;
- }// end function
- public function login(param1:String, param2:String) : void
- {
- this._username = param1;
- this._password = param2;
- _server.login(xtName, param1, param2);
- Debug.print("CosmicConnector.login() : " + xtName + ", " + param1 + ", " + param2);
- return;
- }// end function
- public function createCharacter(param1:String, param2:String, param3:String, param4:String, param5:String, param6:String, param7:String) : void
- {
- var _loc_8:* = param1 + "|" + param2 + "|" + param3 + "|" + param4 + "|" + param6 + "|" + param7;
- _server.login(xtName, _loc_8, param5);
- Debug.print("CosmicConnector.createCharacter() : " + xtName + ", " + _loc_8 + ", " + "****");
- return;
- }// end function
- public function getLatestMessage(param1:String) : CMD
- {
- return this._savedMessages[param1] as CMD;
- }// end function
- public function inject(param1:String, param2:String) : void
- {
- this.processCommand(param1, param2);
- return;
- }// end function
- override protected function processCommand(param1:String, param2:String) : void
- {
- var _loc_3:CMD = null;
- if (param1 == MSG_SRV_COCKPITUPDATE)
- {
- _loc_3 = new CockpitUpdateCommand(param2);
- ServerTime.time = (_loc_3 as CockpitUpdateCommand).localShip.time;
- CachedData.latestCockpitUpdate = _loc_3 as CockpitUpdateCommand;
- }
- else if (param1 == MSG_SRV_PING)
- {
- _loc_3 = new CMD();
- ServerTime.time = Number(param2);
- }
- else if (param1 == MSG_SRV_SHIPFLIGHTCHANGE)
- {
- _loc_3 = new ShipFlightChangeCommand(param2);
- }
- else if (param1 == MSG_SRV_SENDSHIPCONFIG)
- {
- _loc_3 = new ShipConfigCommand(param2);
- }
- else if (param1 == MSG_SRV_ENTERGAME)
- {
- _loc_3 = new EnterGame2Command(param2);
- }
- else if (param1 == MSG_SRV_ENTERCOLONY)
- {
- _loc_3 = new EnterColonyCommand(param2);
- }
- else if (param1 == MSG_SRV_ENTERSECTOR)
- {
- _loc_3 = new EnterSectorCommand(param2);
- ServerTime.time = (_loc_3 as EnterSectorCommand).serverTime;
- }
- else if (param1 == MSG_SRV_SECTORUPDATE)
- {
- _loc_3 = new SectorUpdateCommand(param2);
- }
- else if (param1 == MSG_SRV_PLAYERINVENTORY)
- {
- _loc_3 = new PlayerInventoryCommand(param2);
- }
- else if (param1 == MSG_SRV_TRADELIST)
- {
- _loc_3 = new TradeListCommand(param2);
- }
- else if (param1 == MSG_SRV_SHIPLISTDETAIL)
- {
- _loc_3 = new ShipDetailsCommand(param2);
- }
- else if (param1 == MSG_SRV_STOPEXTRACTION)
- {
- _loc_3 = new StopExtractionCommand(param2);
- }
- else if (param1 == MSG_SRV_SHIPLANDED)
- {
- _loc_3 = new ShipLandedCommand(param2);
- }
- else if (param1 == MSG_SRV_OUTPOSTSHIPLIST)
- {
- _loc_3 = new OutpostShipListCommand(param2);
- }
- else if (param1 == MSG_SRV_SHIPDESTROYED)
- {
- _loc_3 = new ShipDestroyedCommand(param2);
- }
- else if (param1 == MSG_SRV_SHIPCONFIGDETAIL)
- {
- _loc_3 = new ShipConfigExtendedCommand(param2);
- }
- else if (param1 == MSG_SRV_WAREHOUSESTATUS)
- {
- _loc_3 = new WarehouseCommand(param2);
- }
- else if (param1 == MSG_SRV_PM_SENDLIST)
- {
- _loc_3 = new MailListCommand(param2);
- }
- else if (param1 == MSG_SRV_PM_SENDTHREAD)
- {
- _loc_3 = new MailContentCommand(param2);
- }
- else if (param1 == MSG_SRV_CHAT_ROOMLIST)
- {
- _loc_3 = new ChatRoomListCommand(param2);
- }
- else if (param1 == MSG_SRV_CHAT_ROOMROSTER)
- {
- _loc_3 = new ChatParticipantListCommand(param2);
- }
- else if (param1 == MSG_SRV_CHAT_UPDATE)
- {
- _loc_3 = new ChatPostCommand(param2);
- }
- else if (param1 == MSG_SRV_MRKT_ITEMOFFERLIST)
- {
- _loc_3 = new MarketItemList(param2);
- }
- else if (param1 == MSG_SRV_SENDPLAYERPROFILE)
- {
- _loc_3 = new MyProfileCommand(param2);
- }
- else if (param1 == MSG_SRV_MRKT_SHIPOFFERLIST)
- {
- _loc_3 = new MarketShipList(param2);
- }
- else if (param1 == MSG_SRV_REGISTER_SUCCESS)
- {
- _loc_3 = new RegisterSuccessCommand(param2);
- }
- else if (param1 == MSG_SRV_BP_REQS)
- {
- _loc_3 = new BlueprintReqCommand(param2);
- }
- else if (param1 == MSG_SRV_BASE_STRUCTURES)
- {
- _loc_3 = new StructuresListCommand(param2);
- }
- else if (param1 == MSG_SRV_SCRAP_PREVIEW)
- {
- _loc_3 = new ScrapPreviewCommand(param2);
- }
- else if (param1 == MSG_SRV_TELEPORT_LIST)
- {
- _loc_3 = new TeleportListCommand(param2);
- }
- else if (param1 == MSG_SRV_SALVAGEBOX)
- {
- _loc_3 = new SalvageBoxCommand(param2);
- }
- else if (param1 == MSG_SRV_MISSION_OFFER || param1 == MSG_SRV_MISSION_DETAIL || param1 == MSG_SRV_MISSION_COMPLETED)
- {
- _loc_3 = new MissionDetailCommand(param2);
- }
- else if (param1 == MSG_SRV_MISSION_LIST)
- {
- _loc_3 = new MissionListCommand(param2);
- }
- else if (param1 == MSG_SRV_RELATIONS)
- {
- _loc_3 = new FactionRelationsCommand(param2);
- }
- else if (param1 == MSG_SRV_PLAYERLISTDETAIL)
- {
- _loc_3 = new PlayerListDetailsCommand(param2);
- }
- else if (param1 == MSG_SRV_BASEOPTIONS)
- {
- _loc_3 = new BaseOptionsCommand(param2);
- }
- else if (param1 == MSG_SRV_REPORT_RESPONSE)
- {
- _loc_3 = new ScoreboardCommand(param2);
- }
- else if (param1 == MSG_SRV_PROMOTION)
- {
- _loc_3 = new PromotionCommand(param2);
- }
- else if (param1 == MSG_SRV_CREATECOLONYEXITGATE)
- {
- _loc_3 = new CreateWormHoleCommand(param2);
- }
- else if (param1 == MSG_SRV_CREATECOLONYOUTPOST)
- {
- _loc_3 = new CreateOutpostCommand(param2);
- }
- else if (param1 == MSG_SRV_PRIORITYMESSAGE)
- {
- _loc_3 = new PriorityMessageCommand(param2);
- }
- else if (param1 == MSG_SRV_LEADERBOARD)
- {
- _loc_3 = new EventLeaderboardCommand(param2);
- }
- else if (param1 == MSG_SRV_EVENTAWARD)
- {
- _loc_3 = new EventAwardCommand(param2);
- }
- else if (param1 == MSG_SRV_GCE_STATUS)
- {
- _loc_3 = new GCExchangeStatusCommand(param2);
- }
- else if (param1 == MSG_SRV_MRKT_OFFERS)
- {
- _loc_3 = new MarketOverviewCommand(param2);
- }
- else if (param1 == MSG_SRV_MRKT_ITEMS)
- {
- _loc_3 = new MarketSubOverviewCommand(param2);
- }
- else if (param1 == MSG_SRV_MRKT_FACTIONS)
- {
- _loc_3 = new MarketShipOverviewCommand(param2);
- }
- else if (param1 == MSG_SRV_SIGNINGKEY)
- {
- _loc_3 = new SignInKeyCommand(param2);
- }
- else if (param1 == MSG_SRV_NEW_EVENT)
- {
- _loc_3 = new ServerNewEventCommand(param2);
- }
- else
- {
- _loc_3 = new CMD();
- }
- _loc_3.cmd = param1;
- _loc_3.data = param2;
- _loc_3.connector = this;
- this._savedMessages[_loc_3.cmd] = _loc_3;
- if (artificialLatency == 0)
- {
- dispatchEventDo(_loc_3);
- }
- else
- {
- setTimeout(dispatchEventDo, artificialLatency, _loc_3);
- }
- return;
- }// end function
- public function requestShipConfigExtended(param1:String) : void
- {
- sendString(MSG_CLIENT_GETSHIPCONFIGDETAIIL, param1);
- Debug.print("CosmicConnector.requestShipConfigExtended() " + param1);
- return;
- }// end function
- public function changeFlightType(param1:String, param2:Boolean) : void
- {
- var _loc_3:* = param2 ? ("ON") : ("OFF");
- sendString(MSG_CLIENT_CHANGEFLIGHTTYPE, param1 + "|" + _loc_3);
- Debug.print("CosmicConnector.changeFlightType() " + param1 + "|" + _loc_3);
- return;
- }// end function
- public function requestTradeList(param1:String) : void
- {
- sendString(MSG_CLIENT_TRADELIST, param1);
- Debug.print("CosmicConnector.requestTradeList() " + param1);
- return;
- }// end function
- public function followShip(param1:String) : void
- {
- sendString(MSG_CLIENT_FOLLOWSHIP, param1);
- Debug.print("CosmicConnector.followShip() " + param1);
- return;
- }// end function
- public function extractResource(param1:String, param2:String, param3:String = "0") : void
- {
- sendString(MSG_CLIENT_EXTRACTRESOURCES, param1 + "*" + param2 + "*" + param3);
- Debug.print("CosmicConnector.extractResource() " + param1 + "*" + param2 + "*" + param3);
- return;
- }// end function
- public function stopExtraction() : void
- {
- sendString(MSG_CLIENT_STOPEXTRACTION, "0");
- Debug.print("CosmicConnector.stopExtraction() " + "0");
- return;
- }// end function
- public function jettisonResources(param1:Array, param2:Array) : void
- {
- this.tradeResources("0", param1, param2, false);
- return;
- }// end function
- public function tradeResources(param1:String, param2:Array, param3:Array, param4:Boolean) : void
- {
- var _loc_7:int = 0;
- var _loc_5:* = param1 + "*" + param2.length;
- var _loc_6:int = 0;
- while (_loc_6 < param2.length)
- {
- _loc_7 = param4 ? (param3[_loc_6]) : (-param3[_loc_6]);
- _loc_5 = _loc_5 + ("|" + param2[_loc_6] + "|" + _loc_7);
- _loc_6++;
- }
- sendString(MSG_CLIENT_TRADERESOURCES, _loc_5);
- Debug.print("CosmicConnector.tradeResources() " + _loc_5);
- return;
- }// end function
- public function fireWeapon(param1:int, param2:String, param3:String, param4:String = "S", param5:Boolean = true) : void
- {
- var _loc_6:* = param1 + "|" + param4 + "|" + param2 + "|" + param3 + "|" + (param5 ? ("1") : ("0"));
- sendString(MSG_CLIENT_FIREWEAPON, _loc_6);
- Debug.print("CosmicConnector.fireWeapon() " + _loc_6);
- return;
- }// end function
- public function stopAutoFire(param1:int) : void
- {
- sendString(MSG_CLIENT_STOPWEAPON, "" + param1);
- Debug.print("CosmicConnector.stopAutoFire() " + param1);
- return;
- }// end function
- public function setTarget(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_CHANGETARGET, param2 + "|" + param1);
- Debug.print("CosmicConnector.setTarget() " + param2 + "|" + param1);
- return;
- }// end function
- public function enterWormhole(param1:String) : void
- {
- sendString(MSG_CLIENT_ENTERWORMHOLE, param1);
- Debug.print("CosmicConnector.enterWormhole() " + param1);
- return;
- }// end function
- public function enterColony(param1:String) : void
- {
- sendString(MSG_CLIENT_ENTERCOLONY, param1);
- Debug.print("CosmicConnector.enterColony() " + param1);
- return;
- }// end function
- public function setFollow(param1:String) : void
- {
- sendString(MSG_CLIENT_FOLLOWSHIP, param1);
- Debug.print("CosmicConnector.setFollow() " + param1);
- return;
- }// end function
- public function setDestination(param1:Vector2D) : void
- {
- sendString(MSG_CLIENT_CHANGECOURSE, int(param1.x) + "|" + int(param1.y));
- Debug.print("CosmicConnector.setDestination() " + int(param1.x) + "|" + int(param1.y));
- return;
- }// end function
- public function requestShipDetails(param1:Array) : void
- {
- sendString(MSG_CLIENT_SHIPLISTDETAIL, param1.join("|"));
- return;
- }// end function
- public function requestPlayerInfo(param1:Array) : void
- {
- sendString(MSG_CLIENT_PLAYERLISTDETAIL, param1.join("|"));
- Debug.print("CosmicConnector.requestPlayerInfo() " + param1.join("|"));
- return;
- }// end function
- public function requestOwnProfile() : void
- {
- sendString(MSG_CLIENT_GETMYPROFILE, "0");
- Debug.print("CosmicConnector.requestProfile() ");
- return;
- }// end function
- public function requestShipConfig(param1:Array) : void
- {
- sendString(MSG_CLIENT_GETSHIPCONFIG, param1.join("|"));
- Debug.print("CosmicConnector.requestShipConfig() " + param1.join("|"));
- return;
- }// end function
- public function requestShipInHangar() : void
- {
- sendString(MSG_CLIENT_HANGARREQUEST, "list");
- Debug.print("CosmicConnector.requestShipInHangar() " + "list");
- return;
- }// end function
- public function repairShipInHangar(param1:String) : void
- {
- sendString(MSG_CLIENT_HANGARREQUEST, "repair:" + param1);
- Debug.print("CosmicConnector.repairShipInHangar() " + "repair:" + param1);
- return;
- }// end function
- public function dock(param1:String) : void
- {
- sendString(MSG_CLIENT_DOCK, param1);
- Debug.print("CosmicConnector.dock() " + param1);
- return;
- }// end function
- public function leaveColony(param1:String) : void
- {
- sendString(MSG_CLIENT_LEAVECOLONY, param1);
- Debug.print("CosmicConnector.leaveColony() " + param1);
- return;
- }// end function
- public function leaveDock(param1:String) : void
- {
- sendString(MSG_CLIENT_LAUNCH, param1);
- Debug.print("CosmicConnector.leaveDock() " + param1);
- return;
- }// end function
- public function getHostAndIP() : String
- {
- return _ip + ":" + _port;
- }// end function
- public function teleportTo(param1:Vector2D) : void
- {
- sendString(MSG_CLIENT_DEBUGMAGICMOVE, int(param1.x) + "|" + int(param1.y) + "|0");
- Debug.print("CosmicConnector.teleportTo() ");
- return;
- }// end function
- public function buildStructure(param1:String, param2:Vector2D) : void
- {
- sendString(MSG_CLIENT_BUILDSTRUCTURE, int(param2.x) + "|" + int(param2.y) + "|" + param1);
- Debug.print("CosmicConnector.buildStructure() " + int(param2.x) + "|" + int(param2.y) + "|" + param1);
- return;
- }// end function
- public function upgradeStructure(param1:String) : void
- {
- sendString(MSG_CLIENT_UPGRADESTRUCTURE, param1);
- Debug.print("CosmicConnector.upgradeStructure() " + param1);
- return;
- }// end function
- public function destroyStructure(param1:String) : void
- {
- sendString(MSG_CLIENT_DESTROYSTRUCTURE, param1);
- Debug.print("CosmicConnector.destroyStructure() " + param1);
- return;
- }// end function
- public function cancelStructure(param1:String) : void
- {
- sendString(MSG_CLIENT_CANCELSTRUCTURE, param1);
- Debug.print("CosmicConnector.cancelStructure() " + param1);
- return;
- }// end function
- public function getStructureStatus(param1:String) : void
- {
- sendString(MSG_CLIENT_GETSTRUCTURESTATUS, param1);
- Debug.print("CosmicConnector.getStructureStatus() " + param1);
- return;
- }// end function
- public function itemTransfer(param1:String, param2:String, param3:String, param4:String, param5:Array, param6:Array) : void
- {
- var _loc_8:int = 0;
- var _loc_7:* = param3 + "|" + param2 + "|" + param4;
- if (param5 == null || param6 == null)
- {
- _loc_7 = _loc_7 + "|ALL";
- }
- else
- {
- _loc_8 = 0;
- while (_loc_8 < param5.length)
- {
- _loc_7 = _loc_7 + ("|" + param5[_loc_8] + "|" + param6[_loc_8]);
- _loc_8++;
- }
- }
- sendString(param1, _loc_7);
- Debug.print("CosmicConnector.itemTransfer() " + _loc_7);
- return;
- }// end function
- public function warehouseTransfer(param1:String, param2:String, param3:String, param4:Array, param5:Array) : void
- {
- this.itemTransfer(MSG_CLIENT_WAREHOUSETRANSFER, param1, param2, param3, param4, param5);
- return;
- }// end function
- public function refine(param1:String, param2:int) : void
- {
- sendString(MSG_CLIENT_REFINE, param1 + "|" + param2);
- Debug.print("CosmicConnector.refine() " + param1 + "|" + param2);
- return;
- }// end function
- public function deleteMail(param1:String, param2:String = "1") : void
- {
- sendString(MSG_CLIENT_PM_DELETE, param1 + "|" + param2);
- Debug.print("CosmicConnector.deleteMail() " + param1 + "|" + param2);
- return;
- }// end function
- public function getMailContent(param1:String) : void
- {
- sendString(MSG_CLIENT_PM_GETTHREAD, param1);
- Debug.print("CosmicConnector.getMailContent() " + param1);
- return;
- }// end function
- public function getMails(param1:String = "inbox") : void
- {
- sendString(MSG_CLIENT_PM_GETLIST, param1);
- Debug.print("CosmicConnector.getMails() " + param1);
- return;
- }// end function
- public function sendMail(param1:Array, param2:String, param3:String) : void
- {
- var _loc_4:* = param1.join(",");
- _loc_4 = param1.join(",") + ("|" + this.sanitizeString(param2));
- _loc_4 = _loc_4 + ("|" + this.sanitizeString(param3));
- sendString(MSG_CLIENT_PM_COMPOSE, _loc_4);
- Debug.print("CosmicConnector.sendMail() " + _loc_4);
- return;
- }// end function
- public function replyToMail(param1:String, param2:String) : void
- {
- var _loc_3:* = param1 + "|" + this.sanitizeString(param2);
- sendString(MSG_CLIENT_PM_REPLY, _loc_3);
- Debug.print("CosmicConnector.replyToMail() " + _loc_3);
- return;
- }// end function
- public function requestRoomList() : void
- {
- sendString(MSG_CLIENT_CHAT_GETROOMS, "0");
- Debug.print("CosmicConnector.requestRoomList() ");
- return;
- }// end function
- public function sendChatMessage(param1:String, param2:String) : void
- {
- var _loc_3:* = param1 + "|" + this.sanitizeString(param2);
- sendString(MSG_CLIENT_CHAT_SENDMESSAGE, _loc_3);
- Debug.print("CosmicConnector.sendChatMessage() " + _loc_3);
- return;
- }// end function
- public function requestMyItemOffers() : void
- {
- sendString(MSG_CLIENT_MRKT_GETMYITEMOFFERS, "0");
- Debug.print("CosmicConnector.requestMyItemOffers() ");
- return;
- }// end function
- public function requestMyShipOffers() : void
- {
- sendString(MSG_CLIENT_MRKT_GETMYSHIPOFFERS, "0");
- Debug.print("CosmicConnector.requestMyShipOffers() ");
- return;
- }// end function
- public function requestShipOffers(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_MRKT_GETSHIPOFFERS, param1 + "|" + param2);
- Debug.print("CosmicConnector.requestShipOffers() " + param1 + "|" + param2);
- return;
- }// end function
- public function requestItemOffers(param1:String) : void
- {
- sendString(MSG_CLIENT_MRKT_GETITEMOFFERS, param1);
- Debug.print("CosmicConnector.requestItemOffers() " + param1);
- return;
- }// end function
- public function addMarketOffer(param1:String, param2:int, param3:Number) : void
- {
- sendString(MSG_CLIENT_MRKT_SELLITEM, param1 + "|" + param2 + "|" + Math.round(param3));
- Debug.print("CosmicConnector.addMarketOffer() " + param1 + "|" + param2 + "|" + Math.round(param3));
- return;
- }// end function
- public function buyMarketOffer(param1:String, param2:Boolean, param3:String, param4:int) : void
- {
- sendString(MSG_CLIENT_MRKT_BUY, param1 + "|" + (param2 ? ("Y") : ("N")) + "|" + param3 + "|" + param4);
- Debug.print("CosmicConnector.buyMarketOffer() " + param1 + "|" + (param2 ? ("Y") : ("N")) + "|" + param3 + "|" + param4);
- return;
- }// end function
- public function addMarketOfferShip(param1:String, param2:Number) : void
- {
- sendString(MSG_CLIENT_MRKT_SELLSHIP, param1 + "|" + Math.round(param2));
- Debug.print("CosmicConnector.addMarketOfferShip() " + param1 + "|" + Math.round(param2));
- return;
- }// end function
- override protected function sendRoundTripBench(event:Event) : void
- {
- if (_server.isConnected)
- {
- sendString(MSG_CLIENT_PING, "0");
- if (_measuredLatencyNum < 8)
- {
- super.sendRoundTripBench(event);
- }
- }
- else
- {
- super.sendRoundTripBench(event);
- }
- return;
- }// end function
- private function sanitizeString(param1:String) : String
- {
- var _loc_2:Array = ["*", "|", "%"];
- var _loc_3:int = 0;
- while (_loc_3 < _loc_2.length)
- {
- param1 = param1.split(_loc_2[_loc_3]).join("_");
- _loc_3++;
- }
- return param1;
- }// end function
- public function cancelOffer(param1:String) : void
- {
- sendString(MSG_CLIENT_MRKT_CANCEL, param1);
- Debug.print("CosmicConnector.cancelOffer() " + param1);
- return;
- }// end function
- public function sendCancelOrder(param1:String) : void
- {
- sendString(MSG_CLIENT_FLEET_CANCEL, param1);
- Debug.print("CosmicConnector.sendCancelOrder() " + param1);
- return;
- }// end function
- public function sendHarvesterOrder(param1:String, param2:String, param3:String) : void
- {
- sendString(MSG_CLIENT_FLEET_HARVEST, param1 + "|" + param2 + "|" + param3);
- Debug.print("CosmicConnector.sendHarvesterOrder() " + param1 + "|" + param2 + "|" + param3);
- return;
- }// end function
- public function equipShipModule(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_EQUIP, param1 + "|" + param2);
- Debug.print("CosmicConnector.equipShipModule() " + param1 + "|" + param2);
- return;
- }// end function
- public function unequipShipModule(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_UNEQUIP, param1 + "|" + param2);
- Debug.print("CosmicConnector.unequipShipModule() " + param1 + "|" + param2);
- return;
- }// end function
- public function produceBlueprint(param1:String) : void
- {
- sendString(MSG_CLIENT_BP_PRODUCE, param1);
- Debug.print("CosmicConnector.produceBlueprint() " + param1);
- return;
- }// end function
- public function requestStructures() : void
- {
- sendString(MSG_CLIENT_BASE_STRUCTURES, "0");
- Debug.print("CosmicConnector.requestStructures() ");
- return;
- }// end function
- public function requestRequirementForBlueprint(param1:String) : void
- {
- sendString(MSG_CLIENT_BP_REQS, param1);
- Debug.print("CosmicConnector.requestRequirementForBlueprint() " + param1);
- return;
- }// end function
- public function requestScrapItemPreview(param1:Boolean, param2:String) : void
- {
- var _loc_3:* = (param1 ? ("S") : ("I")) + "|" + param2;
- sendString(MSG_CLIENT_SCRAP_PREVIEW, _loc_3);
- Debug.print("CosmicConnector.requestScrapPreview() " + _loc_3);
- return;
- }// end function
- public function scrapItem(param1:Boolean, param2:String) : void
- {
- var _loc_3:* = (param1 ? ("S") : ("I")) + "|" + param2;
- sendString(MSG_CLIENT_SCRAP_DO, _loc_3);
- Debug.print("CosmicConnector.scrapItem() " + _loc_3);
- return;
- }// end function
- public function requestTeleportList() : void
- {
- sendString(MSG_CLIENT_TELEPORT_LIST, "0");
- Debug.print("CosmicConnector.requestTeleportList() ");
- return;
- }// end function
- public function teleportToBase(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_TELEPORT_GO, param1 + "|" + param2);
- Debug.print("CosmicConnector.requestTeleportList() " + param1 + "|" + param2);
- return;
- }// end function
- public function openSalvageBox(param1:String) : void
- {
- sendString(MSG_CLIENT_SALVAGEBOX, param1);
- Debug.print("CosmicConnector.openSalvageBox() " + param1);
- return;
- }// end function
- public function requestMission(param1:String) : void
- {
- sendString(MSG_CLIENT_MISSION_REQUEST, param1);
- Debug.print("CosmicConnector.requestMission() " + param1);
- return;
- }// end function
- public function acceptMission(param1:String, param2:Boolean) : void
- {
- var _loc_3:* = param2 ? ("1") : ("0");
- sendString(MSG_CLIENT_MISSION_RESPONSE, param1 + "|" + _loc_3);
- Debug.print("CosmicConnector.acceptMission() " + param1 + "|" + _loc_3);
- return;
- }// end function
- public function requestMissionDetails(param1:String) : void
- {
- sendString(MSG_CLIENT_MISSION_DETAIL, param1);
- Debug.print("CosmicConnector.requestMissionDetails() " + param1);
- return;
- }// end function
- public function requestMissionList() : void
- {
- sendString(MSG_CLIENT_MISSION_LIST, "0");
- Debug.print("CosmicConnector.requestMissionList() " + "0");
- return;
- }// end function
- public function requestFactionRelations() : void
- {
- sendString(MSG_CLIENT_RELATIONS, "0");
- Debug.print("CosmicConnector.requestFactionRelations() " + "0");
- return;
- }// end function
- public function requestAvailableColonies() : void
- {
- sendString(MSG_CLIENT_BASEOPTIONS, "0");
- Debug.print("CosmicConnector.requestAvailableColonies() " + "0");
- return;
- }// end function
- public function joinColony(param1:String) : void
- {
- sendString(MSG_CLIENT_BUILDBASE, param1);
- Debug.print("CosmicConnector.joinColony() " + param1);
- return;
- }// end function
- public function requestScoreBoard(param1:String, param2:String, param3:int) : void
- {
- sendString(MSG_CLIENT_REPORT_REQUEST, param1 + "|" + param2 + "|" + param3);
- Debug.print("CosmicConnector.requestScoreBoard() " + param1 + "|" + param2 + "|" + param3);
- return;
- }// end function
- public function requestGCEchangeStatus() : void
- {
- sendString(MSG_CLIENT_GCE_STATUS, "0");
- Debug.print("CosmicConnector.requestGCEchangeStatus() 0");
- return;
- }// end function
- public function requestMarketOverview(param1:String) : void
- {
- sendString(MSG_CLIENT_MRKT_GETOFFERS, param1);
- Debug.print("CosmicConnector.requestMarketOverview() " + param1);
- return;
- }// end function
- public function requestMarketSubOverview(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_MRKT_TYPEGETOFFERS, param2 + "|" + param1);
- Debug.print("CosmicConnector.requestMarketSubOverview() " + param2 + "|" + param1);
- return;
- }// end function
- public function requestMarketShipOverview(param1:String) : void
- {
- sendString(MSG_CLIENT_MRKT_GETFACTIONS, param1);
- Debug.print("CosmicConnector.requestMarketShipOverview() " + param1);
- return;
- }// end function
- public function cancelGCExchangeOffer(param1:String) : void
- {
- sendString(MSG_CLIENT_GCE_CANCEL, param1);
- Debug.print("CosmicConnector.cancelGCExchangeOffer() " + param1);
- return;
- }// end function
- public function performGCTransaction(param1:String, param2:int) : void
- {
- sendString(MSG_CLIENT_GCE_TRANSACTION, param1 + "|" + param2);
- Debug.print("CosmicConnector.performGCExchange() " + param1 + "|" + param2);
- return;
- }// end function
- public function createGCExchangeOffer(param1:int, param2:int, param3:String) : void
- {
- sendString(MSG_CLIENT_GCE_OFFER, param3 + "|" + param1 + "|" + param2);
- Debug.print("CosmicConnector.createGCExchangeOffer() " + param3 + "|" + param1 + "|" + param2);
- return;
- }// end function
- public function requestSigninKey() : void
- {
- sendString(MSG_CLIENT_SIGNINGKEY, "0");
- Debug.print("CosmicConnector.requestSigninKey()");
- return;
- }// end function
- public function sendChatCommand(param1:String, param2:String, param3:String) : void
- {
- sendString(MSG_CLIENT_CHAT_SENDCOMMAND, param1 + "|" + param2 + "|" + param3);
- Debug.print("CosmicConnector.sendChatCommand() " + param1 + "|" + param2 + "|" + param3);
- return;
- }// end function
- public function changePassword(param1:String, param2:String) : void
- {
- sendString(MSG_CLIENT_SETTING_SETPASSWORD, param1 + "|" + param2);
- Debug.print("CosmicConnector.changePassoword() " + "****");
- return;
- }// end function
- public function requestEmail() : void
- {
- sendString(MSG_CLIENT_SETTING_GETEMAIL, "0");
- Debug.print("CosmicConnector.requestEmail() ");
- return;
- }// end function
- public function changeEmail(param1:String) : void
- {
- sendString(MSG_CLIENT_SETTING_SETEMAIL, param1);
- Debug.print("CosmicConnector.changeEmail() ");
- return;
- }// end function
- public function changeAvatar(param1:String) : void
- {
- sendString(MSG_CLIENT_SETTING_SETAVATAR, param1);
- Debug.print("CosmicConnector.changeAvatar() ");
- return;
- }// end function
- public function requestGCUpdate() : void
- {
- sendString(MSG_CLIENT_GCUPDATE, "0");
- Debug.print("CosmicConnector.requestGCUpdate() ");
- return;
- }// end function
- public function launchToColony(param1:String) : void
- {
- sendString(MSG_CLIENT_LAUNCH_TO_COLONY, param1);
- Debug.print("CosmicConnector.launchToColony() ");
- return;
- }// end function
- public static function getInstance() : CosmicConnector
- {
- return _this;
- }// end function
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement