ASECO 2.2.2 and stuff

This forum is dedicated to the Aseco/Rasp 2 server records and control script by Flo and Assembler Maniac. Announcements and issues can be discussed in this forum.

Moderators: Flo, f*ckfish, Assembler Maniac, TM-Patrol

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO 2.2.2 and stuff

Post by Xymph » 07 Jul 2009 19:48

nocturne wrote:Interesting idea, but somehow I feel that forcing the delay in every instance will just end up in more complications -- mostly while doing the heavier work, ie calculating the ranks.
Nah, remember (X)Aseco is still a single-threaded system, so when it's recomputing ranks, that's a single continuous calculation until it's done, and only then processing returns to the main loop.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 08 Jul 2009 19:42

Xymph wrote:Nah, remember (X)Aseco is still a single-threaded system, so when it's recomputing ranks, that's a single continuous calculation until it's done, and only then processing returns to the main loop.
That's exactly what I'm implying... been plenty of instances where the length of time taken to calculate the ranks on our server caused problems with the ta auto-timing and jukebox, amongst other things. Sure we're an extreme case, but that fifth of a second could only increase the problems.

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO 2.2.2 and stuff

Post by Xymph » 08 Jul 2009 19:57

nocturne wrote:
Xymph wrote:Nah, remember (X)Aseco is still a single-threaded system, so when it's recomputing ranks, that's a single continuous calculation until it's done, and only then processing returns to the main loop.
That's exactly what I'm implying... been plenty of instances where the length of time taken to calculate the ranks on our server caused problems with the ta auto-timing and jukebox, amongst other things. Sure we're an extreme case, but that fifth of a second could only increase the problems.
You're missing the point, the rank calculation isn't interrupted or delayed by additional fifths of any second being added to the main loop, so that change to main loop makes no difference in what happens at the end of each track.

The fact that the reranking itself takes a long time on a server with lots of players and tracks in the database is another matter, that algorithm is indeed not very efficient. Back in XAseco v1.04 I developed a far better one, taking only a quarter of the previous time. AM may want to take a look at that and incorporate it in the next A/R2 release.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

[SA.fr] Tybos
cyclist
cyclist
Posts: 45
Joined: 19 Jun 2008 11:06
Owned TM-games: TMU, TMUF

Re: ASECO 2.2.2 and stuff

Post by [SA.fr] Tybos » 08 Jul 2009 20:13

Thanks for answering to nocturne Xymph.

I'd be interested in your thoughts too Xymph. Does this improvement make sense to you ? In what extense could it be generalised.
I'm thinking of an adaptable time of sleep that would only fill the blanks in aseco process. For instance, the loop execution time will be measured and completed to 200 ms in a sleep. So that when there are many callbacks or heavy tasks, following callbacks won't be too much delayed and when few things happen, the script will be lighter for the machine.
[SA.fr] TyBos

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 08 Jul 2009 21:21

What I'm trying to say is when the endrace event is invoke, when the ranks are calculated obviously, if this loop takes an inordinate amount of time, by the time the endchallenge event is invoked in the next loop, things such as the jukebox which run on that event may be pushed past the point were the next track is already loading, especially when adding another fifth of a second... I don't think it's that hard to comprehend, hehe.

An adaptable delay would be preferable, and easy enough to code up. All you'd need to do is use microtime() and parse it into a numeral at the beginning of the loop, then at the end of the loop do the same, and compare the two resulting variables and add the appropriate delay. I'd think a quarter second would be plenty.

error55o
cyclist
cyclist
Posts: 42
Joined: 05 Jul 2009 21:34
Owned TM-games: TMNF, TMUF,TM

Re: ASECO 2.2.2 and stuff

Post by error55o » 08 Jul 2009 21:30

