Ejemplo n.º 1
0
        public override void HandleScriptMessage(ScriptMessageReader mr)
        {
            switch (mr.ReadInteger())
            {
            case 0:
                this._success = mr.ReadBool();
                this.ShowButton(true);
                break;

            case 2:
                this.AddDialogString(App.Localize("@GAMESPY_CONNECTING"));
                break;

            case 3:
                this.AddDialogString(App.Localize("@GAMESPY_CONNECT_FAILED"));
                break;

            case 4:
                this.AddDialogString(App.Localize("@GAMESPY_INVALID_PASS"));
                break;

            case 5:
                this.AddDialogString(App.Localize("@INVALID_USERNAME_TEXT"));
                break;

            case 9:
                this.AddDialogString(App.Localize("@GAMESPY_CONNECT_CHAT_FAILED"));
                break;

            case 10:
                this.AddDialogString(App.Localize("@GAMESPY_CONNECTED"));
                break;
            }
        }
Ejemplo n.º 2
0
        public override void OnEngineMessage(InteropMessageID messageID, ScriptMessageReader mr)
        {
            switch (messageID)
            {
            case InteropMessageID.IMID_SCRIPT_OBJECT_RELEASE:
                this.RemoveObject(mr);
                break;

            case InteropMessageID.IMID_SCRIPT_OBJECTS_RELEASE:
                this.RemoveObjects(mr);
                break;

            case InteropMessageID.IMID_SCRIPT_SYNC_FLEET_POSITIONS:
                mr.ReadInteger();
                int num = mr.ReadInteger();
                for (int index = 0; index < num; ++index)
                {
                    bool flag = mr.ReadBool();
                    this.App.GameDatabase.UpdateShipFleetPosition(mr.ReadInteger(), !flag ? new Vector3?() : new Vector3?(new Vector3(mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle())));
                }
                if (!this._finalSync)
                {
                    break;
                }
                this.App.SwitchGameState <StarMapState>();
                break;
            }
        }
Ejemplo n.º 3
0
        public override void HandleScriptMessage(ScriptMessageReader mr)
        {
            switch ((Network.DialogAction)mr.ReadInteger())
            {
            case Network.DialogAction.DA_FINALIZE:
                this._success = mr.ReadBool();
                this.ShowButton(true);
                break;

            case Network.DialogAction.DA_NEWUSER_CREATING:
                this.AddDialogString(App.Localize("@NETWORKDIALOG_CREATE_NEW_USER"));
                break;

            case Network.DialogAction.DA_NEWUSER_INVALID_USERNAME:
                this.AddDialogString(App.Localize("@NETWORKDIALOG_INVALID_USERNAME"));
                break;

            case Network.DialogAction.DA_NEWUSER_NICK_IN_USE:
                this.AddDialogString("Nickname in use.");
                break;

            case Network.DialogAction.DA_NEWUSER_INVALID_PASSWORD:
                this.AddDialogString(App.Localize("@NETWORKDIALOG_INVALID_PASSWORD"));
                break;

            case Network.DialogAction.DA_NEWUSER_FAILED:
                this.AddDialogString(App.Localize("@NETWORKDIALOG_USER_CREATION_FAILED"));
                break;

            case Network.DialogAction.DA_NEWUSER_SUCCESS:
                this.AddDialogString(App.Localize("@NETWORKDIALOG_NEW_USER_CREATED"));
                break;
            }
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
        public override void OnEngineMessage(InteropMessageID messageID, ScriptMessageReader mr)
        {
            switch (messageID)
            {
            case InteropMessageID.IMID_SCRIPT_SYNC_DEFENSE_POSITIONS:
                int num1 = mr.ReadInteger();
                for (int index1 = 0; index1 < num1; ++index1)
                {
                    mr.ReadInteger();
                    int num2 = mr.ReadInteger();
                    for (int index2 = 0; index2 < num2; ++index2)
                    {
                        if (mr.ReadBool())
                        {
                            bool flag = mr.ReadBool();
                            this.App.GameDatabase.UpdateShipSystemPosition(mr.ReadInteger(), !flag ? new Matrix?() : new Matrix?(new Matrix(mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle(), mr.ReadSingle())));
                        }
                    }
                }
                if (this._finishing)
                {
                    this.App.SwitchGameState <StarMapState>();
                    break;
                }
                break;

            case InteropMessageID.IMID_SCRIPT_SYNC_DEFENSEBOAT_DATA:
                int shipID    = mr.ReadInteger();
                int OrbitalID = mr.ReadInteger();
                this.App.GameDatabase.RemoveSDBByShipID(shipID);
                if (OrbitalID != 0)
                {
                    this.App.GameDatabase.InsertSDB(OrbitalID, shipID);
                    break;
                }
                break;
            }
            base.OnEngineMessage(messageID, mr);
        }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
        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;
            }
        }