Server Performance and Client Questions

Started by Mötley, Mar 17, 2016, 01:40 AM

Previous topic - Next topic

Mötley

Just some questions to clear things up in my mind.

Dofile: Does this help server performance at all? Say 1000 lines in 10 different files compared to 10000 lines in only 1 main.nut causing a server to begin to freeze and jam up?

Scriptload: This is for mainly clients joining the server right??
Example
Special functions: creating pickups, placing Vehicles (server side NOT placing cars in server.cfg) Timers/Minutes/Seconds example idle kicks, ping kicking and as well as mute checks.. Making Calls to open all garages on scriptload. Creating server side weapon pickups on server side, Placing these pickups on scriptload,

I need some personal insurance to make sure my server runs  as clean and smooth as possible!

Thanks for reading :D

DizzasTeR

There is no such thing as client functions/events. Everything is server sided. onScriptLoad is not what you think. It is triggered when a server is started and all the scripts are loaded without any errors.

onPlayerJoin(player) is called when a player joins.

Splitting the main script file into sub-files can show a better performance according to my experience.

Mötley

Quote from: Doom_Kill3R on Mar 17, 2016, 05:04 AMThere is no such thing as client functions/events. Everything is server sided. onScriptLoad is not what you think. It is triggered when a server is started and all the scripts are loaded without any errors.

onPlayerJoin(player) is called when a player joins.

Splitting the main script file into sub-files can show a better performance according to my experience.

^ Thanks I think after all this time i just happened to get confused.

I had a feeling dofile would help creating higher performance,. Thanks!!

What about having a timer for minutes and seconds on script load?

Example

  NewTimer( "Minute", 60000, 0);
  NewTimer( "Second", 1000, 0);

After that I require no more timers as i make calls off of these timers? I mean a Lot of player checks etc, There is nothing there that ruins bandwidth. ?

Thijn

Why do you need a minute timer when you have a second timer that can have a check if 60 seconds elapsed :)

Mötley

#4
Seconds
//ping
//idle
//spawn
//mute
//spawnkill
etc

^ This will be covering a lot Thijn example;Lets say something story mode

"You have"-60"Minutes to return to your vehicle

Minutes cover things like you are muted for 5 minutes, tip system etc

Thijn

That was not my point. My point was you only need 1 timer in that case, the 1 second one.
Then just check on each cycle if 60 seconds have passes, then do stuff you wanted to do in your 1 minute timer.

Mötley

Makes sense, Great idea! I just removed minutes and add support for duration of seconds equals Minutes. Thanks Thijn ,
pointers are helpful and appreciated :D !!!

EK.IceFlake

The scripts are converted to bytecode and loaded in RAM regardless of whether they were in a different file or the same.
However, it can negatively affect startup time as it initiates the compiler after the script has started.

Murdock

#8
Quote from: NE.CrystalBlue on Mar 18, 2016, 11:29 AMHowever, it can negatively affect startup time as it initiates the compiler after the script has started.

I'd rather go with a longer server startup time (which is pretty logical because it has to load all data required for the server to run) than having one huge chaotic file. Code on the server start event only gets executed once anyway.

Mötley

So in another term I am mind fd as what the two you just explained to me has me lost :o.

I know from experience I have had issues with a server jamming up in LU as I hit around 11000 script lines and after a kill players are not synced anymore and it was an awful experience ended up starting all over and just extracted work from that main.nut.

As with this build I want to ensure That it is perfection and will not have any issues and I will not settle for "IT WILL DO WHATS NEXT" My thoughts are even if it takes me a month to perfect something so simple than so be it. This server build was at 4,000 lines on just cmds,admin system and accounting system, after a lot of wasted time I was capable of shortening down script lines to 2000 which took a major amount of wasted time to configure,But was worth it.

I think i just happened to confuse script-load with on player spawn.

@NE.CrystalBlue ""The scripts are converted to bytecode and loaded in RAM regardless of whether they were in a different file or the same.
However, it can negatively affect startup time as it initiates the compiler after the script has started."""

So regardless there is no need to compile my scripts? i am a little lost on your message?

@Murdock """I'd rather go with a longer server startup time (which is pretty logical because it has to load all data required for the server to run) than having one huge chaotic file. Code on the server start event only gets executed once anyway."""

^ Please explain as my server does not require files to download. At this time there will only be One main.nut until I re split it off into maybe four different files,. Also other than garage work and map icons as you explained to me but thats not a priority at this time i prefer to have and interesting server before i get into that?

- Also I have not played on other servers yet, I only attempted once and did not like that my client was attempting to download files so i quickly exited and left for computer security reasons as you can never trust someone over the Internet, as well as avast started detecting viruses instantly.. so i have no intension of joining servers.

Thijn

