AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D] Force Mission Changer 1.4.0 (https://forums.alliedmods.net/showthread.php?t=81982)

KroleG 12-15-2008 07:51

Re: [L4D] Force mapchanger
 
Dionys, скажи на русском, что этот плагин делает :-)

Dionys 12-15-2008 08:33

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by DontWannaName (Post 727619)
Hey im running 62 plugins on a 32 slot server and not one of them makes me lag. If I were to add 1 bad one, it could screw me up and all 62 of my plugins. Just an example.

This message on what is concrete? Or it is simple flood? About what one bad plug-in there is a conversation? I have a server since CS1.6 and well I know that I do. On my l4d server there is a problem with change of mission and falling of a server in the end of mission - this plug-in has corrected this problem. The plug-in is published for the aid to people at which similar problems. If you do not have problems on a server - it is not necessary flood about it.
Simple do not establish this plug-in...
Quote:

Originally Posted by Sammy-ROCK! (Post 727664)
If you wanna keep with bad coding have fun. I personaly don't care was just trying to help you make better plugins. Also you should think on what the sourcemod function would process instead of ignoring and doing it by anyway.

I only will be glad if to appear similar, but the "optimised" plug-in, you will be which author.
My opinion remains at me - the direct command to a server will be processed faster with smaller expenses of server resources.
The cycle on a server l4d will not be more than 8. On other server this plug-in will not be started.
It is better to make 8 cycles of one times for a round, than each time at an input/exit of the player to count function maxplayers - is a usual logic, and that that in my plug-in is more on pair byte of the text it it is not important at code execution.
"bad coding" - has amused me, thx :)

Dionys 12-15-2008 08:40

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by KroleG (Post 727689)
Dionys, скажи на русском, что этот плагин делает :-)

:)
вопщем на моем сервере после установки сурсмода появилась проблема в режиме версус - когда миссия заканчивается - сервер выкидывает всех игроков, но не сбрасывает сервер на первую карту миссии. причем это проблема именно сурсмода - это видно в консоле сервера... без него все норм.
вместо этого он респит бота выжившего и зомби, оставшийся танк и зареспившийся бот бессмертны - и могут долбить друг друга часами - есть видео - ужс :) (но это происходит не всегда, именно в определенных условиях, в каких не разбирался - нет времени. я просто понял что ботов в момент окончания миссии быть не должно - и плагин подстраховывает эту ситуацию)
при смене вручную в этот момент карты сервер падает с ошибкой с++. т.е. мой плагин принудительно в конце миссии после подсчета очков кикает всех ботов и вместе с игроками переходит к первой карте указанной миссии..

Sammy-ROCK! 12-15-2008 08:48

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by Dionys (Post 727696)
I only will be glad if to appear similar, but the "optimised" plug-in, you will be which author.
My opinion remains at me - the direct command to a server will be processed faster with smaller expenses of server resources.
The cycle on a server l4d will not be more than 8. On other server this plug-in will not be started.
It is better to make 8 cycles of one times for a round, than each time at an input/exit of the player to count function maxplayers - is a usual logic, and that that in my plug-in is more on pair byte of the text it it is not important at code execution.

Before saying "but the "optimised" plug-in, you will be which author." look at the optimized code I posted before. I didn't change author if you haven't noticed. My point was just show you that you could've did it better which I'd like peoples to do with me.
Also it's weird you say "My opinion remains at me - the direct command to a server will be processed faster with smaller expenses of server resources." and waste GetMaxClients() and StrEqual. You can call GetMaxClients a small function but you can't say the same of StrEqual.

Dionys 12-15-2008 08:58

Re: [L4D] Force mapchanger
 
Thx for the remark. I ask you to read the first post again.
Concerning the help - I have told that is necessary for me - but code-pro which write here do not hurry up to help :)

KroleG 12-15-2008 09:15

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by Dionys (Post 727698)
:)
вопщем на моем сервере после установки сурсмода появилась проблема в режиме версус - когда миссия заканчивается - сервер выкидывает всех игроков, но не сбрасывает сервер на первую карту миссии. причем это проблема именно сурсмода - это видно в консоле сервера... без него все норм.
вместо этого он респит бота выжившего и зомби, оставшийся танк и зареспившийся бот бессмертны - и могут долбить друг друга часами - есть видео - ужс :) (но это происходит не всегда, именно в определенных условиях, в каких не разбирался - нет времени. я просто понял что ботов в момент окончания миссии быть не должно - и плагин подстраховывает эту ситуацию)
при смене вручную в этот момент карты сервер падает с ошибкой с++. т.е. мой плагин принудительно в конце миссии после подсчета очков кикает всех ботов и вместе с игроками переходит к первой карте указанной миссии..

