Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Objects

 
Post new topic   Reply to topic Printable version
 View previous topic  Ball and shipchange Post :: Post It would be great to...  View next topic  
Author Message
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Fri Jul 08, 2005 10:50 pm    Post subject: Objects Reply to topic Reply with quote

it seems when you take the asss 1.4.0 for windows. Insmod object and do an *objon it crashes the server. When I recompiled objects in it's own module, taking the code exactly from objects.c and objects.h and used that module, it worked fine without crashing.

Also there are a lot of header files out of place (for example the packets directory needs to be in the include directory).

When objects is set up to load in modules.conf and you do objinfo all works well. then you rmmod objects and insmod objects and do objinfo again and it says the lvz object the that object id can not be found. Also objinfo assumes there's only one object per object id which is not necessarily the case, as objects can share ids.
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Fri Jul 08, 2005 11:49 pm    Post subject: Reply to topic Reply with quote

I can't get makefiles to work yet, sent grel a ?message about it.

When I used ($eval ($call dltemplate, library)) gcc said there was no input file
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sat Jul 09, 2005 12:32 am    Post subject: Reply to topic Reply with quote

Found another bug in the standard distibution of the ojbects module. In sendstate you currently have:

Code: Show/Hide

if (t >= ad->tog_diffs || e >= ad->ext_diffs)
    break;


but you really want to change that or to an and (&&). The reason for this is that you don't want to stop sending that state until both all the objects that have been modified and all the objects that have been toggled are accounted for, not one or the other. The way it is now if you have no modified objects, it won't send any (since e >= ad->ext_diffs, 0 >= 0). This gives the appearance of the state saving lvz not working, when you put all the effort into making it work. It works fine after this change.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Sat Jul 09, 2005 3:56 am    Post subject: Reply to topic Reply with quote

In general, I'm not surprised ?insmod objects behaves funny. Some modules aren't written to be loaded while arenas are running. If you could improve objects so it worked correctly in those cases, I'd be happy to accept it.

I can't comment much about the code, since I didn't write it, and don't really know anything about objects. Your fix (|| -> &&) makes sense to me, though, and I fixed it in my working copy.

I really have no idea the built version of objects crashed but yours worked. Did you do the exact same sequence of steps with both? Is the crash reproducable? Did you get a backtrace? What compiler/linker did you build yours with?

I wouldn't call the packets directory "out of place". I left it where it is on purpose. You might argue that it makes more sense somewhere else, but I don't see a compelling reason to move it.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sat Jul 09, 2005 5:09 am    Post subject: Reply to topic Reply with quote

I did the exact sequence of steps and yes, the crash is reporducable (insmod, objon). The backtrace Just In Time Debugging gave me was assembly, as the the .exe wasn't compiled with VS.net in debug mode so this was as expected. I use VS.NET 2002 to compile and link my code. My theory is that pthreadVC.dll isn't by default in the same directory as asss.bat, and is required for the objects module to work.

The only reason I complain about the location of the directories isn't that I disagree with your organization (I like the recent changes you've done), but that in a file like ball.c you have

Quote:
#include "packets/balls.h"


so being a good compiler VS.NET looks for the packets folder realitive to the balls.c file which doesn't exist. So I have to go through by hand and change it to

Quote:
#include "../packets/balls.h"


Now this kind of thing is in most .h and .c files so it gets little repetitive.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jul 09, 2005 11:08 am    Post subject: Reply to topic Reply with quote

You shouldn't have to do that. You should tell VS the location of the base include directory.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Sat Jul 09, 2005 4:35 pm    Post subject: Reply to topic Reply with quote

Uh, "asss.h" and "persist.h" aren't in the same directory as balls.c either, but it can find those, right? If you look at the Makefile, you can see that among the flags passed to the compiler are "-I. -Iinclude -I$(BUILDDIR)". The dot refers to the "src" directory itself, which makes paths like "packets/balls.h" work. Just set up your compiler with the equivalent options, and everything should be file.

If it couldn't find the pthreadVC.dll file, it would give you an error when loading the module, not a crash.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Aug 02, 2005 1:07 pm    Post subject: Reply to topic Reply with quote

Alright, well that works, although I have to set it for every module I make now (one project per module).

Anyways here's another bug. The Move function crashes the server if your target isn't T_ARENA. Now the bug isn't the lack of functionality for T_PLAYER targets, just if you do give it a T_PLAYER target, it crashes. This wouldn't be a big deal if modules were the only things using the Move function (just don't code per player objmoves), but the *objmove command calls the Move function, and doesn't do any checking of the target, which could possibly be a player.

The move function does check for T_ARENA before it sends the packet, but not when it gets the per arena data based on t.arena, which is a crash if it's a player pointer .

Quote:
aodata *ad = P_ARENA_DATA(t->u.arena, aokey);


Here's one possible fix:

Code: Show/Hide

void Move(const Target *t, int id, int x, int y, int rx, int ry)
{
   if (t.type != T_ARENA)
   {
      lm->Log(L_INFO,"<objects> objmove for non-T_ARENA target not currently supported.");
   }
   else
   {
      BEGIN_EXTENDED(t, id);

      *(u8*)objm = 0;
      objm->change_xy = 1;

      if ((objm->data.mapobj = node->defaults.mapobj))
      {
         objm->data.map_x = x;
         objm->data.map_y = y;
      }
      else
      {
         objm->data.scrn_x = x;
         objm->data.scrn_y = y;
         objm->data.rela_x = rx;
         objm->data.rela_y = ry;
      }

      END_EXTENDED(t, id);
   }
}
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 45 page(s) served in previous 5 minutes.

phpBB Created this page in 0.723866 seconds : 30 queries executed (96.7%): GZIP compression disabled