Beispiel #1
0
        public void SendChangeOpenMessage(bool isOpen, bool editable = false, ulong user = 0, bool isPublic = false)
        {
            var msg = new ChangeOpenMsg()
            {
                EntityId = Entity.EntityId,
                IsOpen   = isOpen,
                Editable = editable,
                User     = user,
                IsPublic = isPublic,
            };

            Sync.Layer.SendMessageToServer(ref msg);
        }
Beispiel #2
0
        static void OnChangeOpen(MySyncTextPanel sync, ref ChangeOpenMsg msg, MyNetworkClient sender)
        {
            if (Sync.IsServer && sync.Entity.IsOpen && msg.IsOpen)
            {
                return;
            }

            sync.Entity.IsOpen = msg.IsOpen;
            sync.Entity.UserId = msg.User;

            if (!MySandboxGame.IsDedicated && msg.User == Sync.MyId && msg.IsOpen)
            {
                sync.Entity.OpenWindow(msg.Editable, false, msg.IsPublic);
            }

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
        public void SendChangeOpenMessage(bool isOpen, bool editable = false, ulong user = 0,bool isPublic = false)
        {
            var msg = new ChangeOpenMsg()
            {
                EntityId = Entity.EntityId,
                IsOpen = isOpen,
                Editable = editable,
                User = user,
                IsPublic = isPublic,
            };

            Sync.Layer.SendMessageToServer(ref msg);
        }
        static void OnChangeOpen(MySyncTextPanel sync, ref ChangeOpenMsg msg, MyNetworkClient sender)
        {
            if (Sync.IsServer && sync.Entity.IsOpen && msg.IsOpen)
                return;

            sync.Entity.IsOpen = msg.IsOpen;
            sync.Entity.UserId = msg.User;

            if (!MySandboxGame.IsDedicated && msg.User == Sync.MyId && msg.IsOpen)
            {            
                sync.Entity.OpenWindow(msg.Editable, false,msg.IsPublic);
            }

            if (Sync.IsServer)
                Sync.Layer.SendMessageToAll(ref msg);
        }