оу, спс!:)

ants 12-15-2008 15:38

Re: [L4D] Force mapchanger
 
thanks, plugin works perfectly )
now i can use L4D Enforcer too, no c++ error at mapchange
********
спасибо, Dionys, пиши еще ;)

Dionys 12-16-2008 13:00

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by ants (Post 727861)
thanks, plugin works perfectly )
now i can use L4D Enforcer too, no c++ error at mapchange
********
спасибо, Dionys, пиши еще ;)

спасибо за отзыв
но хочу добавить что для повышения стабильности сервера я использую свой плагин принуждения director_no_human_zombies.
пытаюсь довести сейчас свою идею до автора плагина L4D Director Enforcer, чтобы он использовал ее в своем плагине...

FlyingMongoose 12-17-2008 03:47

Re: [L4D] Force mapchanger
 
Quote:

Originally Posted by Sammy-ROCK! (Post 727538)
I'll show you why I linked you to optimizations page.
Code:

public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(GetConVarInt(Allowed))
    {
        decl String:currentMap[64];
        GetCurrentMap(currentMap, 64); //Why get map name everytime a roundend is called? Simply get once on mapstart and your done.

        if (StrEqual(currentMap, "l4d_vs_farm05_cornfield") == true || StrEqual(currentMap, "l4d_vs_hospital05_rooftop") == true)
        {
            RoundEndCounter += 1;

            if (RoundEndCounter == 4 && StrEqual(currentMap, "l4d_vs_farm05_cornfield") == true) //Didn't we already check if we were on this map?
            {
                for (new player=1; player<=GetMaxClients(); player++) //Here you'll be using GetMaxClients() for each loop we do. If server has 16 slots GetMaxClients() will be called 16 times without a need.
                {
                    if (IsClientInGame(player) && IsFakeClient(player))
                    {
                        ServerCommand("kick %s", player); //We got a command for this: KickClient
                    }
                }

                ServerCommand("changelevel %s", "l4d_vs_hospital01_apartment"); //Why are you using %s if your setting it in core not by variable?
            }
            if (RoundEndCounter == 4 && StrEqual(currentMap, "l4d_vs_hospital05_rooftop") == true) //Again we already checked the map and if the code above matched this is a waste. Also 2nd time we check RoundEndCounter
            {
                for (new player=1; player<=GetMaxClients(); player++)
                {
                    if (IsClientInGame(player) && IsFakeClient(player))
                    {
                        ServerCommand("kick %s", player);
                    }
                }

                ServerCommand("changelevel %s", "l4d_vs_farm01_hilltop");
            }
        }
    }
}


While Sammy's intentions are to assist, he seems to do so in a somewhat degrading manner, you may respond in some sarcastic tone to him as english may not be your first language, tone does not translate well over the internet. Anyway, what sammy is emphasizing here is that this block of code is actually quite poorly optimized overall in terms of code standards, (that's a lot of nested ifs), you could go as far as move some of these if statements into their own functions to make the code look cleaner. There's a bunch of possibilities here.

However there are some simple optimization points that have been pointed out, you do only need to get the map name OnMapStart. KickClient is actually better than using the ServerCommand option as (it's rare) sometimes the servercommand method just doesn't work (also, the KickClient command utilizes indexes as opposed to strings, which is (at times) better and more optimized. And there are some unnecessary redundancies in your code.

However, we do appreciate your work and urge you to constantly improve upon yourself, when I first started sourcemod coding you should have seen the ugly crap I wrote... seriously, it was bad.

Dionys 12-17-2008 08:35

Re: [L4D] Force mapchanger
 
Thanks
I know that the plug-in code is far from an ideal
But when I spoke that at me the big lack of time - I did not joke
I have published that that have made for the my server (choice was not, and the server behaved disgustingly). Has made it wishing to help another.
Certainly - if there will be a possibility - I will be engaged in code optimisation.
A little me of the published plug-ins - first my tests in sourcemod. I created them relying on the knowledge php and only.


All times are GMT -4. The time now is 19:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.