Exemplo 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();
                }
            }
Exemplo 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();
                }
            }
Exemplo 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);
                }
            }
Exemplo 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();
     }
 }
Exemplo 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();
     }   
 }
Exemplo 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);
                }
            }