SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 28/07/2017, 01:13 PM   #121
Freedom.
Big Clucker
 
Join Date: Oct 2012
Posts: 126
Reputation: 12
Default Re: YSI 4

I was using YSI 4.0 downloading by myself and changed to include with initial release by Misiur 8 days ago. Then Server CPU increases %100 after 4-5 hours later. Any ideas?
Freedom. is offline   Reply With Quote
Old 29/07/2017, 10:54 AM   #122
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 556
Default Re: YSI 4

Hello @Freedom. - can you tell which y_* libraries are you using? Please try commenting out parts of code until you find the culprit, then I'll take a closer look - it'd be bad if a bug made it onto our first release
Misiur is offline   Reply With Quote
Old 29/07/2017, 09:37 PM   #123
Freedom.
Big Clucker
 
Join Date: Oct 2012
Posts: 126
Reputation: 12
Default Re: YSI 4

Code:
#include <YSI\y_iterate>
#include <YSI\y_flooding>
#include <YSI\y_timers>
#include <YSI\y_bit>
Freedom. is offline   Reply With Quote
Old 31/07/2017, 09:08 PM   #124
Unrea1
Gangsta
 
Unrea1's Avatar
 
Join Date: Oct 2013
Location: Venezuela
Posts: 824
Reputation: 129
Default Re: YSI 4

Is it normal that it takes about 15 seconds to load the library?, before this update, this was not happening.
__________________
Unrea1 is offline   Reply With Quote
Old 01/08/2017, 10:23 PM   #125
Unrea1
Gangsta
 
Unrea1's Avatar
 
Join Date: Oct 2013
Location: Venezuela
Posts: 824
Reputation: 129
Default Re: YSI 4

Quote:
Originally Posted by ****** View Post
Load where? Compile times? Server start? Downloading from github?

Compile times went up a lot because I had to revert a change to y_malloc. Originally it used a huge array as its memory pool, but that took a long time to compile and people complained. I switched to using the heap instead, exploiting a bug to reserve a section of the heap for private use; this drastically reduced compile times as the heap is allocated at run-time, but as I'm sure you can imaging, exploiting bugs is not entirely stable. It seemed that after a few restarts, things just stopped working and I did not know why. So I had to revert to the old, more stable but slower to compile, method.

Server startup should not take that long unless you have a really slow machine. However, YSI does do a lot of work at initialisation, but that work is all designed to pre-compute things and make the rest of your execution faster. I've never really cared about startup times - servers run for days or weeks at a time, fifteen seconds is a tiny price to pay IMHO and worrying over nothing (although people here do seem to like doing that, as proven by the topics asking if "if" or "switch" are faster).

Download times going up could be because github has been having a service outage the last few days, so that should clear up soon.
I did the download from Github by the message of Misiur, with respect to the speed of initiation of sa-mp server, yes, before updating (it had the same version 4.0) began about 2-3 seconds, with the "new" Files downloaded takes between 20 - 25 seconds. But as you say, if this does not affect future in the execution of the server, it is not bad. Although it would be better to start everything quickly and smoothly in the future.

...

The compile time in PAWN seems the same to me (that depends on the number of lines in the game mode, you know ...)
__________________
Unrea1 is offline   Reply With Quote
Old 06/08/2017, 07:42 PM   #126
Michalec
Big Clucker
 
Michalec's Avatar
 
Join Date: Jun 2009
Location: Poland
Posts: 65
Reputation: 2
Default Re: YSI 4

Hi.

I was using an old YSI 3 and today decided to update YSI to 4.0 and update compiler to Zeex one.
I'm using only y_iterate, y_inline and y_bit. I've also added -Z arg to compiler, but still have the same problem:
Code:
error 035: argument type mismatch (argument 1)
There is a lot of the same errors and I don't know what's wrong.

Example lines:
Code:
sscanf(GetString("pos", q), "p<,>fff", x, y, z);
// or
sscanf(GetString("pozycja", q), "p<,>fff", StacjaInfo[q][sPosX], StacjaInfo[q][sPosY], StacjaInfo[q][sPosZ]);
// or
strcatex(str, _, C_CZERWONY"Jesteś zbanowany/a."C_SZARY"\n\nData: "C_BEZOWY"%s"C_SZARY"\nGracz: "C_BEZOWY"%s\n"C_SZARY"Host: "C_BEZOWY"%s\n"C_SZARY"Powód: "C_BEZOWY"%s"C_SZARY"\n", GetString("data"), GetString("gracz"), GetString("host"), GetString("powod"));
As you can see, GetString() is causing it:
Code:
stock GetString(field[], row=0)
{
	new temp[128];
	cache_get_field_content(row, field, temp);
	return temp;
}
This is error to this function:
Code:
error 025: function heading differs from prototype
error 021: symbol already defined: "returnstringarg"
error 090: public functions may not return arrays (symbol "returnstringarg")
What's wrong with this stock? It's not public function and it was ok when using YSI 3.
Why after including YSI 4 I can't return string?

Thanks for help in advance.
Michalec is offline   Reply With Quote
Old 06/08/2017, 07:43 PM   #127
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 556
Default Re: YSI 4

Did you update mysql as well? cache_get_field_content is one of mysql functions, it requires database handle as the first argument.
Misiur is offline   Reply With Quote
Old 06/08/2017, 07:45 PM   #128
Michalec
Big Clucker
 
Michalec's Avatar
 
Join Date: Jun 2009
Location: Poland
Posts: 65
Reputation: 2
Default Re: YSI 4

I'm using 39-4 version for now. It's to much work to update it to the latest. I don't think that mysql is a problem.
Michalec is offline   Reply With Quote
Old 06/08/2017, 07:49 PM   #129
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 556
Default Re: YSI 4

Oh, my mistake, R39-X does not require connection handle as first argument, your function is fine. You've hit a name collision: https://github.com/Misiur/YSI-Includ...utils.inc#L793 - even if you don't explicitly include y_utils it's used by (probably) y_inline.
Misiur is offline   Reply With Quote
Old 06/08/2017, 07:56 PM   #130
Michalec
Big Clucker
 
Michalec's Avatar
 
Join Date: Jun 2009
Location: Poland
Posts: 65
Reputation: 2
Default Re: YSI 4

Whaaat... I was searching on ****** for: "returnstringarg" and found nothing intresting (even when using site:github.com).

Thank you. Changed name and compiled fine.
Michalec is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.