Exemplo n.º 1
0
        public bool Restrict([Optional] Client client, [Optional] ExtendetClient extendetClient)
        {
            if (extendetClient != null)
            {
                client = GetClientByExtendetClient(extendetClient);
            }
            else
            {
                if (client == null)
                {
                    return(false);
                }
                else
                {
                    extendetClient = new ExtendetClient(client);
                }
            }



            //TODO: @Koka: Why in module ClientHandler. This should be in module Login
            //_api.setEntityInvincible(client.handle, true);
            //_api.freezePlayer(client, true);
            //_api.setEntityTransparency(client.handle, 0);
            //_api.setEntityCollisionless(client.handle, true);

            // Temp
            extendetClient.Spawn();
            return(true);
        }
Exemplo n.º 2
0
        public bool SpawnExtendetClient(ExtendetClient extendetClient)
        {
            Client client = GetClientByExtendetClient(extendetClient);

            if (client != null)
            {
                client.position = extendetClient.Properties.Position;
                client.rotation = extendetClient.Properties.Rotation;
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        private Client GetClientByExtendetClient(ExtendetClient extendetClient)
        {
            Client client = _api.getAllPlayers()
                            .First(c => c.socialClubName == extendetClient.Properties.SocialClubName);

            if (client == null)
            {
                ConsoleOutput.WriteLine(ConsoleType.Warn,
                                        $"Unable to get Client from User! Username: {extendetClient.Properties.Name} | SCName: {extendetClient.Properties.SocialClubName}");
                return(null);
            }

            return(client);
        }
Exemplo n.º 4
0
        public bool UnRestrict([Optional] Client client, [Optional] ExtendetClient extendetClient)
        {
            if (extendetClient != null)
            {
                client = GetClientByExtendetClient(extendetClient);
            }

            if (client == null)
            {
                return(false);
            }

            _api.setEntityInvincible(client.handle, false);
            _api.freezePlayer(client, false);
            _api.setEntityTransparency(client.handle, 255);
            _api.setEntityCollisionless(client.handle, false);

            return(true);
        }
Exemplo n.º 5
0
 public bool UnRestrict([Optional] Client client, [Optional] ExtendetClient extendetClient)
 {
     return(SpawnManager.UnRestrict(client, extendetClient));
 }
Exemplo n.º 6
0
        private void OnPlayerDisconnected(Client player, string reason)
        {
            ExtendetClient extendetClient = new ExtendetClient(player);

            extendetClient.Update(true);
        }