Exemplo n.º 1
0
        public void UpdatePlayerPosition(User sender, string[] args)
        {
            string uid = sender.UUID;

            pVector pos = pVector.StringToPVector(args[0]);

            Server.GetCurrent().Clients[uid].UserData.UpdatePosition(pos);

            User u = Server.GetCurrent().Clients[uid].UserData;

            Server.GetCurrent().SendRPC(sender, $"pl_update_position {uid} {u.GetPosition()}");
        }
Exemplo n.º 2
0
        public void UpdatePlayerEuler(User sender, string[] args)
        {
            string uid = sender.UUID;

            pVector euler = pVector.StringToPVector(args[0]);

            Server.GetCurrent().Clients[uid].UserData.UpdateEuler(euler);

            User u = Server.GetCurrent().Clients[uid].UserData;

            Server.GetCurrent().SendRPC(sender, $"pl_update_euler {u.UUID} {u.GetEuler()}");
        }
Exemplo n.º 3
0
        public void UpdateTransform(User sender, string[] args)
        {
            string uid = sender.UUID;

            pVector position = pVector.StringToPVector(args[0]);
            pVector euler    = pVector.StringToPVector(args[1]);

            Server.GetCurrent().Clients[uid].UserData.UpdatePosition(position);
            Server.GetCurrent().Clients[uid].UserData.UpdateEuler(euler);

            User u = Server.GetCurrent().Clients[uid].UserData;

            Server.GetCurrent().SendRPC(sender, $"pl_update_transform {u.UUID} {u.GetPosition()} {u.GetEuler()}");
        }
Exemplo n.º 4
0
        public void UpdatePlayerPosition(string[] args)
        {
            string uid = args[0];

            // Check if the user exists in our local list if not then we are out of sync
            if (!Client.GetCurrent().ConnectedUsers.ContainsKey(uid))
            {
                Client.GetCurrent().Send("sync_list");
                return;
            }

            pVector pos = pVector.StringToPVector(args[1]);

            Client.GetCurrent().ConnectedUsers[uid].UpdatePosition(pos);
        }