Quote from: Mr_Motley on Mar 18, 2016, 04:29 PMSo regardless there is no need to compile my scripts? i am a little lost on your message?
You don't have to compile your scripts, no.

Quote from: Mr_Motley on Mar 18, 2016, 04:29 PM@Murdock """I'd rather go with a longer server startup time (which is pretty logical because it has to load all data required for the server to run) than having one huge chaotic file. Code on the server start event only gets executed once anyway."""

^ Please explain as my server does not require files to download. At this time there will only be One main.nut until I re split it off into maybe four different files,. Also other than garage work and map icons as you explained to me but thats not a priority at this time i prefer to have and interesting server before i get into that?
If you split your script into individual files, which I highly recommend for maintenance and readability, the server needs a bit more time to load them when you start your server. Players joining it wont have any negative impact since the script has already loaded when you started the server. Only needs to do it once.

Quote from: Mr_Motley on Mar 18, 2016, 04:29 PM- Also I have not played on other servers yet, I only attempted once and did not like that my client was attempting to download files so i quickly exited and left for computer security reasons as you can never trust someone over the Internet, as well as avast started detecting viruses instantly.. so i have no intension of joining servers.
This just makes me laugh out loud. If I remember correctly you run on Windows XP. How can you take security even seriously?

Mötley

Quote from: Thijn on Mar 18, 2016, 04:46 PM
Quote from: Mr_Motley on Mar 18, 2016, 04:29 PMSo regardless there is no need to compile my scripts? i am a little lost on your message?
You don't have to compile your scripts, no.

Quote from: Mr_Motley on Mar 18, 2016, 04:29 PM@Murdock """I'd rather go with a longer server startup time (which is pretty logical because it has to load all data required for the server to run) than having one huge chaotic file. Code on the server start event only gets executed once anyway."""

^ Please explain as my server does not require files to download. At this time there will only be One main.nut until I re split it off into maybe four different files,. Also other than garage work and map icons as you explained to me but thats not a priority at this time i prefer to have and interesting server before i get into that?
If you split your script into individual files, which I highly recommend for maintenance and readability, the server needs a bit more time to load them when you start your server. Players joining it wont have any negative impact since the script has already loaded when you started the server. Only needs to do it once.

Quote from: Mr_Motley on Mar 18, 2016, 04:29 PM- Also I have not played on other servers yet, I only attempted once and did not like that my client was attempting to download files so i quickly exited and left for computer security reasons as you can never trust someone over the Internet, as well as avast started detecting viruses instantly.. so i have no intension of joining servers.
This just makes me laugh out loud. If I remember correctly you run on Windows XP. How can you take security even seriously?

I have been running Windows XP for years, As I only really care for windows 95 - 98 due to MS-Dos and with newer games I can settle with Windows XP as games like GTA 5 makes me nauseous for some reason,
Sometime in the future I plan to drill holes in my PC case and place switches since I am capable of running 6 hdd stock( and I happen to have a lot of experience in micro soldering), doing this I can shut down my PC and turn a OS off and turn on windows 10 and reboot etc. At this time I use an external as my hard drive and my internal for holding only the os and I keep everything in zipped files in the external including games until i am ready to play them, as well as zip everything is passworded, I also reinstall windows every 5 months to insure no viruses have eaten needed files.

This way i can monitor the OS files every week to ensure there is not anything that should not be there as i know the entire build

 :P I also still use a old IBM keyboard as It brings me back to Comodore 64 days ;)

Thijn

In that case you're even more retarded then I thought.

I run an updated OS, use common sense on what to download, and I've never had any virus in the last 8 years or so.

Murdock

Quote from: Thijn on Mar 18, 2016, 05:41 PMIn that case you're even more retarded then I thought.

I run an updated OS, use common sense on what to download, and I've never had any virus in the last 8 years or so.

You're not alone on that one :P

Mötley

Thats nice!

Since this has gone off topic instead of creating a new topic I will post hear

*I need suggestions where should i go to next? Everything is still in one file
*I have a strong accounting system, every little thing saves, that has been bug tested like crazy!
*Admin system has been bug tested like crazy for exploits!
*Added position database
*player spawns at hospital on death
*Disabled spawnscreen
*idle kicks
*ping kicks
*3 invalid login attempts "Kick"
*server mute system with added support of mute evading"Timed amount when you rejoin your time will continue until finished"
*Tip system
*Spawning vehicle commands"player has to wait 30 seconds when he exits vehicle to spawn a new one."then it will delete the old one on new /v cmd[tested wont kill other player in other vehicles]
*added banned vehicles on cmd
*weapon/ammo saves at exact
*added a very nice stat system

*added reason why player left[Trying to see if I can fully disable server kill messages, has joined etc]
*working with spawnkill kick on time amount[still playing with the death system]