Server Help

ASSS Questions - More Misc ASSS Questions

Cheese - Wed Mar 31, 2010 1:46 pm
Post subject: More Misc ASSS Questions
For when I can't post in the other one.


so im trying to compile something that is using
strcasestr() and mkstemp()
but it was throwing linker undefined reference errors,
even though i had the wincompat header included, as well as the stdlib one.

i was able to bypass the strcasestr by copying the entire function over, but wasnt able to with the mkstemp because
_O_CREAT | _O_RDWR | _O_BINARY | _O_EXCL, _S_IREAD | _S_IWRITE
wasnt defined either despite the stdio header.

my guess is that i need to have some sort of -l linker option thingy to get this to work, but i have no idea which
Dr Brain - Wed Mar 31, 2010 4:04 pm
Post subject:
Attach the errors.
Cheese - Wed Mar 31, 2010 6:38 pm
Post subject:
i figured it out eventually through clever use of a series of tubes.


these were needed
#include <sys/stat.h>
#include <fcntl.h>

this was not
//#include <io.h>

Quote:
i was able to bypass the strcasestr by copying the entire function over


doing this for both and including the 2 headers worked.
my module compiled successfully, with only 2 hacks :D
Cheese - Wed Apr 07, 2010 2:04 am
Post subject:
simple question:

how do i add my settings to the ?quickfix list?


same question:

how does cfghelp work?
how does it find the values?
does it read the /* comments */?
why do you reference the handle pointer?
icon_eek.gif
Dr Brain - Wed Apr 07, 2010 7:26 am
Post subject:
Cheese wrote:
simple question:

how do i add my settings to the ?quickfix list?


Use cfghelp like all the other modules do.

Cheese wrote:
how does cfghelp work?


Reasonably well.

Cheese wrote:
how does it find the values?


Eh?

Cheese wrote:
does it read the /* comments */?


Yes.

Cheese wrote:
why do you reference the handle pointer?


Eh?
Cheese - Wed Apr 07, 2010 9:21 am
Post subject:
#1:
do i need to get the handle?
no, right?

#2
do i need to recompile the module after adding the comments?
or does it read the source
Dr Brain - Wed Apr 07, 2010 9:55 am
Post subject:
#1

I don't know what you mean by handle. There are many handles in the asss core, but none of them make sense in the context of your question.

#2

Which module? cfghelp? Yes. Your module with the comments? No.
Cheese - Wed Apr 07, 2010 1:05 pm
Post subject:
Quote:
why do you reference the handle pointer?


from quickfix.c:
sh = &cfghelp->sections[i];

Quote:
I don't know what you mean by handle


this one
cfghelp = mm->GetInterface(I_CFGHELP, ALLARENAS);



how does quickfix get the helptext?
step by step process, please (also step by step to add just one entry)



edit:
nvm, &cfghelp->sections[i] doesnt mean &(cfghelp)->sections[i], it means &(cfghelp->sections[i]) -_-"
Dr Brain - Wed Apr 07, 2010 3:37 pm
Post subject:
Those are called interface pointers.

I have no idea about the nitty gritty details on quickfix. I've never bothered to look. I know help.c uses the same cfghelp interface to give ?help/?man information.

Here's the process to add an entry to cfghelp:
1.) Add a cfghelp comment to your source code. There are hundreds of examples in the asss source. Ask if you have specific questions about the formatting.
2.) make clean && make (technically you only need to rebuild cfghelp.inc and its dependents, but this gets it done).
3.) enjoy.
Cheese - Wed Apr 07, 2010 3:56 pm
Post subject:
cfghelp.inc isnt in the src
what am i making, does this mean rebuild the core?
could i compile just the cfghelp module instead?

and if i found this in a makefile
$(call tobuild, cfghelp.inc): $(builddir) $(SCRIPTS)/extract-cfg-docs.py
what does that mean to a zone not running python on a machine with no python?



isnt there a better way to do this?
couldnt there just be commands to permanently save an entry to a file like 'data/server.set' through ?addentry and ?removeentry or something?

