GithubHelp home page GithubHelp logo

Incredibly laggy. about skscraft HOT 5 CLOSED

scraft-official avatar scraft-official commented on July 19, 2024
Incredibly laggy.

from skscraft.

Comments (5)

scraft-official avatar scraft-official commented on July 19, 2024

Hi,
Thank you for your report! When I was coding this plugin, it's true that i didn't made any async tasks in skScraft because the BungeeBridge API already have implemented it. During stress tests of effects and expressions, there were no problem with lag spikes or tps drop, if you can post your skript for me to try by my self to remake your issue, I will try to implement the async tasks in the future releases. If you can add too your /timings, it will help me to find the main problem.
Best regards,
Scraft

from skscraft.

scraft-official avatar scraft-official commented on July 19, 2024

Also if you can send me the information about the connection of BungeeBride between subserver and BungeeCord. The information can be found when BungeeBridge is loading, it looks like that:
image

from skscraft.

Baezor1 avatar Baezor1 commented on July 19, 2024

Connected! Server ---[109ms]---> Bungee ---[3ms]---> Server
and the command code

# Network Information
command /networkinfo [<text>]:
	aliases: /netinfo
	trigger:
		send "{@prefix} {@color-1}Grabbing Information..." to player
		set {_servers::*} to {@server-list}
		set {_offline} to 0
		set {_online} to 0
		loop {_servers::*}:
			if server loop-value is online:
				add 1 to {_online}
				set {_servers::%loop-value%::players} to number of players on server loop-value
				set {_servers::%loop-value%::online} to true
			else:
				add 1 to {_offline}
				set {_servers::%loop-value%::players} to 0
				set {_servers::%loop-value%::online} to false


		send "&8&m                               " to player
		send "{@color-3}Network Information:" to player
		send "&8• {@color-1}Total Players: {@color-2}%number of players on network%" to player
		send "&8• {@color-1}Online Servers: &f%{_online}%" to player
		send "&8• {@color-1}Offline Servers: &f%{_offline}%" to player
		send "{@color-3}Servers:" to player
		loop {_servers::*}:
			{_servers::%loop-value%::online} is true
			if {_servers::%loop-value%::players} is not 0:
				send "&8- &a%loop-value% &8({@color-2}%{_servers::%loop-value%::players}%&8)" to player
			else:
				send "&8- &a%loop-value% &8({@color-1}%{_servers::%loop-value%::players}%&8)" to player
		loop {_servers::*}:
			{_servers::%loop-value%::online} is false
			send "&8- &c%loop-value% {@color-1}&o(Offline)" to player
		send "&8&m                               " to player

from skscraft.

Baezor1 avatar Baezor1 commented on July 19, 2024

Here is the timings report.
https://timings.aikar.co/?id=b6cbf8d9c8894fdb9da689ef0820e34b
This only happens when I have the checking for the servers online mode and player counts on!

Also another part of the code for updating player counts and online mode.

# Online Mode & Player Count Checking
every 3 seconds:
	{@enable-server-updates} is true
	set {{@storage}::netPlayers} to number of players on network
	set {_servers::*} to {@server-list}
	loop {_servers::*}:
		if server loop-value is online:
			if {{@storage}::servers::%loop-value%::online} is false:
				{{@storage}::servers::%loop-value%::onlineCount} is 4
				set {{@storage}::servers::%loop-value%::online} to true
				{@enable-server-update-messages} is true
				broadcast "{@color-3}The server {@color-2}%loop-value%{@color-3} is now &aonline{@color-2}."
			add 1 to {{@storage}::servers::%loop-value%::onlineCount}
		else:
			if {{@storage}::servers::%loop-value%::online} is true:
				{@enable-server-update-messages} is true
				{{@storage}::servers::%loop-value%::onlineCount} is greater than 4
				broadcast "{@color-3}The server {@color-2}%loop-value%{@color-3} is now &coffline{@color-2}."
			set {{@storage}::servers::%loop-value%::online} to false
			delete {{@storage}::servers::%loop-value%::onlineCount}
		set {_online} to number of players on server loop-value
		if {_online} is not set:
			set {{@storage}::servers::%loop-value%::players} to 0
		else:
			set {{@storage}::servers::%loop-value%::players} to {_online}
		wait 3 tick

from skscraft.

scraft-official avatar scraft-official commented on July 19, 2024

Okey, so for now, i found the main issue, which is the connection ping between BungeeCord and Server.
For now i will work on addon to make this events async, because the server wait until answer is set. If you need a quick fix, you can use MundoSK async system, which will help you a lot to make the addon work without problems. Example code with MundoSK for async:

async
set {_online} to number of players on bungeecord server "hub1"
sync
broadcast "Number of players: %{_online}%"

If you can't find the working version of MundoSk, i have added it to this post, I hope it will help you until the version 1.4 will be released.
MundoSK.zip
Thank you for patient,
Scraft

from skscraft.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.