Server Help

ASSS Custom Projects - hs_util

Dr Brain - Wed May 21, 2008 10:50 am
Post subject: hs_util
I'm releasing the newest version of the Hyperspace utility modules. These modules don't depend on the hscore, and can be useful to most ASSS zones.

There are four independent (exception: see the note for kill) components to this library:


These modules are online in Hyperspace, but have not been rigorously tested. There may be a few bugs in them, so please post any problems you encounter. The selfpos module is missing some features advertised in the .h file (coalescing of bounty/status packets, and timestamp deltas), but if you need any of them let me know and I'll make completing them a top priority.

Building:
The included makefile should handle all the building for anyone using the regular ASSS make system. If you don't have bison and flex (needed to build some .c files from the formula grammar), put the parser.c, parser.h, lexer.c files from hs_util_noflexbison.zip into the hs_util/ directory, and the makefile won't try to build them.

If you're not using the ASSS make system, the only thing you need to worry about is passing -DUSE_AKD_LAG to the compiler if you're using HZ's akd_lag module. Otherwise, just add all the .c files you can find, and add hs_util to the include directories for your own modules.
D1st0rt - Thu May 22, 2008 8:48 pm
Post subject:
If you're not using the asss.asss.hs monotone branch, you'll need to apply (minimally) this patch
Initrd.gz - Tue Jul 28, 2009 6:53 pm
Post subject:
Hey, sorry for bump, but do you mind re-uploading that patch? Seems to redirect to asss 1.5.0, and that doesn't really help because my security.so module doesn't work with asss 1.5.0, and it doesn't come with one.
Dr Brain - Tue Jul 28, 2009 10:25 pm
Post subject:
I seem to recall the issue being a missing energy field in the player position structure. Unfortunately, that commit got combined with a bunch of other ones when the switch to mercurial was made, but here are the important bits:

Code: Show/Hide
diff -r 443387f9c075 -r 005e019b97c8 src/include/player.h
--- a/src/include/player.h   Fri Nov 09 04:16:56 2007 -0800
+++ b/src/include/player.h   Mon Apr 06 00:44:18 2009 -0700
@@ -155,6 +155,7 @@
   int rotation;    /**< rotation value (0-63) */
   unsigned bounty; /**< current bounty */
   unsigned status; /**< status bitfield */
+   int energy;      /**< current energy */
};

/* pyconst: define int, "STATUS_*" */


Code: Show/Hide

diff -r 443387f9c075 -r 005e019b97c8 src/core/game.c
--- a/src/core/game.c   Fri Nov 09 04:16:56 2007 -0800
+++ b/src/core/game.c   Mon Apr 06 00:44:18 2009 -0700
@@ -518,6 +518,7 @@
      p->position.rotation = pos->rotation;
      p->position.bounty = pos->bounty;
      p->position.status = pos->status;
+      p->position.energy = pos->energy;
   }

   if (p->flags.sent_ppk == 0 && !isfake)

Initrd.gz - Wed Jul 29, 2009 12:45 pm
Post subject:
Thanks. Mind also doing it for HSCore as well?

Also:
Code: Show/Hide
asss@*******:~/asss-1.4.4/src$ patch -p1 < patch1.diff
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -r 443387f9c075 -r 005e019b97c8 src/include/player.h
|--- a/src/include/player.h   Fri Nov 09 04:16:56 2007 -0800
|+++ b/src/include/player.h   Mon Apr 06 00:44:18 2009 -0700
--------------------------
File to patch:
Am I using the wrong command?
Dr Brain - Wed Jul 29, 2009 6:26 pm
Post subject:
It's probably easier to apply those patches manually, since they're one line each. Just search the files for the correct place to put in the line starting with the +. Probably near line 155 in player.h and 518 in game.c.

What did you mean about HSCore?
Initrd.gz - Thu Jul 30, 2009 1:48 pm
Post subject:
Quote:
To get spawner to compile, you'll need the modification to game.c/game.h in 5bbdeb509511dd9efbf5872ebf656bb3e0a7615b of the branch asss.asss.hs. Or if you don't want/need items to affect energy viewing, you can just comment out the offending sections in the spawner.


That part.
Dr Brain - Thu Jul 30, 2009 9:36 pm
Post subject:
http://bitbucket.org/grelminar/asss/changeset/541cf34f5c4e/
KrynetiX - Fri Dec 18, 2009 3:55 am
Post subject:
again, where's the delete post button? should be able to delete your own
Onuzim - Fri Apr 18, 2014 8:14 pm
Post subject:
I won't ask about Windows compiling. I've tried. On linux(Ubuntu 14.04), I arrive at an error when compiling hs_util lexer.

Code: Show/Hide

gcc -std=gnu99 -pipe -I. -Iinclude -I/home/anon/Desktop/asss-1.5.0rc1/build  -Ihscore -Ihs_util -D_REENTRANT -D_GNU_SOURCE -fPIC -g -Wall   -Wno-unused -c -o /home/anon/Desktop/asss-1.5.0rc1/build/lexer.o /home/anon/Desktop/asss-1.5.0rc1/build/lexer.c
In file included from hs_util/lexer.l:3:0:
/home/anon/Desktop/asss-1.5.0rc1/build/parser.h:89:14: error: unknown type name ?ParseObject?
int yyparse (ParseObject *parse_object, yyscan_t *scanner);
              ^
make: *** [/home/anon/Desktop/asss-1.5.0rc1/build/lexer.o] Error 1

Dr Brain - Sat Apr 19, 2014 2:03 pm
Post subject:
It's been years since I've done anything on that. Unfortunately I don't have any system setup where I can compile it, so I can't just send you the autogenerated files.

Anyway, I looked through the sources, and it looks like all you'll need to do is open up lexer.c and move the #include "ast.h" higher up in the file so it's above the #include "parser.h". You could also add #include "ast.h" into parser.h.

Once that's done you may want to make the files read-only so your changes don't get blasted away.

I wish I had a more permanent solution for you, but I've forgotten what little I ever knew about flex and bison.
Dr Brain - Sat Apr 19, 2014 2:04 pm
Post subject:
Onuzim wrote:
I won't ask about Windows compiling.


The only tricky part on windows is getting flex and bison installed. If you're not going to be doing any development, you could just take the output files from your ubuntu machine (after making the above changes) and compile them on windows.
CypherJF - Sun Apr 20, 2014 12:49 am
Post subject:
Dr Brain wrote:
[..]



The only tricky part on windows is getting flex and bison installed. If you're not going to be doing any development, you could just take the output files from your ubuntu machine (after making the above changes) and compile them on windows.


I've been trying to get asss to recompile on windows but haven't had any luck - even went back to the 1.4.4 release that I once compiled hs_money (?) with the funky "all HS fines to go to cypherjf" mod to it. No such luck. Let alone 1.5.x. Was there new dependencies added since then that would really cause that much of an issue with building on windows? Grel had the windeps flow pretty much going, I feared the day that you (et al) wouldn't be able to provide security.dll for new releases. :/
Dr Brain - Sun Apr 20, 2014 7:22 am
Post subject:
This thread is about hs_util. If you're having problems with asss make a new thread and we can try to work through them. I'll be gone most of this week though.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group