public PlayerCombatData(ScriptMessageReader mr, int version) { this._playerID = mr.ReadInteger(); this._victoryStatus = (GameSession.VictoryStatus)mr.ReadInteger(); this.Construct(); int num1 = mr.ReadInteger(); for (int index = 0; index < num1; ++index) { this._shipData.Add(new Kerberos.Sots.Strategy.ShipData() { designID = mr.ReadInteger(), damageDealt = mr.ReadSingle(), damageReceived = mr.ReadSingle(), killCount = mr.ReadInteger(), destroyed = mr.ReadBool() }); } int num2 = mr.ReadInteger(); for (int index1 = 0; index1 < num2; ++index1) { Kerberos.Sots.Strategy.PlanetData planetData = new Kerberos.Sots.Strategy.PlanetData(); planetData.orbitalObjectID = mr.ReadInteger(); planetData.imperialDamage = mr.ReadDouble(); int num3 = mr.ReadInteger(); planetData.civilianDamage = new List <PopulationData>(); for (int index2 = 0; index2 < num3; ++index2) { PopulationData populationData = new PopulationData() { faction = mr.ReadString(), damage = mr.ReadDouble() }; } planetData.infrastructureDamage = mr.ReadSingle(); planetData.terraDamage = mr.ReadSingle(); this._planetData.Add(planetData); } int num4 = mr.ReadInteger(); for (int index = 0; index < num4; ++index) { this._weaponData.Add(new Kerberos.Sots.Strategy.WeaponData() { weaponID = mr.ReadInteger(), damageDealt = mr.ReadSingle() }); } if (version >= 1) { this._fleetCount = mr.ReadInteger(); } else { this._fleetCount = 0; } }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { if (messageId != InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP || !(message.ReadString() == "Position")) { return(false); } this._position = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); return(true); }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { if (base.OnEngineMessage(messageId, message)) { return(true); } if (messageId != InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP || !(message.ReadString() == "WeaponToggleStateChanged")) { return(false); } this.m_ToggleStateOn = message.ReadBool(); return(true); }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { if (messageId == InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP) { if (message.ReadString() == "PlanetPopUpdate") { this.Population = message.ReadDouble(); this._lastAttackingObject = this.App.GetGameObject(message.ReadInteger()); return(true); } } else { App.Log.Warn("Unhandled message (id=" + (object)messageId + ").", "game"); } return(false); }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { InteropMessageID interopMessageId = messageId; if (messageId == InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP) { if (message.ReadString() == "BeamFinished") { this.m_Finished = true; this.m_Succeeded = message.ReadInteger() == 1; this.m_Resources = message.ReadInteger(); } return(true); } App.Log.Warn("Unhandled message (id=" + (object)interopMessageId + ").", "combat"); return(base.OnEngineMessage(messageId, message)); }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { if (messageId == InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP) { string str = message.ReadString(); if (str == "Update") { this._percentConsumed = message.ReadSingle(); return(true); } if (str == "IsActive") { this._isActive = message.ReadBool(); return(true); } } return(false); }
public override void HandleScriptMessage(ScriptMessageReader mr) { switch ((Network.DialogAction)mr.ReadInteger()) { case Network.DialogAction.DA_FINALIZE: this._success = mr.ReadBool(); this._app.UI.CloseDialog((Dialog)this, true); break; case Network.DialogAction.DA_RAW_STRING: this.AddString(mr.ReadString()); break; case Network.DialogAction.DA_CONNECT_CONNECTING: this.AddString("Connecting to Host."); break; case Network.DialogAction.DA_CONNECT_FAILED: this.AddString("Failed to connect to Host."); break; case Network.DialogAction.DA_CONNECT_SUCCESS: this.AddString("Connection to Host succeeded."); break; case Network.DialogAction.DA_CONNECT_TIMED_OUT: this.AddString("Connection to Host timed out."); break; case Network.DialogAction.DA_CONNECT_INVALID_PASSWORD: this.AddString("Invalid password."); break; case Network.DialogAction.DA_CONNECT_NAT_FAILURE: this.AddString("NAT Negotiation failed."); break; } }
public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message) { switch (messageId) { case InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP: string str = message.ReadString(); if (str == "Position") { this._position = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); return(true); } if (str == "ShipSpeedScale") { this._shipSpeedState = (ShipSpeedState)message.ReadInteger(); return(true); } if (str == "TargetFacingAngle") { this._targetFacingAngle = (TargetFacingAngle)message.ReadInteger(); return(true); } break; case InteropMessageID.IMID_SCRIPT_MANEUVER_INFO: this._position = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); this._rotation = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); this._velocity = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); this._destination = new Vector3(message.ReadSingle(), message.ReadSingle(), message.ReadSingle()); return(true); default: App.Log.Warn("Unhandled message (id=" + (object)messageId + ").", "combat"); break; } return(false); }