only downside to this is the final server guy (you) has to pick what they want and manually add them into the final core...
Dr Brain - Wed Apr 07, 2010 4:42 pm
Post subject:
cfghelp.inc is in ../build

Rebuilding cfghelp isn't enough. You need to make sure that cfghelp.inc gets rebuilt.

Python is only used during the compilation. You don't need python on the server to use cfghelp.

Nothing like that exists at the moment.
Cheese - Wed Apr 07, 2010 5:53 pm
Post subject:
i dont have a /build either :S


this seems important enough enough to revise, and i think what i have thought might be a good enough system (or so i think)



afterthought:

Quote:
only downside to this is the final server guy (you) has to pick what they want and manually add them into the final core


easily done by simply copying the file into the new build...

new downside:
someone has to be first to build the initial file


edit:
perhaps you can even have more than one .set file, and you can release a .set file with your module, allowing easy cfghelp access, with no commands needed.......
Dr Brain - Wed Apr 07, 2010 5:57 pm
Post subject:
I don't think you should be passing judgment on a system you've never even used.
Cheese - Wed Apr 07, 2010 5:58 pm
Post subject:
if its too difficult for a simpleton such as myself to use, it probably needs fixing :D


edit:

especially when it requires rebuilding a critical part of the core to update

edit 2:

and its best to redo it while its only used by quickfix and man, before it becomes more entrenched
Hakaku - Wed Apr 07, 2010 6:44 pm
Post subject:
The issue was raised countless times before, I don't think you really have the right to tell people what they can and can't judge, Dr Brain. If ASSS is truly designed to be modular, then forcing someone to recompile the entire core for every such addition is unacceptable.
Samapico - Wed Apr 07, 2010 7:15 pm
Post subject:
&(cfghelp)->sections[i]
would be the same as:
cfghelp.sections[i]
Dr Brain - Wed Apr 07, 2010 11:09 pm
Post subject:
Oh, I agree that cfghelp needs to support dynamic entries, Hakaku. I think there's even a bug filed for it. I don't agree that cheese's suggestions on the matter can be helpful before he's used the existing system.
Arnk Kilo Dylie - Thu Apr 08, 2010 1:38 pm
Post subject:
Hakaku wrote:
If ASSS is truly designed to be modular, then forcing someone to recompile the entire core for every such addition is unacceptable.

Dead wrong. You only have to rerun extract-cfg-docs.py and rebuild cfghelp--one module. It just so happens the fastest way to do that is to run make. Furthermore, this is perfectly acceptable--I don't see how dynamic cfghelp would be any real help at all. The names of your settings do not change even weekly. If you have new settings that you absolutely want to see in ?quickfix (you're a weirdo for using this), then they can go in at the exact same time as everything else.

It seems to me some people have chosen some poor platforms and/or IDEs and/or combinations for asss in this thread and are now placing blame on Brain for their problems using something that isn't supported. (This I have surmised from the implication that rebuilding the core is not simple/fast/easy, no build/ folder, etc.) Not to mention the mind-boggling resistance to installing python...
Cheese - Thu Apr 08, 2010 6:17 pm
Post subject:
Arnk Kilo Dylie wrote:
[..]

Furthermore, this is perfectly acceptable.


Dead wrong.
Having to recompile to add something new or every time you add a new module is unacceptable.
tcsoccerman - Thu Apr 08, 2010 6:26 pm
Post subject:
You don't have to. Just use ASSS the right way.
Hakaku - Thu Apr 08, 2010 7:18 pm
Post subject:
Arnk Kilo Dylie wrote:
Dead wrong. You only have to rerun extract-cfg-docs.py and rebuild cfghelp--one module. It just so happens the fastest way to do that is to run make. Furthermore, this is perfectly acceptable--I don't see how dynamic cfghelp would be any real help at all. The names of your settings do not change even weekly. If you have new settings that you absolutely want to see in ?quickfix (you're a weirdo for using this), then they can go in at the exact same time as everything else.

It seems to me some people have chosen some poor platforms and/or IDEs and/or combinations for asss in this thread and are now placing blame on Brain for their problems using something that isn't supported. (This I have surmised from the implication that rebuilding the core is not simple/fast/easy, no build/ folder, etc.) Not to mention the mind-boggling resistance to installing python...

No one here ever placed any "blame" on Dr Brain. Please don't confuse comments that question the functionality of the server with personal attacks.

Moreover, this has nothing to do with inadequate integrated development environments or the lack of python. If that's really the only excuse you can come up with, then it's a poor one at best. While you may not have the need to use a certain aspect of the server very much, others do. In its current state, I find it highly inconvenient to have to build the entire core simply to make one such change. To add, it's not obvious how to run 'extract-cfg-docs.py' - the file provides no information on how to use it. Press the wrong button and you'll lock up your system. Although I don't always agree with L.C., rendering things more accessible to more people is an objective we should always take at heart.

Also, this wasn't by far my only reason for wanting to have it changed. However, you seem to have already placed a bias before trying to understand why the issue was ever raised. Therefore, it's useless to continue.
Arnk Kilo Dylie - Thu Apr 08, 2010 8:19 pm
Post subject:
Cheese wrote:

Having to recompile to add something new or every time you add a new module is unacceptable.

Well I was going to give you style points for quoting part of what I said and then taking it out of context, but what you said is a contradiction. By that logic, adding new modules is unacceptable because you have to compile something.



Hak: Like I was saying with my post, if you find it inconvenient to build the core when compiling something else, then you are doing it wrong. That's really all I am saying. You don't have to run extract-cfg-docs manually, there is already a tool that does that effectively. Don't throw out messed up comments like implying you have to rebuild the entire core for one module, that was just silly and pretty frustrating to read.

I am not against doing anything to improve usability, but when people for no real reason refuse to use the already very easy options available to them--that is when it becomes pointless to continue (not the mention the spreading of outright falsehoods...) Anyway, if you don't want to have your comments come off as personal, maybe you should reconsider your last two sentences there.
Dr Brain - Thu Apr 08, 2010 8:20 pm
Post subject:
http://bitbucket.org/grelminar/asss/issue/23/dynamic-cfghelp

You'll notice my comments in that bug thread are reminiscent of cheese's comments, and I was wrong for the same reasons he was. I think in this case, I'm very qualified to judge.

Cfghelp is not seen as a major flaw at this point in time. It's not necessary to recompile the entire core to get the target module working. The cfghelp itself is only of secondary importance, as any new module is likely to have the defaults set appropriately. And cheese's experience not withstanding, it's easy to use.

On the other hand, there are flaws with it that haven't been discussed in this thread. Not having access to the source, for example. There have been some proposed changes to the way the asss core builds, and those changes would allow easier integration of a dynamic system. It's not realistic to do it without a build system overhaul.
Cheese - Thu Apr 08, 2010 8:47 pm
Post subject:
why is this considered better than copying the .set file over from the module folder you just downloaded into your /set directory, then typing ?quickfix :S


edit:
and for now, we dont even have to worry about modules being loaded
Hakaku - Thu Apr 08, 2010 9:04 pm
Post subject:
Quote:
Don't throw out messed up comments like implying you have to rebuild the entire core for one module, that was just silly and pretty frustrating to read.

If you can build a module out of cfghelp without ever once rebuilding the core, I would be interested in knowing how you managed to accomplish it. Otherwise, my comment stands.

Oh, and no where have I implied that I "refuse" to use what is currently available - I already do. I've merely stated that the current way is inconvenient and could be expanded and improved to address other needs.
Dr Brain - Fri Apr 09, 2010 7:41 am
Post subject:
Cheese wrote:
why is this considered better than copying the .set file over from the module folder you just downloaded into your /set directory, then typing ?quickfix :S


Replacing an automatic system with a manual one is never a good idea. Period.
Cheese - Fri Apr 09, 2010 10:54 am
Post subject:
but what are you going to do when they give you a closed source module? :\
Dr Brain - Fri Apr 09, 2010 12:13 pm
Post subject:
Have them give you a file with the cfghelps in it that can be parsed as part of the building process (or make one yourself). They already have to give you a list of the settings, after all.

Or, my personal favorite: don't worry about the help text at all. Maybe you don't realize it, but you can still set the config settings without the help text.
Arnk Kilo Dylie - Fri Apr 09, 2010 1:19 pm
Post subject:
Cheese wrote:
but what are you going to do when they give you a closed source module? :\

Tell them that's unacceptable and to give over the source. If someone wanted their crap running on my machine, then I must have an absolute guarantee it does not have something I do not want, furthermore I must be able to modify it should they choose to abandon it. Not to mention that if I modify any interfaces at all I'll need to recompile the module against them. Not to mention if their module crashes I would like to know why specifically. It's a security issue and a common sense issue. If you disagree, maybe you'd be interested in some "closed source" modules of mine...if you plan to run any zones on SSC it practically should be mandatory to have full control of whatever you run on your server, far too easy to set up a module that records stuff (hint: passwords) and sends it back to the controller without any notice or bother...and that's just the tip of the iceberg


Hak: I don't believe you. If you find make, something that takes care of everything with 1-2 commands, inconvenient, I think I understand the disconnect here.

Code: Show/Hide

akd@decastar-2:~/code/zone-hzasss/src> rm ../build/cfghelp.* && make
python ../scripts/extract-cfg-docs.py -c ../build/cfghelp.inc */*.c */*.py core/clientset.def
gcc -std=gnu99 -pipe -I. -Iinclude -I../build  -Iakd -Ihockey -Ihz -Imisc -D_REENTRANT -D_GNU_SOURCE -fPIC -g -Wall   -c -o ../build/cfghelp.o core/cfghelp.c
.
.

If you're interested in not tying cfghelp to the asss binary itself (which is understandable, this gives you the power to hotswap it) take the cfghelp stuff out of core.mk and make a file as such for cfg.so/cfg.dll:
Code: Show/Hide

cfg_mods = cfghelp

$(call tobuild, cfghelp.inc): $(builddir) $(SCRIPTS)/extract-cfg-docs.py
        $(PYTHON) $(SCRIPTS)/extract-cfg-docs.py -c $@ */*.c */*.py core/clientset.def

$(eval $(call dl_template,cfg))


(some typos may apply but you get the idea..)
Dr Brain - Fri Apr 09, 2010 2:24 pm
Post subject:
No need for the extract-cfg-docs.py part in that .mk. The one in core will take care of that.
Arnk Kilo Dylie - Sat Apr 10, 2010 4:06 am
Post subject:
Yes, that's one way, but when I said "take the cfghelp stuff out of core.mk) I meant that stuff too, just for completeness sake.
Cheese - Sat Apr 17, 2010 3:15 am
Post subject:
Dr Brain wrote:
[..]
Replacing an automatic system with a manual one is never a good idea. Period.


good thing we are replacing the current manual system with a better and easier manual system then, right?

because recompilation is hardly automatic, in fact its the worst kind of manual.
Dr Brain - Sat Apr 17, 2010 10:23 am
Post subject:
I'm sorry, the rest of us have to compile our modules as part of making them. I'm not sure how you're doing it, exactly.
JoWie - Sat Apr 17, 2010 6:08 pm
Post subject:
Probably one off modules in windows
Cheese - Sat Apr 17, 2010 11:41 pm
Post subject:
Dr Brain wrote:
I'm sorry, the rest of us have to compile our modules as part of making them. I'm not sure how you're doing it, exactly.


yes, but why also compile modules to USE them?
Cheese - Mon Apr 19, 2010 6:49 pm
Post subject:
recently, i connected my zone to a biller.

