Server Help

ASSS Custom Projects - Okay, what did I do wrong??

AlphaBoB - Mon Sep 01, 2003 6:58 pm
Post subject: Okay, what did I do wrong??
As an ASSS module:
Attached file


Compile line:
Code: Show/Hide
$ gcc beans.c -o beans.so -D_REENTRANT -D_GNU_SOURCE -fPIC
beans.c: In function `main':
beans.c:48: warning: return type of `main' is not `int'
$




ASSS error:
Quote:
...
I <cmod> loading C module 'directory' from 'external'
I <directory> server on port 58888 using name 'SSZ Beans'
I <directory> using 'sscentral.subspace.inet.fi' at 62.65.37.101 as a directory server
I <directory> using 'sscentral.subspacehq.com' at 199.232.158.5 as a directory server
Unrecoverable error (5): Error in loading module 'beans:MM_beansbot'
I <directory> using 'sscentral.subspace.net' at 216.37.52.235 as a directory server

Smong - Tue Sep 02, 2003 2:55 pm
Post subject:
You probably need a prototype for main()
Code: Show/Hide
void main(void);

Although I would just get rid of that function.
Also I would compile with "-shared" (although I don't know what it means, lol).

Edit: and put "local" infront of all functions except the MM_func()
Grelminar - Tue Sep 02, 2003 7:43 pm
Post subject:
Um, how about you get rid of main entirely? You're not building an executable, you're building a shared library.

Yes, you do need "-shared" to build a shared library. It might make more sense to you if you compile into a .o file and then link that into a .so.
AlphaBoB - Wed Sep 03, 2003 4:53 pm
Post subject:
Grelminar, how would I compile to a .o and then link? I'm used to MS VC++ doing it for me and I don't know all the GCC commands. --help doesn't give them all, such as -shared isn't listed and some others.

Edit: and I had the main() function because GCC gave an error, guess I need to do -shared for it to shut up : icon_biggrin.gif

Edit (x2): What should my whole GCC command line be?
AlphaBoB - Wed Sep 03, 2003 5:04 pm
Post subject:
Ahhh okay I got it compiled and loaded correctly. Now how do you make it so if someone types a command it calls a function, and doesn't show it on the chat to everyone else?

Edit: according to help.c I'm guessing that defining a function as C<cmdname> and calling AddCommand() is the way to do it.
Smong - Wed Sep 03, 2003 5:51 pm
Post subject:
You can use chat->SendMessage() to make the response appear as an arena message, but only for a specific player.
Don't forget to add your new commands to the capabilities.
AlphaBoB - Wed Sep 03, 2003 6:55 pm
Post subject:
Smong wrote:
Don't forget to add your new commands to the capabilities.


Yes, I was just gonna ask if I was supposed to do that. icon_biggrin.gif
AlphaBoB - Wed Sep 03, 2003 9:34 pm
Post subject:
Okay now, if anyone would like to test out my two hours of writing for the "?zoneinfo" command you can come on in to SSZ Beans and try it out sa_tongue.gif I also made it play %104 (goal sound) when you make a goal. Dunno why it wasn't already; it wasn't even saying "Team Goal!" or "Enemy Goal!" Is there a module I need to load?
AlphaBoB - Thu Sep 04, 2003 5:08 pm
Post subject:
Dunno if any of these people tried out my command but I noticed that CypherJF (who is on this board) logged in, so he may have.

from the ?last command wrote:

Beans (v6) 6 seconds ago
Mr.Twit 1 hour ago
Mr.Twit 2 hours ago
Ez8 6 hours ago
www.goatse.cx/ 11 hours ago
SK8 BRD Element 18 hours ago
SteelShadow 2 days ago
CypherJF 2 days ago
HypnoticKirby 2 days ago
Evangalion 2 days ago


Edit: btw thanks whoever edited the code and made it an attachment, it looks much better now icon_smile.gif
EDIT: That was me. Once you have to scroll too much to see data, I usually suggest making it an attachment. -MGB

Edit again: I've added a ?zone\*zone command. I hope Grel will add all these basic commands to the latest version of ASSS.
Smong - Thu Sep 04, 2003 5:24 pm
Post subject:
I went in and tried it out (Mr.Twit), although you could just use the F1 help.
AlphaBoB - Fri Sep 05, 2003 11:05 pm
Post subject:
Yeah, okay, so it's a bad idea, but I was just practicing ASSS module-making.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group