error55o wrote:
schmidi wrote:
error55o wrote:seems fine to me :( but still password is wrong
since your are using servermania, make sure you are editing the right dedicated-config, or do it in servermania...
where would I find that lol

in the mean time, I've stopped using ServerMainia and just running the server on it's own I get up to this point

Code: Select all

[Aseco] Connection established successfully!
[LocalDb] Load settings file ...
[LocalDb] Try to connect to MySQL server
[PHP Warning] mysql_connect(): OK packet 6 bytes shorter than expected on line 6
0 in file C:\Games\TmNationsForever\aseco\plugins\plugin.localdb.php
[PHP Warning] mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using old au
thentication on line 60 in file C:\Games\TmNationsForever\aseco\plugins\plugin.l
ocaldb.php
[ASECO Error] [LocalDb] Could not authenticate at MySQL server! on line 61 in fi
le C:\Games\TmNationsForever\aseco\plugins\plugin.localdb.php
PHP Warning:  date(): It is not safe to rely on the system's timezone settings.
You are *required* to use the date.timezone setting or the date_default_timezone
_set() function. In case you used any of those methods and you are still getting
 this warning, you most likely misspelled the timezone identifier. We selected '
Europe/London' for '1.0/DST' instead in C:\Games\TmNationsForever\aseco\aseco.ph
p on line 1881
[07/06,23:07:59] Beginning to shutdown Aseco due to an error ...
ideas???
I gave up, I'm using TMgery and that works well so I'm sorry guys, would have been cool to use this :(
Dream the impossible dream
http://e55o.game-host.org/

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 08 Jul 2009 21:43

error55o wrote: I gave up, I'm using TMgery and that works well so I'm sorry guys, would have been cool to use this :(
Pretty obvious from the error... you need to set up your mysql connection properly.

For the last error, set your timezone in in your php.ini... though don't know why it'd be a problem

Code: Select all

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
date.timezone =
Set to your timezone... list can be found here (link).

error55o
cyclist
cyclist
Posts: 42
Joined: 05 Jul 2009 21:34
Owned TM-games: TMNF, TMUF,TM

Re: ASECO 2.2.2 and stuff

Post by error55o » 08 Jul 2009 21:53

nocturne wrote:
error55o wrote: I gave up, I'm using TMgery and that works well so I'm sorry guys, would have been cool to use this :(
Pretty obvious from the error... you need to set up your mysql connection properly.

For the last error, set your timezone in in your php.ini... though don't know why it'd be a problem

Code: Select all

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
date.timezone =
Set to your timezone... list can be found here (link).
it was set up correctly, had a account just for it, privileges were set to all for it too.

as for time zone, all I'm gonna say is "Do'h" should have seen that but 4 days of trying with little sleep and determination faded, will retry it later this week :) when I'm recharged and I have spare time :D
Dream the impossible dream
http://e55o.game-host.org/

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: ASECO 2.2.2 and stuff

Post by Xymph » 08 Jul 2009 23:10

nocturne wrote:What I'm trying to say is when the endrace event is invoke, when the ranks are calculated obviously, if this loop takes an inordinate amount of time, by the time the endchallenge event is invoked in the next loop, things such as the jukebox which run on that event may be pushed past the point were the next track is already loading, especially when adding another fifth of a second... I don't think it's that hard to comprehend, hehe.
Nope, you're right about the rank calculations taking a long time being a problem, as per my previous post. But if you look at function releaseEvent in aseco.php, you'll see that all functions registered for a given event (e.g. onEndRace) are invoked in one foreach loop, before the main loop resumes. So again, any small delays added there don't affect jukeboxing and stuff, because all those are executed in one go before returning to the main loop.

Now as for that delay itself...
[SA.fr] Tybos wrote:I'd be interested in your thoughts too Xymph. Does this improvement make sense to you ? In what extense could it be generalised.
I have been thinking about it a little, but I don't know yet whether it is a good or bad thing, or makes no difference. Your load graph looked somewhat convincing, but I'm not yet convinced there aren't any other adverse effects (other than the one nocturne is confused about :wink: ).
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

[SA.fr] Tybos
cyclist
cyclist
Posts: 45
Joined: 19 Jun 2008 11:06
Owned TM-games: TMU, TMUF

Re: ASECO 2.2.2 and stuff

Post by [SA.fr] Tybos » 09 Jul 2009 06:45

nocturne wrote:An adaptable delay would be preferable, and easy enough to code up. All you'd need to do is use microtime() and parse it into a numeral at the beginning of the loop, then at the end of the loop do the same, and compare the two resulting variables and add the appropriate delay. ...
First, thanks for the tip nocturne, but how do you think I managed to measure all this stuff, do statistics, analyse what was going on and suggest a solution ?


In order to add some information about my measurements, I'll give some figures.
These figures are highly dependent on the server capabilities and on its load, still it gives a pretty good idea of what is going on :
Without any sleep time wrote: This figures have been calulated on 23min28
Number of loops executed : 314 605
Average Total time spent in the loop : 4.08 ms

218,8 loops per second !!
With a 150 ms fixed sleep time wrote: This figures have been calulated on 37h29
Number of loops executed : 633 463
Time spent sleeping : 26h23 (70,4%)

4,7 loops per second

Average Total time spent in the loop : 62.3 ms
including
70,5 % in executeCallbacks()
0,3 % in event "onMainLoop" + CallVoteUpdate()
0,02 % in executeCalls()
29,1 %in updateFramework()
Other thing, we have to say that suprisingly, Aseco menus and plugins are responding much faster in game. I say surprisingly because we added a delay but it seems the load average generated even more delay !
[SA.fr] TyBos

[SA.fr] Tybos
cyclist
cyclist
Posts: 45
Joined: 19 Jun 2008 11:06
Owned TM-games: TMU, TMUF

Re: ASECO 2.2.2 and stuff

Post by [SA.fr] Tybos » 19 Jul 2009 08:02

Assembler Maniac, do you really have nothing to say about this ?

Original post

Figures
[SA.fr] TyBos

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 19 Jul 2009 18:23

Hi all.

I haven't forgotten about releasing it, I've been running on PHP 5.3.0 and cleaning up code that's been causing problems on it. Everything should still work fine on 5.2.x, but I don't want anyone coming up with problems if they have 5.3 on their machine.


Tybo: As for the delay in the loop, I'm not sure it's necessary. All you're doing is guaranteeing that other processes get time slices. If the server is busy, then there's more need for ASECO to do as much work as it can to keep up. Having individual plugins limit their number of calls per second would probably be more helpful.

SilentStorm
wheelbarrow operator
wheelbarrow operator
Posts: 19
Joined: 30 Sep 2008 18:37
Owned TM-games: TMUF

Re: ASECO 2.2.2 and stuff

Post by SilentStorm » 28 Aug 2009 03:20

I Just downloaded the Files and was just going through all the .xml Files in the NewInstall Folder to make some adaptions / checking the configuration and stuff.

In rasp.xml you have an opening <track_rec_loc> Tag that you never close. You need to close it before you close the </rasp> tag.

due to this I get the following ErrorLog from Aseco... Note that there are a few other Errors beside the obvious Tag Error I discovered while changing the Config Files....

Code: Select all

# initialize ASECO ############################################################
[Aseco] PHP Version is 5.2.6
[Aseco] Load settings [config.xml]
[Aseco] Load styles [./styles/standard.xml]
###############################################################################
#
# Aseco v2.3.0 running on 217.13.196.57:5005
#
# Authors: Florian Schnell and Brad Mettee (RASP)
#
###############################################################################
[Load Plugin] [plugin.localdb.php] [Name:LocalDb] [Ver:1.2]
[Load Plugin] [plugin.tmxlinker.php] [Name:TmxLinker] [Ver:1]
[Load Plugin] [plugin.about.php] [Name:About] [Ver:1]
[Load Plugin] [plugin.statusbar.php] [Name:Statusbar] [Ver:1]
[Load Plugin] [plugin.stats.php] [Name:Stats] [Ver:1]
[Load Plugin] [plugin.records.php] [Name:Records] [Ver:1]
[Load Plugin] [plugin.example.php] [Name:Example] [Ver:1]
[Load Plugin] [plugin.help.php] [Name:Help] [Ver:1]
[Load Plugin] [plugin.emotics.php] [Name:Emotics] [Ver:1]
[Load Plugin] [plugin.admin.php] [Name:Admin] [Ver:1]
[Load Plugin] [plugin.plugins.php] [Name:Plugins] [Ver:1]
[Load Plugin] [rasp/plugin.matchsave2.php] [Name:MatchSave2] [Ver:2.5]
[Load Plugin] [rasp/plugin.rasp.php] [Name:Rasp] [Ver:2.4]
[Load Plugin] [rasp/plugin.rasp_jukebox.php] [Name:JukeBox] [Ver:1.8]
[Load Plugin] [rasp/plugin.rasp_karma.php] [Name:RaspKarma] [Ver:1.1]
[Load Plugin] [rasp/plugin.rasp_autotime.php] [Name:RaspAutotime] [Ver:1]
[Load Plugin] [rasp/plugin.rasp_chat.php] [Name:ChatCommands] [Ver:1.2]
[Load Plugin] [rasp/plugin.rasp_players.php] [Name:RaspPlayerAdmin] [Ver:1.1]
[Load Plugin] [rasp/plugin.rasp_cptimes.php] [Name:RaspCPTimes] [Ver:1.1]
[Load Plugin] [rasp/plugin.rasp_adminmsg.php] [Name:AdminMsgs] [Ver:1.1]
[Load Plugin] [rasp/plugin.rasp_chatbot.php] [Name:ChatBot] [Ver:1]
[Load Plugin] [rasp/plugin.rasp_shownext.php] [Name:RaspShowNext] [Ver:1.1]
[Load Plugin] [rasp/plugin.rasp_ms.php] [Name:RaspMatchSettings] [Ver:1]
[Load Plugin] [plugin.fufi.widgets.php] [Name:FufiWidgets] [Ver:0.80c]
[Load Plugin] [chat.dedimania.php] [Name:DediMania_Chat] [Ver:1.0]
[Load Plugin] [plugin.dedimania.php] [Name:DediMania] [Ver:1.0]
[Load Plugin] [plugin.checkpoints.php] [Name:CheckpointsExtended] [Ver:1.0]
No authitems added
[Aseco] Try to connect to server on <Some_Secret_ip_here>:5005
[Aseco] Authenticated with username 'SuperAdmin' and password '********************'
[Aseco] Connection established successfully!
[LocalDb] Load settings file ...
[LocalDb] Try to connect to MySQL server
[LocalDb] MySQL Server Version is 5.0.51b-community
[RASP] Cleaning up unused data ...
[RASP] *-*-*-*-*-* RASP 2.4 is running! *-*-*-*-*-*
[RASP] ...Loading Settings
[ASECO Warning] [XML Error 76] Mismatched tag on line 31
{RASP_ERROR} - Config file parse error! (rasp.xml)
[ASECO Warning] [XML Error 76] Mismatched tag on line 31
[PHP Warning] Invalid argument supplied for foreach() on line 22 in file K:\TMNF Server\aseco2.2.2\plugins\rasp\plugin.rasp_karma.php
[RASP Karma] Cleaning up unused data ...
[ASECO Warning] [XML Error 76] Mismatched tag on line 31
[ASECO Warning] [XML Error 76] Mismatched tag on line 31
[PHP Warning] Invalid argument supplied for foreach() on line 21 in file K:\TMNF Server\aseco2.2.2\plugins\rasp\plugin.rasp_chat.php
[Aseco] Synchronizing with dedicated server ...
[08/28,05:04:09] << xyz joined the game [97]
[08/28,05:04:10] << zyx joined the game [94]
[RASP] Error - TMX Directory (/home/tmf/server/GameData/Tracks/Challenges/TMX) does not exist
[RASP] Error - TMX Directory (/home/tmf/server/GameData/Tracks/Challenges/TMX) can not be written to
[RASP MS] Error - MatchSettings Directory (/home/tmf/server/GameData/Tracks//MatchSettings) does not exist
[RASP MS] Error - MatchSettings Directory (/home/tmf/server/GameData/Tracks//MatchSettings) can not be written to
[08/28,05:04:12] Beginning to shutdown Aseco due to an error ...
[08/28,05:04:12] >> xyz left the game [97]
Notice: Undefined offset:  5 in K:\TMNF Server\aseco2.2.2\types\manialinkframework.class.php on line 171
[08/28,05:04:12] >> zyx left the game [94]
Notice: Undefined offset:  5 in K:\TMNF Server\aseco2.2.2\types\manialinkframework.class.php on line 171
# initialize ASECO ############################################################
I think you should add an if (is_array($VAR)) around each foreach Loop.
Then you have double Slashes in the MatchSettings Path.
Oh and ignore the Errors about not beeing able to write to those directories... Its because im running Aseco locally but connecting it to an online Server :D That might even be why it says they dont exist while they do.

[EDIT]
I just decided to close the open tag right before <messages> is opened and run Aseco on a Local Server.
Dont know if its related to that decision but plugin.rasp.php now complains about mysql_fetch_object not using a valid SqL Result in Line 243 and 246. You should probably check if a Query was successful before starting using the Results of the Query even though running the Query in question manually it did return the Results one would expect...

The same goes for plugin.localdb.php on Line 397 this time from mysql_num_rows

Also if run on an existing Aseco Database it seems to try and insert every challenge into the DB again when the challenge is loaded, which results in an Sql error because of a duplicate UId Entry which is defined as unique in the DB. It also does not read the existing Records for the challenges and claims there is no Record for the Track. This goes for every single Track that is already in the Database once it gets loaded by the Server. I havent tried a new challenge which isnt in the Database yet but I will do later today.

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 28 Aug 2009 04:51

SilentStorm wrote:I Just downloaded the Files and was just going through all the .xml Files in the NewInstall Folder to make some adaptions / checking the configuration and stuff.
Ok, track_rec_loc doesn't really belong in there, and was probably something I started working on, got interrupted, and forgot I had added. Sorry about that. I'll correct it soon.

As for the other errors, they're probably related to the tag problem., but might be something else entirely.

This set of scripts was running on the ShredCompany server up until a day or two ago when I had to take it down to run a server for another game (limited mem on the box). It's been up and stable for multiple weeks, so any problems you're having are probably related to configuration.

Did you create the database tables with aseco.sql? Were there any problems? (I did just notice that newinstall\localdb.xml file has the wrong db in it and doesn't match the one in aseco.sql)

I've never really gone over much of the code in terms of verifying the results of every sql call, but it does seem to work well as it's currently written. I'm not the original author of ASECO or RASP, I just took over the RASP development when the original author move on to other things (and have lent a hand in some of the ASECO code since then, but not a whole lot of changes).

SilentStorm
wheelbarrow operator
wheelbarrow operator
Posts: 19
Joined: 30 Sep 2008 18:37
Owned TM-games: TMUF

Re: ASECO 2.2.2 and stuff

Post by SilentStorm » 28 Aug 2009 18:17

Yeah, after digging through the files that were giving errors (I discovered a bunch more where SQL Queries where flawed) and digging through even more files related to them so I could get a vague picture, I found that it all came down to the tag in rasp.xml that wasnt supposed to be there at all. After removing it, it fixed all the Problems I saw earlier. Rasp couldnt load the configuration properly and thus some values where NULL.

Anyways one thing I noticed during my digging and that still stands is that in plugin.localdb.php you have:

Code: Select all

    $result = mysql_query('SET CHARSET utf8');
    $result = mysql_query('SET NAMES utf8');
at line 70/71. The Method of sending SET NAMES over mysql_query() is depracted. There is a PHP Function for that.

[EDIT]
Oh and while checking the Database I found that you where inconsistent with updating the Size of the Integers...
Im not going to list all of them as you can easily find out yourself whats not yet UNSIGNED INT but will just list the ones that could cause problems:
Id and ChallengeId in records.
ChallengeId in rs_karma
ChallengeId in votes
Since ChallengeId is INT(11) in challenges and it stores the same value as all the ones above it would lead to problems once there are that many tracks they dont fit into mediumINt(9). It may be unlikely but still if you going to change one you should change all.

And just out of curiosity why did you suddenly change some of the Capitals?

Post Reply