this was more difficult than it should have been, because both billing:groupid and billing:scoreid are both 0 by default for some reason, which causes the 'invalid login attempt' in subbill.

now that everything is working, i have not yet figured out why my zone isnt sending commands to the biller...
is there something simple im overlooking? :S


PS:
i even tried the ?/hi and ?\hi stuff too

PPS:
?userid is coming back empty too :S
Dr Brain - Mon Apr 19, 2010 9:15 pm
Post subject:
Subbill is known not to work with billing_ssc. Get a better biller and try again.
Cheese - Mon Apr 19, 2010 9:49 pm
Post subject:
so being a non-linux user, i have to choose between a biller that eats 100% cpu and a biller which you say is unsupported?


what would you suggest i do?
Dr Brain - Tue Apr 20, 2010 7:33 am
Post subject:
ASSS saves its own scores, and can authenticate just as well as subbill. Why use a biller at all?
L.C. - Tue Apr 20, 2010 8:15 am
Post subject:
Quote:
this was more difficult than it should have been, because both billing:groupid and billing:scoreid are both 0 by default for some reason, which causes the 'invalid login attempt' in subbill.
That is because the main configuration file for ASSS is very much incomplete in that it totally leaves out basics (such as ScoreID, ServerID, NamePassword, etcetera), regardless of whether or not ASSS is running in standalone mode. It would be more acceptable if the idea of billers went extinct entirely.
Cheese - Mon May 03, 2010 11:01 pm
Post subject:
delete this post
Cheese - Wed May 05, 2010 4:22 pm
Post subject:
what are the key (next to portal) and missile (next to rocket) icons in the icon.bm2 file?
never seen them used, anyone know anything about them?
L.C. - Wed May 05, 2010 6:39 pm
Post subject:
The key was supposedly to be able to open doors, I think.
The rocket, well, is obviously a missile that goes in one direction (probably would have had homing capabilities to some extent).

VIE never finished it.
Cheese - Wed Jan 19, 2011 1:24 am
Post subject:
i see a redirect.c in my source code directory, yet when i ?insmod redirect it fails.
where is it?

this one seems to be super-secret, because its not just unlisted, but also undocumented and not loaded or accessible in any fashion, and you have to use a different undocumented command to even activate it...
icon_eek.gif


also, there was some command that listed the basename of an arena, which was it?


and what is clientset.def for?
it looks like its supposed to be compiled with something else, what?
will changing it affect anything?


if i have
const struct section_help *sh=&cfghelp->sections[i];
const struct key_help *kh = &sh->keys[j];
where sh and kh is good
what would cause kh->name to be a null pointer, and what would cause sh->name to always be a pointer to the address 1337?


and cfghelp.c does #include "cfghelp.inc", where is it?
Dr Brain - Wed Jan 19, 2011 7:13 am
Post subject:
Why do you need two threads to post in?

cfghelp.inc is made in build. See the build script for answers to your other cfghelp questions.
Arnk Kilo Dylie - Wed Jan 19, 2011 12:04 pm
Post subject:
Pretty sure redirect was added to core.mk a dozen revisions ago, get latest source. Just because it's in the src directory doesn't mean anything does anything with it. Redirect was broken when 1.4.4 was released so it was not compiled by default. Now it's fixed.
Cheese - Wed Jan 19, 2011 12:54 pm
Post subject:
what about on ASSS 1.5.0rc2 built on Nov 25 2009 15:25:36?

and im not seeing redirect in /core/core.mk
so probably not?
JoWie - Wed Jan 19, 2011 3:03 pm
Post subject:
If you grab the latest trunk version from bitbucket it is there. Have fun compiling if you are still using asss on windows.
https://bitbucket.org/grelminar/asss/src/bbc0c08f56a9/src/core/core.mk
Arnk Kilo Dylie - Wed Jan 19, 2011 6:38 pm
Post subject:
Jowie said what I already said just in more words.
But regardless...it's not hard to just add it to core.mk yourself.
Practically speaking, the only version of asss supported right now is the latest default branch revision.

