Results 1 to 10 of 14

Thread: WCS Investigation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. Default

    So if the left hand glitch was due to bad coding of the restrictions on weapons or was from someone leaving and you taking there restrictions for a little anyway to do a check to make sure it the correct player before applying the restrictions so the only left hand glitch is faulty coding?

  2. Default

    I agree with maynard and keeping the ultimates as they are with those that can use them right at the start. I can't think of one that poses a real problem. As Maynard said, Crypt lord has a high cool down and it's random so it's not much of an advantage.

    If you were a beautiful sound in the echos all around, I'd be your harmony.

  3. Default

    Huge vagabond nerf. I think the base speed should be altered to compensate for the slow speed. The race is too slow, why change something thats been that way for years...
    Spasm <ibis>: i thought mexicans came to murrica not canada
    Spasm <ibis>: :O
    Cyber ibis.a: free dental and health plan ^
    Cyber ibis.a: sry mmurica, u got outbid
    Cyber ibis.a: senor.
    Spasm <ibis>: its not truly free
    Spasm <ibis>: someone pays for it
    Spasm <ibis>: rich ppl
    Cyber ibis.a: exactly
    Cyber ibis.a: canadians
    Cyber ibis.a: i just get the free stuff
    Spasm <ibis>: typical mexican

  4. Default

    Quote Originally Posted by Spasm View Post
    Huge vagabond nerf. I think the base speed should be altered to compensate for the slow speed. The race is too slow, why change something thats been that way for years...
    this ^
    vagabond needs to go back to what it was before the last nerf...
    its not an op race, people have been trained to hunt vagabonds down and it shouldnt have that HUGE nerf...
    it killed the race
    specially that bash races are still out, and jack is fucking out too -.-

    vaga should have an increased seem to balance this useless nerf that slowed it down WAYYY more than b efore the orange updates...
    even before the updates, vaga has had the same speed and agility , specially for teleport, as just before the last nerf... nerfing it now would be going against the old ibis wcs standards for that race... a huge let down...
    Started from bottom. Now we here. <IBIS>


    Quote Originally Posted by ZERO View Post
    Trying to hack in IBIS is like trying to kill someone in a police station, not the best idea...

  5. Default

    Dear god! I found the reason for the timer skip...

    ---------- Post added at 03:29 PM ---------- Previous post was at 03:27 PM ----------

    You all may remember me complaing about this code:
    Quote Originally Posted by ZERO View Post
    The following method runs every .1 second to process weapon restrictions. Optimizations to this method may correct some bugs: (from War3Source_Engine_Weapon)
    Code:
    public Action:DeciSecondTimer(Handle:h,any:a){
        timerskip--;
        if(timerskip<1){
            timerskip=10;
            for(new client=1;client<=MaxClients;client++){
                /*if(true){ //test
                    new wpnent = GetCurrentWeaponEnt(client);
                    if(FindSendPropOffs("CWeaponUSP","m_bSilencerOn")>0){
                    
                        SetEntData(wpnent,FindSendPropOffs("CWeaponUSP","m_bSilencerOn"),true,true);
                        }
                        
                }*/
            
                if(hasAnyRestriction[client]&&ValidPlayer(client,true)){
                
                    new String:name[32];
                    GetClientName(client,name,sizeof(name));
                    //PrintToChatAll("ValidPlayer %d",client);
                    
                    new wpnent = GetCurrentWeaponEnt(client);
                    //PrintIfDebug(client,"   weapon ent %d %d",client,wpnent);
                    //new String:WeaponName[32];
                    
                    //if(IsValidEdict(wpnent)){
                        
                //    }
        
                    //PrintIfDebug(client,"    %s res: (%s) weapon: %s",name,weaponsAllowed[client],WeaponName);        
                //    if(strlen(weaponsAllowed[client])>0){
                    if(wpnent>0&&IsValidEdict(wpnent)){
                        
                        
                        if (CheckCanUseWeapon(client,wpnent)){
                            //allow
                        }
                        else
                        {
                            //RemovePlayerItem(client,wpnent);
                            
                            //PrintIfDebug(client,"            drop");
                            
                            
                            SDKCall(hSDKWeaponDrop, client, wpnent, false, false);
                            AcceptEntityInput(wpnent, "Kill");
                            //UTIL_Remove(wpnent);
                            
                        }
            
                    }
                    else{
                        //PrintIfDebug(client,"no weapon");
                        //PrintToChatAll("no weapon");
                    }
                //    }
                }
            }
        }
    }
    Here it is again with the code cleaned:
    Code:
    public Action:DeciSecondTimer(Handle:h,any:a)
    {
        timerskip--;
        if(timerskip<1)
        {
            timerskip=10;
            for(new client=1;client<=MaxClients;client++)
            {    
                if(hasAnyRestriction[client]&&ValidPlayer(client,true))
                {
                
                    new String:name[32];
                    GetClientName(client,name,sizeof(name));
                    
                    new wpnent = GetCurrentWeaponEnt(client);
        
    
                    if(wpnent>0&&IsValidEdict(wpnent))
                    {
                        if(CheckCanUseWeapon(client,wpnent)){
                            //allow
                        }
                        else
                        {    
                            SDKCall(hSDKWeaponDrop, client, wpnent, false, false);
                            AcceptEntityInput(wpnent, "Kill");                        
                        }
            
                    }
                }
            }
        }
    }
    So here is the clusterfuck of wtf programing we have today. First part of the issue here is we have code that is designed to run on mutiple games which logically leads to errors. Sorry but it is best to use the best code for each game even if it takes more time. We already know that the code used above is not ideal for weapon removal. This is why we always try to remove the weapon before this code can activate b/c if it does it creates a glitch/crash. The ultimate solution would be to implement the correct weapon removal code here to correct the issue.

    Next we have the issue of the timerskip--; part. Holy lazy fucking shit! So as we know this code runs every .1 seconds but you will see that this is here to make it so that it will skip 9 times and then run. So we get this:
    0.0 seconds = run timerskip=10
    0.1 seconds = skip timerskip=9
    0.2 seconds = skip timerskip=8
    0.3 seconds = skip timerskip=7
    0.4 seconds = skip timerskip=6
    0.5 seconds = skip timerskip=5
    0.6 seconds = skip timerskip=4
    0.7 seconds = skip timerskip=3
    0.8 seconds = skip timerskip=2
    0.9 seconds = skip timerskip=1
    1.0 seconds = run timerskip=10

    So how often does the program run? EVERY SECOND! So why they fuck not set the timer to 1 second. I will now tell you and I hope your sitting down. The programer decided this while working on the method but was too lazy to go back to the timer to change 0.1 to 1.0! YES that is the high qualtity programing we got here! Now I do not know who worked on this part of war3 if I remember correctly there was some other programers before Ownz took over everything b/c I doubt he would have done this as I know he is better than this.

    So we will be fixing that shit.

    Now onto order of fucking operations... yes we are reading from an array hasAnyRestriction[] beofre checking if the dam client we are checking for IS EVEN VALID while we are INSIDE OF A LOOP!!!!!!!

    BUT IT GETS BETTER! We also have:

    Code:
                    new String:name[32];
                    GetClientName(client,name,sizeof(name));
    Which does, you guessed it NOTING. Not only is the string not being initilized as decl but it is totally worthless. WE ARE CREATING 32 slot arrays for every player in the server and storing their names in them every second for NO REASON. So that shit will be deleted!

    One thing that is clear from reading over the sourcecode now that I actually know how to program. This shit is fucked up all over the pace. So here is the plan, after all the races get reprogramed I will then update to the latest war3 release. I will then go though every single line of all the war3 programes and reprogram every single one of them until 100% of all the code is fucking logicall and correct.

    As I do not have any idea how to use the svn shit I will then just package my modified source and post it over on war3 for them to use to fix it for everyone. Hopefully they use it. If not at least our server will be really fucking stable.
    ---------- Post added at 03:38 PM ---------- Previous post was at 03:29 PM ----------

    Today I was working to fix this program b/c it has caused issues with proper weapon removal since the hotfix I released the other day to fix some broken code due to a valve update.

    I found the reason for the terrible idea and here is where it comes from. But first lets think about something I did not notice when I read that code the first time, timerskip is a GLOBAL variable and here is why:
    Code:
    CalculateWeaponRestCache(client){
        new num=0;
        new limit=War3_GetRacesLoaded();
        new highestpri=0;
        for(new raceid=0;raceid<=limit;raceid++){
            restrictionEnabled[client][raceid]=(strlen(weaponsAllowed[client][raceid])>0)?true:false;
            if(restrictionEnabled[client][raceid]){
                
                
                num++;
                if(restrictionPriority[client][raceid]>highestpri){
                    highestpri=restrictionPriority[client][raceid];
                }
            }
        }
        hasAnyRestriction[client]=num>0?true:false;
        
        
        highestPriority[client]=highestpri;
        
        timerskip=0; //force next timer to check weapons
    }
    timerskip=0; //force next timer to check weapons!!!!!!!!!111111111
    REALLY NOW so that is how we call methods. This code ensures that the program checks and removes restricted weapons after the restriction is enabled rather than wait lets say 1 second. However the cause of this is to run a loop every .1 seconds instead of every 1 second for efficiency.

    Below is the solution to this impossible problem:
    Code:
    public OnPluginStart()
    {
        CreateTimer(1.0,DeciSecondTimer,_,TIMER_REPEAT);
    Code:
    CalculateWeaponRestCache(client){
        new num=0;
        new limit=War3_GetRacesLoaded();
        new highestpri=0;
        for(new raceid=0;raceid<=limit;raceid++){
            restrictionEnabled[client][raceid]=(strlen(weaponsAllowed[client][raceid])>0)?true:false;
            if(restrictionEnabled[client][raceid]){
                
                
                num++;
                if(restrictionPriority[client][raceid]>highestpri){
                    highestpri=restrictionPriority[client][raceid];
                }
            }
        }
        hasAnyRestriction[client]=num>0?true:false;
        
        
        highestPriority[client]=highestpri;
        
        CheckRestrections(); //force to check weapons
    }
    Code:
    public Action:DeciSecondTimer(Handle:h,any:a)
    {
        CheckRestrections();
    }
    
    public Action:CheckRestrections()
    {
        for(new client=1;client<=MaxClients;client++)
        {            
            if(hasAnyRestriction[client]&&ValidPlayer(client,true))
            {                
                new wpnent = GetCurrentWeaponEnt(client);
                
                if(wpnent>0&&IsValidEdict(wpnent))
                {
                    //Runs code below if weapon is blocked
                    if(!CheckCanUseWeapon(client,wpnent))
                    {                        
                        CS_DropWeapon(client, wpnent, false, false);
                        AcceptEntityInput(wpnent, "Kill");
                    }
                    
                }
            }
        }
    }
    Note obviously those are not actual final release code versions I just posted a lot more has been cleaned up after this post.
    Last edited by ZERO; 09-24-2012 at 02:56 PM.



  6. Default

    holy shit man, sounds like a headache :P

    how long did it take u to find + process a fix ?
    Started from bottom. Now we here. <IBIS>


    Quote Originally Posted by ZERO View Post
    Trying to hack in IBIS is like trying to kill someone in a police station, not the best idea...

  7. Default

    About 3min...

    As soon as I saw that line I knew what was wrong and what I needed to do to fix it.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •