Esempio n. 1
0
            private static void SlaveSwitchSuccessCallback(ref SlaveModeSwitchMsg msg, MyNetworkClient sender)
            {
                MyAssembler assembler;

                MyEntities.TryGetEntityById(msg.EntityId, out assembler);
                if (assembler != null)
                {
                    assembler.IsSlave = msg.SlaveModeEnabled;
                    assembler.SetSlave();
                }
            }
Esempio n. 2
0
            private static void SlaveSwitchRequestCallback(ref SlaveModeSwitchMsg msg, MyNetworkClient sender)
            {
                MyAssembler assembler;

                MyEntities.TryGetEntityById(msg.EntityId, out assembler);
                if (assembler != null)
                {
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                    assembler.IsSlave = msg.SlaveModeEnabled;
                    assembler.SetSlave();
                }
            }
Esempio n. 3
0
            internal void RequestSlaveSwitch(bool slaveEnabled)
            {
                SlaveModeSwitchMsg msg = new SlaveModeSwitchMsg();

                msg.EntityId         = m_assembler.EntityId;
                msg.SlaveModeEnabled = slaveEnabled;

                if (Sync.IsServer)
                {
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                    m_assembler.IsSlave = msg.SlaveModeEnabled;
                    m_assembler.SetSlave();
                }
                else
                {
                    Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
                }
            }
Esempio n. 4
0
 private static void SlaveSwitchSuccessCallback(ref SlaveModeSwitchMsg msg, MyNetworkClient sender)
 {
     MyAssembler assembler;
     MyEntities.TryGetEntityById(msg.EntityId, out assembler);
     if (assembler != null)
     {
         assembler.IsSlave = msg.SlaveModeEnabled;
         assembler.SetSlave();
     }
 }
Esempio n. 5
0
 private static void SlaveSwitchRequestCallback(ref SlaveModeSwitchMsg msg, MyNetworkClient sender)
 {
     MyAssembler assembler;
     MyEntities.TryGetEntityById(msg.EntityId, out assembler);
     if (assembler != null)
     {
         Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
         assembler.IsSlave = msg.SlaveModeEnabled;
         assembler.SetSlave();
     }   
 }
Esempio n. 6
0
            internal void RequestSlaveSwitch(bool slaveEnabled)
            {
                SlaveModeSwitchMsg msg = new SlaveModeSwitchMsg();
                msg.EntityId = m_assembler.EntityId;
                msg.SlaveModeEnabled = slaveEnabled;

                if (Sync.IsServer)
                {
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                    m_assembler.IsSlave = msg.SlaveModeEnabled;
                    m_assembler.SetSlave();
                }
                else
                {
                    Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
                }
            }