private void OnMechAttackShip(MechAttackShipServerRequest r) { ClientPlayer cp_attack = GetPlayerByClientId(r.AttackMechClientId); ClientPlayer cp_beAttack = cp_attack.WhichPlayer == Players.Self ? EnemyClientPlayer : SelfClientPlayer; ModuleMech attackMech = cp_attack.BattlePlayer.BattleGroundManager.GetMech(r.AttackMechId); attackMech.AttackShip(cp_beAttack); }
public void OnClientMechAttackShipRequest(MechAttackShipRequest r) { ClientA.CurrentClientRequestResponseBundle = new MechAttackMechRequest_ResponseBundle(); ClientB.CurrentClientRequestResponseBundle = new MechAttackMechRequest_ResponseBundle(); MechAttackShipServerRequest request = new MechAttackShipServerRequest(r.clientId, r.AttackMechId); Broadcast_AddRequestToOperationResponse(request); BattlePlayer cpat = GetPlayerByClientId(r.clientId); BattlePlayer cpba = cpat.MyEnemyPlayer; ModuleMech attackMech = cpat.BattleGroundManager.GetMech(r.AttackMechId); attackMech.AttackShip(cpba); Broadcast_SendOperationResponse(); }