P.S. https://bitbucket.org/grelminar/asss/changeset/94982d160ccc - done a year ago and merged into main branch almost a year ago. Has that Windows test version been out that long already? heh..
Cheese - Thu Jan 20, 2011 1:59 am
Post subject:
something i would like more than anything is a win32 binary with full symbols

or at least just the functions



PS: i cant build anything
JoWie - Thu Jan 20, 2011 6:45 am
Post subject:
Cheese wrote:
something i would like more than anything is a win32 binary with full symbols

or at least just the functions

PS: i cant build anything


http://www.virtualbox.org/wiki/Downloads
http://www.xubuntu.org/getubuntu
make sure to install the guest additions

In windows open a command prompt and type (do this while the VM is shut down):
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS/Protocol" TCP
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS/GuestPort" 5000
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS/HostPort" 5000
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP/Protocol" UDP
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP/GuestPort" 5000
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP/HostPort" 5000

VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS2/Protocol" TCP
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS2/GuestPort" 5001
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSS2/HostPort" 5001
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP2/Protocol" UDP
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP2/GuestPort" 5001
VBoxManage setextradata "xubuntu" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ASSSUDP2/HostPort" 5001




In xubuntu open a terminal and type:
$ sudo apt-get install build-essential python python-dev mercurial libdb4.8-dev mysql-client libmysqlclient-dev gdb

$ hg clone https://bitbucket.org/grelminar/asss ~/asss-trunk
Place the following code in ~/asss-trunk/src/system.mk
Code: Show/Hide

debug := yes
opt := no
prof := no
link_db_statically := no
symlink_bins := yes
have_bdb := yes
have_mysql := yes
have_python := yes

ASSSHOME = ..
BINDIR = $(ASSSHOME)/bin
BUILDDIR = $(ASSSHOME)/build
SCRIPTS = $(ASSSHOME)/scripts
PYMOD_HEADERS = $(wildcard */*.h)
INSTALL := install
LN := ln
PYTHON := python
REALPATH := readlink -f

DB_HOME = /usr
DB_INC = $(DB_HOME)/include
DB_LIB = $(DB_HOME)/lib
DB_CFLAGS = -I$(DB_INC)
ifneq ($(link_db_statically),yes)
DB_LDFLAGS = -L$(DB_LIB) -Wl,-rpath,$(DB_LIB) -ldb-4
else
DB_LDFLAGS = $(DB_LIB)/libdb.a
endif

MYSQL_HOME = /usr
MYSQL_INC = /usr/include/mysql
MYSQL_LIB = /usr/lib/mysql
MYSQL_CFLAGS = -I$(MYSQL_INC)
MYSQL_LDFLAGS = -L$(MYSQL_LIB) -Wl,-rpath,$(MYSQL_LIB) -lmysqlclient_r

PYTHON_HOME = /usr
PYTHON_VERSION = 2.6
PYTHON_INC = $(PYTHON_HOME)/include/python$(PYTHON_VERSION)
PYTHON_LIB = $(PYTHON_HOME)/lib/python$(PYTHON_VERSION)
PYTHON_CFLAGS = -I$(PYTHON_INC)
PYTHON_LDFLAGS = -L$(PYTHON_LIB)/config -lpython$(PYTHON_VERSION) $(UTIL_LIB) -lm


$ cd ~/asss-trunk/src
$ make deps && make
Grab security.so from that 1.5 thread here and place it in ~/asss-trunk/bin
$ cp -R ~/asss-trunk/dist ~/zone
$ ln -s ~/asss-trunk/bin ~/zone/bin
$ cd ~/zone

Modify your configuration files, to run type:
$ bin/asss

Always run using bin/asss never "asss", this is needed to have the correct working directory.
Cheese - Thu Jan 20, 2011 8:35 am
Post subject:
no, im not installing *nix or a vm either
JoWie - Thu Jan 20, 2011 8:44 am
Post subject:
Then ask someone else to help debugging next time.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group