Ejemplo n.º 1
0
        private bool FindPlayer(IMyPlayer player, long id)
        {
            if (player.IdentityId == id)
            {
                Players[id] = player;
                SteamToPlayer[player.SteamUserId] = id;
                PlayerMouseStates[id]             = new MouseStateData();

                PlayerEventId++;
                if (player.SteamUserId == AuthorSteamId)
                {
                    AuthorPlayerId = player.IdentityId;
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
        internal bool KeenFuckery()
        {
            try
            {
                if (Session?.Player == null)
                {
                    return(false);
                }

                MultiplayerId = MyAPIGateway.Multiplayer.MyId;
                PlayerId      = Session.Player.IdentityId;

                if (HandlesInput)
                {
                    List <IMyPlayer> players = new List <IMyPlayer>();
                    MyAPIGateway.Multiplayer.Players.GetPlayers(players);

                    for (int i = 0; i < players.Count; i++)
                    {
                        PlayerConnected(players[i].IdentityId);
                    }

                    PlayerMouseStates[PlayerId] = UiInput.ClientMouseState;
                }
                PlayerMouseStates[-1] = new MouseStateData();

                if (IsClient)
                {
                    SendUpdateRequest(-1, PacketType.RequestMouseStates);
                }

                return(true);
            }
            catch (Exception ex) { Log.Line($"Exception in UpdatingStopped: {ex} - Session:{Session != null} - Player:{Session?.Player != null} - ClientMouseState:{UiInput.ClientMouseState != null}"); }

            return(false);
        }
Ejemplo n.º 3
0
 internal UiInput(Session session)
 {
     _session         = session;
     ClientMouseState = new MouseStateData();
 }
Ejemplo n.º 4
0
 public override void CleanUp()
 {
     base.CleanUp();
     Data = null;
 }