Features you'd like to see.

Started by ., Mar 23, 2016, 09:00 PM

Previous topic - Next topic

.

@KAKAN Humor me and tell me what would you do with the FPS/PING update callbacks? What would you plan on using them. Just give me a good reason because I fail to see one.



@NE.CrystalBlue Isn't that the same thing we've discussed already? And like I said, it's not something that can be implemented by me. I can implement it. But it would still use the current keybinds which means I'd still receive key events from all players. You just won't receive them in scripts.
.

Mötley

I personally do not understand what would be the purpose of having FPS/PING update callbacks. As FPS can be detected just like Ping and ping is simple to update. What is the purpose of having an fps/ping update callback?

This code can be modified and repeated for FPS
What would be the usage of the callbacks?

       
ping_kick <- array(GetMaxPlayers(), 0);

function Second() {
 
  for (local i=0;i<GetMaxPlayers();i++) {
    local player = FindPlayer(i);
   
    if (player) {
      if (player.ID == i) {       
        //ping
        if (player.Ping > 600 && admin[i] == 0) {
          ping_kick[i]++;
          if (ping_kick[i] > 30) {
            Message("[#ff0000]"+player.Name+" has been kicked for high ping ("+player.Ping+")");
            KickPlayer(player); 
          }
        }
        else {
          ping_kick[i] = 0;
        }
        //ping

function onScriptLoad() {
   
  NewTimer( "Minute", 60000, 0);
  NewTimer( "Second", 1000, 0);

This would be the max usage I would ever want Fps and ping to do. please explain the usage of the callbacks ???

Xmair


Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.

.

#34
@Mr_Motley The plugin gives you the option to retrieve a list of active players (or other entities) as an array. So you don't have to process unconnected players or entities that don't exist.

SqRoutine.Create(this, function() {
    local players = SqPlayer.FindActive();

    foreach (player in players)
    {
        if (player.Authority >= 6 /* <- fictional number*/)
        {
            continue; // This is an admin
        }
        else if (player.Ping > 600)
        {
            player.Message("Your ping is higher than 600");
            player.Kick();
        }
    }
}).SetTag("LatencyCheck");
.

Mötley

Just remember I don't use other scripting methods as i use ini. i don't understand the method you posted.

does that method above kick instant ping spikes? or will it get the average ping for a given amount of time?

Stormeus

Quote from: Mr_Motley on Mar 26, 2016, 02:24 PM
Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.

I wouldn't call it averaging, I'd call it a high ping threshold.

Mötley

Quote from: Stormeus on Mar 26, 2016, 03:26 PM
Quote from: Mr_Motley on Mar 26, 2016, 02:24 PM
Quote from: Xmair on Mar 26, 2016, 02:15 PMWhat the fuck is that.
Getting the average ping for a given amount of time.

I wouldn't call it averaging, I'd call it a high ping threshold.

Your right @Stormeus I was just trying to explain it simple,. At the end I set  the ping Threshold value to 0. also you have about > 30 to get your ping back to a normal value, rather than a instant kick, I took ping spikes in consideration when making this as I noticed a lot of VC:MP server owners have not done this and will kick instant ping spikes, which is unfair to the player base

Xmair

Good luck kicking players with 600  ping then.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

#39
it will kick anything 600 and up :P

also I'm on American soil so its possible the players ping may be crazy. as player play from Germany to all over, or if I were to get Drakes Free host the host is in France so players ping may be kinda wack just considerations

aXXo

Off-topic: I'm curious about the server performance, when calculating the average ping and average FPS of all connected players on the server through a timer/routine.

Particularly talking about Vicewar, where we easily get 40+ (frustrated) players. It is important to implement a ping limit and a FPS threshold to the server while making sure the scripts have no lag. Does a third party plugin in C++ ensure that such a process has no impact on server performance?

Stormeus

C/C++ will always be faster, but calculating averages is basic floating-point additions and divisions. Squirrel doesn't (or at least shouldn't) have a significant amount of overhead for iterating over arrays and calculating averages.

EK.IceFlake

"I'm on American soil"
Love that line :P

EK.IceFlake

Quote from: S.L.C on Mar 26, 2016, 11:41 AM@KAKAN Humor me and tell me what would you do with the FPS/PING update callbacks? What would you plan on using them. Just give me a good reason because I fail to see one.



@NE.CrystalBlue Isn't that the same thing we've discussed already? And like I said, it's not something that can be implemented by me. I can implement it. But it would still use the current keybinds which means I'd still receive key events from all players. You just won't receive them in scripts.
C++ is faster than script IO and simple conditions shouldn't be noticable in very large amounts like the fire button with 30 players when using C++.

Striker

Quote from: S.L.C on Mar 23, 2016, 09:00 PMI'd like to ask people what features do you think are missing from the official Squirrel plug-in so that I could implement them in the one that I'm working on.

Speak your mind here about situations where certain things would've made your life easier and you think would make sense to have in a scripting plug-in.

Keep in mind that your suggestion is open for debate. And if that feature already exists I'll give you an example of it. And if it's planed for later then I'll discuss the way I thought to implement it.

I'll be waiting for your feedback.


NOTE: This plug-in might be obsolete in near future since the devs are working on something else. This is for those that want to stick with Squirrel because that's what they've got used to.
Can't we do smoke/cigarette like we use to do in the game when we type a cheat?