Server Help

ASSS Questions - Misc ASSS Questions

Cheese - Sun Feb 01, 2009 2:31 pm
Post subject: Misc ASSS Questions
ive been messing around with EVERYTHING in as3, and its raising a lot of questions, so i thought id make a topic where i can throw them in without a central topic.


such as:


with this code:
Code: Show/Hide

local void Damaged(Arena *a, Player *p, struct S2CWatchDamage *damage, int count)
{
    chat->SendMessage(p,"You took %i damage. c=%i",damage->damage->damage,count);
    chat->SendArenaMessage(ALLARENAS,"someone took dmg");
   
    return;
}

and this call:
Code: Show/Hide

mm->RegCallback(CB_PLAYERDAMAGE,Damaged,ALLARENAS);


why does nothing happen with a successful compile?

why does it seem that arena->playing and arena->total give the same number, even while 2 are in ships and 1 in spec?

why is there an arena passed to the export function, when it seems that any attempt to get information from the struct fails, or even worse, crashes the server on load?

is it possible to get an as3 server to listen on an external chat and respond to words/commands?

why do as3 zones prevent you from firing for a moment after you get the ball passed to you?

where are my periodic rewards?

is it possible to create a non eLVL region?

why is http://asss.yi.org/ down 95% of the time?

how can i detect a ball or flag win?

why does as3 have ?flagreset and not ?ballreset?

i suppose other people can ask questions here too...
Dr Brain - Sun Feb 01, 2009 9:52 pm
Post subject: Re: Misc ASSS Questions
Cheese wrote:

with this code:
Code: Show/Hide

local void Damaged(Arena *a, Player *p, struct S2CWatchDamage *damage, int count)
{
    chat->SendMessage(p,"You took %i damage. c=%i",damage->damage->damage,count);
    chat->SendArenaMessage(ALLARENAS,"someone took dmg");
   
    return;
}

and this call:
Code: Show/Hide

mm->RegCallback(CB_PLAYERDAMAGE,Damaged,ALLARENAS);


why does nothing happen with a successful compile?


Because no damage watching is enabled. Try /?watchdamage'ing a few players. Be aware that watchdamage uses a lot of bandwidth.

Cheese wrote:
why does it seem that arena->playing and arena->total give the same number, even while 2 are in ships and 1 in spec?

Because playing doesn't mean what one might think. If I recall correctly, playing in this context means game clients capable of entering the game. I think chatnet clients and fake players don't count toward that number.

Cheese wrote:
why is there an arena passed to the export function, when it seems that any attempt to get information from the struct fails, or even worse, crashes the server on load?

Which export function are you talking about?

Cheese wrote:
is it possible to get an as3 server to listen on an external chat and respond to words/commands?

Anything is possible. In this case, you'd have to write a module.

Cheese wrote:
where are my periodic rewards?

In the periodic points module.

Cheese wrote:
is it possible to create a non eLVL region?

Is it possible to create a non-beef hamburger? Not while still remaining edible.

Cheese wrote:
why is http://asss.yi.org/ down 95% of the time?


Probably because it's hosted on grel's computer (I'm assuming from the yi.org part).

Cheese wrote:
how can i detect a ball or flag win?


Callbacks.

Cheese wrote:
why does as3 have ?flagreset and not ?ballreset?


Because no one bothered to write one.
Samapico - Sun Feb 01, 2009 11:39 pm
Post subject:
Quote:
Cheese wrote:
is it possible to create a non eLVL region?

Quote:
Is it possible to create a non-beef hamburger? Not while still remaining edible.

LOL


Yeah... you "could" make a pseudo-region like oldschool Mervbot plugins... works well for rectangular areas, but other than that, it's a pain in the butt. A useless one too; why would you want/need to avoid using eLVL? If you use DCME, creating a region is easier than putting tiles on a map.
tcsoccerman - Mon Feb 02, 2009 3:48 pm
Post subject:
Quote:
Quote:
Cheese wrote:
is it possible to create a non eLVL region?

Quote:
Is it possible to create a non-beef hamburger? Not while still remaining edible.

LOL



btw, thank you for adding the bolded part.
Cheese - Mon Feb 02, 2009 4:28 pm
Post subject:
Dr Brain wrote:

Which export function are you talking about?


Code: Show/Hide

//what does this do?
EXPORT const char info_hs_fuschia[] = "v1.0 Dr Brain <drbrain@gmail.com>";

//why is *arena there?
EXPORT int MM_hs_fuschia(int action, Imodman *_mm, Arena *arena)

^export functions
***edit: also, why am i getting linker undefined reference errors to LLInit+LLAdd+LLEmpty?

Dr Brain wrote:

Callbacks.


which, i cant seem to find them...

Dr Brain wrote:

Because no damage watching is enabled.


Cheese> ?man watchdamage
Sorry, I don't know anything about ?watchdamage

how might i remedy this? didnt find a commented out module that looked suspicious...

Cheese wrote:

arena->playing and arena->total give the same number


turns out, i wasnt updating it, it would lock to the same number the first time u called a->playing

Dr Brain wrote:

In the periodic points module.


does this mean i have to use GetPoints() with SetTimer() because theres no callback? =(


also, where can i find a correct usage of SetTimer(), getting compile warnings for not using pointers correctly, its annoying the hell out of me...
Bak - Mon Feb 02, 2009 7:55 pm
Post subject:
if you want to use the functions (llinit ect.) defined in util.h, you must compile with the associated code in util.c, otherwise the linker won't know how to execute them.

it's like if someone told you to compile and link this program:

int doSomething();

int main()
{
doSomething();

return 0;
}

You'd probably say waht the fuck where is doSomething... that's what you're telling the linker to do
Dr Brain - Mon Feb 02, 2009 9:26 pm
Post subject:
Cheese wrote:
^export functions

The info_modname is for ?modinfo.

The arena* is in the function for the attach and detach calls, not for the load and unload calls. You should learn more about the differences between attaching and loading. It'll come up a lot in asss programming.

Cheese wrote:
***edit: also, why am i getting linker undefined reference errors to LLInit+LLAdd+LLEmpty?


Like Bak said, add util.o (or util.c) to your build. I'm not sure the exact technique for windows.

Cheese wrote:
Dr Brain wrote:
Callbacks.


which, i cant seem to find them...


CB_WARZONEWIN
CB_GOAL

It's generally helpful to look in modules that do similar kinds of things. In this case, the points modules. That's how I started doing asss programming: by looking in other modules that did things that I wanted to do.

Cheese wrote:
Cheese> ?man watchdamage
Sorry, I don't know anything about ?watchdamage

how might i remedy this? didnt find a commented out module that looked suspicious...


Look at where you found the original callback for the damage. You'll find the necessary module there too. I'll let you do the exploration.

Cheese wrote:
Dr Brain wrote:
In the periodic points module.


does this mean i have to use GetPoints() with SetTimer() because theres no callback? =(

also, where can i find a correct usage of SetTimer(), getting compile warnings for not using pointers correctly, its annoying the hell out of me...


I've never used either of those functions, but the simple solution is to just make a copy of points_periodic.c and make your own changes (like adding a callback). You could also see how the points module gets called and reproduce the same kind of thing in your own module.
Cheese - Tue Feb 03, 2009 1:48 am
Post subject:
Dr Brain wrote:

CB_WARZONEWIN
CB_GOAL


i was using CB_FLAGRESET,
reset cmd = -1
win = 0+
how is CB_WARZONEWIN different?
and how can CB_GOAL detect when the game is won and reset?

Cheese wrote:

will an attached module work if it isnt in modules.conf?


this

Cheese wrote:

why does pymod give this console error when loading?
Code: Show/Hide

I <cmod> loading C module 'pymod' from 'pymod'
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: No module named os
Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: No module named os
Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: No module named os
Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: No module named os
ImportError: No module named copy_reg

--edit-- also:
E <pymod> can't import cPickle

--edit2-- and after ?shutdown:
M <net> [Cheese] [pid=5] unknown packet type 165
M <net> [Cheese] [pid=5] unknown packet type 165
E <module> error unloading module playerdata

--edit3-- sometimes its this instead:
M <banners> {0} [Cheese] bad size for banner packet
M <banners> {0} [Cheese] bad size for banner packet
E <module> error unloading module playerdata



this

Cheese wrote:

why can i load <py> fg_wz, but <py> fg_turf will crash the server?


this

Dr Brain wrote:

In the periodic points module.


does that mean that its supposed to work automatically if the .cfg for the arena is correct?
because it isnt...

Dr Brain wrote:

look at where you found the original callback for the damage


it turns out i forgot the interface... oops.
however, the callback still did nothing, so i added AddWatch(), which crashes the zone when it is used...

Dr Brain wrote:

That's how I started doing asss programming


i always assumed you were one of the co-founders of as3, how naive of me...


--edit--
why is the standard SendAnyMessage() sent to a linked list?
why not to a player or arena?
why cant we have those?
its nice having nice things... =(
Hakaku - Tue Feb 03, 2009 9:48 am
Post subject:
Cheese wrote:
i was using CB_FLAGRESET,
reset cmd = -1
win = 0+
how is CB_WARZONEWIN different?

The FLAGRESET callback will be called as soon as the flags are reset (e.g. dropping all flags when timer runs out, or when you force a reset). The WARZONEWIN callback is called after a warzone-style flagging game is won (after all flags are won, usually also after the messages "Team victory!" and "Reward:#").

Cheese wrote:
and how can CB_GOAL detect when the game is won and reset?

The current scoring module has no callback for when a ball game is won. I ran into this problem while creating a soccer-style event; you might be better off creating your own module that calculates the scores using the GOAL callback. Otherwise you could modify points_goal.c and add the feature yourself. I'm not familiar with how to do this, but I assume it would be something like the following, added each time it says 'Soccer game over':
Code: Show/Hide
chat->SendArenaSoundMessage(arena, SOUND_DING, "Soccer game over.");
RewardPoints(arena, freq);
DO_CBS(CB_GOALWIN, arena, GoalWinFunc, (arena, freq, RewardPoints));

And then create points_goal.h with:
Code: Show/Hide

/* dist: public */

#ifndef __POINTS_GOAL_H
#define __POINTS_GOAL_H

#define CB_GOALWIN "goalwin"
typedef void (*GoalWinFunc)(Arena *a, int freq, int points);
/* called after a ball game is won */

#endif

Cheese - Tue Feb 03, 2009 3:34 pm
Post subject:
also, is there some sort of command listing command that i dont know about yet?

if not, i will make one
Hakaku - Tue Feb 03, 2009 5:07 pm
Post subject:
Cheese wrote:
also, is there some sort of command listing command that i dont know about yet?

if not, i will make one

You mean a way to list every command in-game? In that case, no, there's no such list. The best there is, is browsing through the /groupdef.dir/ folder.
Cheese - Tue Feb 03, 2009 7:27 pm
Post subject:
just the basic core ones, nothing fancy...

i figured i would make so a simple ?cmd would spam you with a list of cmds and a basic description on the same line.

just for ingame reference
Anonymous - Sat Feb 07, 2009 1:47 pm
Post subject:
i get that same console error too
Hakaku - Sat Feb 07, 2009 2:02 pm
Post subject:
It just occured to me that I had that problem before. If you'd done a search in the forums you should have come up with this:
http://forums.minegoboom.com/viewtopic.php?p=70710#70710

Basically, edit 'asss.bat' and add the line 'SET PYTHONPATH=C:\Python25\Lib' (or wherever Python was installed) near the top. If you don't have Python installed, then that's a problem too.
Code: Show/Hide
@echo off

ECHO starting asss...

SET PYTHONPATH=C:\Python25\Lib
GOTO START

:START

bin\asss.exe

IF ERRORLEVEL 5 GOTO MODLOAD
IF ERRORLEVEL 4 GOTO MODCONF
IF ERRORLEVEL 3 GOTO OOM
IF ERRORLEVEL 2 GOTO GENERAL
IF ERRORLEVEL 1 GOTO RECYCLE
IF ERRORLEVEL 0 GOTO SHUTDOWN

ECHO unknown exit code: %ERRORLEVEL%.

GOTO END

:SHUTDOWN
ECHO asss exited with shutdown.
GOTO END

:RECYCLE
ECHO asss exited with recycle.
GOTO START

:GENERAL
ECHO asss exited with general error.
GOTO END

:OOM
ECHO asss out of memory. restarting.
GOTO START

:MODCONF
ECHO asss cannot start. bad modules.conf.
GOTO END

:MODLOAD
ECHO asss cannot start. error loading modules.
GOTO END

:END

Cheese - Sat Feb 07, 2009 2:16 pm
Post subject:
thanks, and might that be causing <py> fg_turf to crash the server as well?
pretty sure i dont have python anywhere on the computer...
but at the same time, why does <py> fg_wz work then?

i also tried out
Code: Show/Hide

[Listen1]
Port=1400
;AllowCont=1
;AllowVIE=0
;BindAddress=
;ConnectAs=

[Listen2]
Port=1450
ConnectAs=distension

[Directory]
Name=CZ ASSS
Description=CZ ASSS: A test zone.
Password=#$(^@#
Server1=10.0.0.3

[Directory-distension]
Name=CZ Distension
Description=CZ Distension: Development zone for the TW RPG.
Password=$@(^$@#

[Redirects]
tw=66.36.241.110:5400:#cheez

in global.conf
the zone reports both to dir, and clients can connect to both ports.
however, they wind up in pub from both ports.
the tw redirect doesnt work at all (typing ?go tw)
Hakaku - Sat Feb 07, 2009 2:18 pm
Post subject:
To answer the other questions...
Cheese wrote:
will an attached module work if it isnt in modules.conf?

You can load a module and attach it in-game using ?insmod (to load it), and ?attmod (to attach it). Placing the (attach) module directly in modules.conf will ensure that it always gets loaded automatically, as long as you added it in the arena.conf file as well.

Cheese wrote:
why can i load <py> fg_wz, but <py> fg_turf will crash the server?

You shouldn't be able to load either, since your console is telling you that pymod isn't loaded properly. (I provided the fix in my previous post)

Cheese wrote:
DrBrain wrote:
In the periodic points module.

does that mean that its supposed to work automatically if the .cfg for the arena is correct?
because it isnt...

It needs to be attached to the arena, and you need ALL the proper settings for it. A lot of the necessary settings aren't available via esc+c, so you need to add them manually. I probably spent like an entire week trying to explain to resol that he needs to add all (never overlook anything) the necessary settings manually for it to work.

Also make sure that you didn't add insane time delays between each periodic interval, or else you'll probably never know if it works.

Cheese wrote:
why is the standard SendAnyMessage() sent to a linked list?
why not to a player or arena?

For most things, you shouldn't use SendAnyMessage... There already exists specific ways to send messages such as SendMessage, SendSoundMessage, SendArenaMessage, SendArenaSoundMessage, SendModMessage, plus a lot more. Take a look at chat.h for an entire listing with explanations on usage.


Edit: Didn't notice you replied when I was writing this.
Cheese wrote:
thanks, and might that be causing <py> fg_turf to crash the server as well?
pretty sure i dont have python anywhere on the computer...
but at the same time, why does <py> fg_wz work then?

Yes, I'm 100% sure that this is what's causing the crash. And obviously if you don't have python anywhere on your computer, it won't work. You should install it from http://www.python.org/.
Cheese - Sat Feb 07, 2009 2:27 pm
Post subject:
Hakaku wrote:
look at chat.h for an entire listing with explanations on usage.


or here

Hakaku wrote:
A lot of the necessary settings aren't available via esc+c


the settings are client side?
meaning the server doesnt send -anything- except the .cfg to the client?


ill investigate the periodic stuff...
i still havnt figured out watching damage, if anyone has a nice example
Hakaku - Sat Feb 07, 2009 2:42 pm
Post subject:
For the redirect part, ASSS doesn't support that at the moment. You would need Snrrrub's Sendto patch. (If you have it, you should ask him how it works, since I've seen it used for Chaos/League) I also think you need to be on the same biller, but someone should correct me if I'm wrong.

As for the points, they're dealt by the periodic_points module. The problem is though, that esc+c (i.e. clientset) doesn't provide a full list of settings, and it doesn't provide any easy way to expand it if you ever wanted custom settings to be easily changed in-game. (probably should mention this in your checklist, since it really is a problem)
Take a look at the following and make sure you're not missing anything:
http://wiki.mineplowers.com/index.php/Complete_Settings
Cheese - Sat Feb 07, 2009 3:01 pm
Post subject:
userguide.pdf wrote:

Code: Show/Hide

9 Virtual Servers
asss allows one server process to apear to clients as several di?erent servers. The primary
advantage of this feature is that players connecting to all virtual servers are treated the same
internally and can move between arenas and communicate as if they connected to the same
server.
To create virtual servers, you have to tell the net module to listen on more than one port.
You do this by creating additional sections in global.conf named \Listen1," \Listen2," etc.
Each setting must specify a port, and can also optionally specify a virtual server identi?er, and
a speci?c IP address to bind to.
Virtual server identi?ers are used in several ways: if you are using an arena placing module
that supports them (e.g., ap_multipub), the server id will be used as the arena basename to
place players who connect through that port in.
The directory module also supports virtual servers: it will create one directory entry for
each virtual server. The server name and description can be di?erent for each virtual server. To
specify them, create \Name" and \Description" settings in the section \Directory-servername"
for each virtual server identi?er. If either of those settings is missing from that section, it will
fall back to their values in the \Directory" section.
Finally, an example to make this all clear:
;; global.conf
;; listen on 3 different ports:
; players connecting to port 2000 will be send to a random arena.
[Listen1]
Port = 2000
; players who connect to 5000 will be sent to pb1, pb2, etc.
[Listen2]
Port = 5000
ConnectAs = pb
; port 7500 will send them to aswz by default, and so on.
[Listen3]
Port = 7500
ConnectAs = aswz
; this will force the server to listen on an internal interface only
; and send those players to a secret arena:
[Listen4]
BindAddress = 192.168.0.23
Port = 3300
ConnectAs = #secret
[Directory]
;; point to the directory servers you want to be listed on. using
12
;; default port and password.
Server1 = sscentral.one.com
Server2 = sscentral.two.com
;; now describe what this server is called by default:
Name = A Testing Zone
Description = Testing happens here.
[Directory-pb]
;; specify the name and description for pb:
Name = PowerBall
Description = Play with balls!
[Directory-aswz]
;; specify only name for aswz:
Name = A Small Warzone


Code: Show/Hide

Redirects:<name>
Type: String
Settings in the Redirects section correspond to arena names. If a player tries to ?go to an arena
name listed in this section, they will be redirected to the zone speci?ed as the value of the
setting. The format of values is 'ip:port[:arena]'. */



from the asss user guide

Hakaku wrote:
(probably should mention this in your checklist, since it really is a problem)


if its client side, it will never get fixed...


---edit---
lol, never noticed shanky.com, minegoboom.com, and mineplowers.com were the same thing...
Hakaku - Sat Feb 07, 2009 3:49 pm
Post subject:
Ok, so I was wrong about that part.
Quote:
if its client side, it will never get fixed...

It's not clienside, it's serverside. I'm refering to a problem with clientset.c/def, which is what appears in your esc+c. A common problem for ppl is that they believe that all the settings are included in the list provided in-game, but a good portion of the settings are not.
D1st0rt - Sun Feb 08, 2009 11:47 am
Post subject:
You should probably be using ?quickfix anyway
Cheese - Sat Mar 07, 2009 8:00 pm
Post subject:
has anyone successfully used the dual-port multizone function?

i have gotten in by 2 different ports, and got it to report as 2 zones to directories, but in the second 'zone' it does NOT take me to an arena, but to pub like the other...
Dr Brain - Sat Mar 07, 2009 9:14 pm
Post subject:
Cheese wrote:
but in the second 'zone' it does NOT take me to an arena, but to pub like the other...


You need an arena placer that supports the connectas stuff. I know ap_multipub will do it, but I also recall that it gave us some other trouble later on. I don't remember the specifics of the trouble.

You could easily write your own if you run into trouble relating to multiple public arenas by taking ap_multipub and removing nearly everything except the connectas parts.
Cheese - Wed Mar 11, 2009 5:42 pm
Post subject:
i was under the impression that one 'zone' could take you to pub, while the second 'zone' could take you to a specific subarena.

i have multipub disabled.
Dr Brain - Wed Mar 11, 2009 8:23 pm
Post subject:
Cheese wrote:
i was under the impression that one 'zone' could take you to pub, while the second 'zone' could take you to a specific subarena.

i have multipub disabled.
It can. You just need to enable the module that does it.
Cheese - Sat Mar 14, 2009 2:24 pm
Post subject:
sure enough, it works nicely now :P

however, now i have two questions.
since multipub is now enabled, will the main pub overflow into 2 now?

and if i have the 2nd zone set to enter into 'arena' why do you get placed into 'arena1',
and is there a way to go arena, arena2, arena3, etc and NOT arena1, arena2, arena3, etc
Dr Brain - Sat Mar 14, 2009 5:14 pm
Post subject:
Cheese wrote:
since multipub is now enabled, will the main pub overflow into 2 now?


I don't recall.

Cheese wrote:
and if i have the 2nd zone set to enter into 'arena' why do you get placed into 'arena1',
and is there a way to go arena, arena2, arena3, etc and NOT arena1, arena2, arena3, etc


Rewrite the module. It's about as simple a module as you could ask for.
Cheese - Sat Mar 14, 2009 7:29 pm
Post subject:
ap_multipub.c is part of the core, would making a module overwrite its actions?
Dr Brain - Sat Mar 14, 2009 7:59 pm
Post subject:
Cheese wrote:
ap_multipub.c is part of the core, would making a module overwrite its actions?


Write a module that provides the interface that ap_multipub provides, then load your module and not ap_multipub. The core functions only care about finding an interface of the correct type. They don't care where it's located.
Cheese - Sun Mar 15, 2009 6:56 pm
Post subject:
also, looking through the src, i cant seem to find how asss handles setting doors...
aka, it doesnt use cfg DoorMode, theres no game->door(250);, etc
or did i miss something...?

also, why does adding dmg watch crash my module?
just one line,
wd->ModuleWatch(p,1);
can crash it...
no compilation issues.
Dr Brain - Sun Mar 15, 2009 8:28 pm
Post subject:
Cheese wrote:
also, looking through the src, i cant seem to find how asss handles setting doors...
aka, it doesnt use cfg DoorMode, theres no game->door(250);, etc
or did i miss something...?


ASSS doesn't handle doors. The clients handle them.

Cheese wrote:
also, why does adding dmg watch crash my module?
just one line,
wd->ModuleWatch(p,1);
can crash it...
no compilation issues.


Run it in a debugger.
Cheese - Fri Mar 20, 2009 1:39 am
Post subject:
where can i find the code that deals with *timer and ?time?




also, will

cfg->SetInt(GLOBAL,"door","doormode",0,"open sesame!",1);
then
cfg->FlushDirtyValues();

make all the doors open for players?
Dr Brain - Fri Mar 20, 2009 6:47 am
Post subject:
Cheese wrote:
where can i find the code that deals with *timer and ?time?


Search the source for Ctimer and Ctime. On linux:

Code: Show/Hide

cd asss/src
grep Ctime */*.c


will tell you where they are. Most windows IDEs and advanced text editors have some sort of "search in files" that will accomplish the same thing.


Cheese wrote:

will

cfg->SetInt(GLOBAL,"door","doormode",0,"open sesame!",1);
then
cfg->FlushDirtyValues();

make all the doors open for players?

FlushDirtyValues isn't necessary. You just have to make sure they get a new clientset packet. Be warned, clientset packets are relatively large, and will eat your zone's bandwidth if you send them too often.
Cheese - Fri Mar 20, 2009 5:34 pm
Post subject:
how would i ensure they get one?
when are they sent?


also, windows has a grep, i use it a LOT
Dr Brain - Fri Mar 20, 2009 8:18 pm
Post subject:
Cheese wrote:
how would i ensure they get one?
when are they sent?


Read through the clientset module. See what conditions it takes to send out a clientset. It might even do it automatically when you update settings.

Cheese wrote:
also, windows has a grep, i use it a LOT


More likely you've got Cygwin installed somewhere on your path.
Hakaku - Sat Mar 21, 2009 1:35 pm
Post subject:
Why exactly would you use cfg->SetInt, then use clientset to force the client to update its settings? I fail to see how this is more advantageous than using the first with cfg->FlushDirtyValues(); . Why not just only use clienset's AreanaOverride and SendClientSettings in the first place?
Dr Brain - Sat Mar 21, 2009 2:34 pm
Post subject:
Well, FlushDirtyValues only writes changes back into the configuration files, and since you'd want to be using temporary setting for this, it'd effectively be doing nothing.

Using the clientset's arena override would be fine, but you need to be aware that random doors will cause you trouble if players have different clientset packets (since I believe the timing is based off of that).
D1st0rt - Tue Mar 24, 2009 4:31 pm
Post subject:
I believe the timers are reset with a synchronization request, so there might still be differences among clients but not due to the settings packets (unless you're talking about a transition from set to random I suppose)
Dr Brain - Tue Mar 24, 2009 6:43 pm
Post subject:
I thought maybe its prng was seeded from a hash of the clientset. I haven't looked at it too much, though, since we don't use doors in Hyperspace very often.
Cheese - Tue Mar 24, 2009 6:56 pm
Post subject:
how has the asss core gotten this far without an easy way to change door state?

its used a lot, and accordingly there should be a
game->Door(255)

or SOMETHING, ffs
Initrd.gz - Tue Mar 24, 2009 8:51 pm
Post subject:
Make your own function. biggrin.gif
Dr Brain - Tue Mar 24, 2009 9:16 pm
Post subject:
Cheese wrote:
how has the asss core gotten this far without an easy way to change door state?

its used a lot, and accordingly there should be a
game->Door(255)

or SOMETHING, ffs


Doing that would give people the false impression that it's a good idea. Did you not read what I said about sending lots of clientset packets? It's bad.
Hakaku - Tue Mar 24, 2009 9:31 pm
Post subject:
Dr Brain wrote:
Doing that would give people the false impression that it's a good idea. Did you not read what I said about sending lots of clientset packets? It's bad.

Then would it ultimately be better to just use the cfg->SetInt, and if really needed, cfg->FlushDirtyValues afterwards?

Actually, since you mentioned that the problem would lie moreso with random doors, would using the ArenaOverride to set the doormode to 0 or 255, and then Unoverride to return the door state back to random also be just as problematic?
Dr Brain - Wed Mar 25, 2009 6:23 am
Post subject:
Any way you change the door mode will have to involve sending every player in the arena a fairly large packet. And you have to do this every time you change the doors. If you change the doors once per event, then it's not a big deal. Changing it once per minute, however, would probably double your zone's bandwidth.
Cheese - Tue Sep 22, 2009 11:26 am
Post subject:
new question:

i know it is possible to rewrite chat messages, like in an obscene module like cerium's hyperspace one.

i can create a new message with the rewritten text, but how do i prevent the original message from being sent?

is it possible to simply change the old message without sending a new one?

and if i change their message, will the sender recieve the change? (i dont want them to)
because in hyperspace i notice they dont.
Dr Brain - Tue Sep 22, 2009 2:33 pm
Post subject:
You have to replace the core's chat module with your own. Typically this means commenting out chat in modules.conf, and adding my_modules:my_chat.

In the future things like modifying chat messages will be possible without a core replacement, but not at present.
Cheese - Tue Sep 22, 2009 2:56 pm
Post subject:
just found this in chat.h, what does it do?
Code: Show/Hide

/* this isn't for general use */
#define CB_REWRITECOMMAND "rewritecommand"
typedef void (*CommandRewriterFunc)(int initial, char *buf, int len);



and the chat rewrite would be nice to have in your new core version icon_wink.gif
Anonymous - Tue Oct 06, 2009 1:14 pm
Post subject:
This is kind of a guess. But that's a callback, so... it looks like this is called when a command is sent through the chat, before it's passed to whatever actually calls the actual function that the command represents.

Does sgcompat use this? Is this how it turns *arena into ?a ? It looks like you could use it to intercept a command, then physically change the *arena string to ?a. I have no idea where sgcompat even is in the code, so I can't check from where I am, unless bitbucket has a Find In Files option. I didn't see the callback in cmdman.c so it must be something that happens before the module sees it.
Hakaku - Tue Oct 06, 2009 1:49 pm
Post subject:
You're correct, sgcompat does use it to rewrite commands such as *arena into ?a. However, looking briefly at the source, the term 'rewrite' seems a misnomer to me. Unless I'm missing something, the callback enables a module to listen on all commands being sent, so that when a user types "*arena", the module can detect the command and appropriately handle it (?a). It does not, however, overwrite existing commands. So if you tried to rewrite ?lag to something else, both ?lag and your new function will be called. Probably the only difference between the command rewrite and adding a new command, is that in the first, you're able to read the original string being sent, which would allow you to distinguish *cmd from ?cmd.

(the callback's in chat.h like Cheese mentioned)
Animate Dreams - Tue Oct 06, 2009 5:23 pm
Post subject:
Yeah, I guess it's rewriting the string? It could be named better.
Cheese - Sat Mar 06, 2010 2:37 am
Post subject:
how can my module detect whether a player has lagged out instead of pressing f11?
JoWie - Sat Mar 06, 2010 5:56 am
Post subject:
p->flags.no_ship


Read the damn ASSS source
Cheese - Sat Mar 06, 2010 7:06 am
Post subject:
thats a very misleading flagname D:

also, i use many computers, all but one dont have the source
Dr Brain - Sat Mar 06, 2010 7:20 am
Post subject:
Why are you working on asss on computers without the source? If only there were somewhere where you could download the asss source, or view it online. Seriously, that's one of the worst excuses I've ever heard.
Cheese - Mon Mar 29, 2010 6:59 pm
Post subject:
when calling flag->SetFlags and flag->CountFlags both are returning 0.
i suspect this is because the AD_OK macro is failing, but i cant figure out why.
JoWie - Tue Mar 30, 2010 9:47 am
Post subject:
make sure the flag game is initialized first
Cheese - Tue Mar 30, 2010 4:01 pm
Post subject:
i was looking into that, but couldnt figure out how.
im curious as to why the header has two interfaces, but the code only declares one, and I_FLAGGAME is only found in those 2 files...


simply calling fg->Init(a) will crash the zone, im guessing due to null pointers, and calling

flag->SetCarryMode(a,CARRY_ALL);
flag->ReserveFlags(a,1);

also does nothing, and calling

flag->SetFlags(a,0,&fi,1);
flag->CountFlags(a);

both return 0, indicating failure
JoWie - Tue Mar 30, 2010 6:39 pm
Post subject:
A module implementing a flag game must register the interface I_FLAGGAME to the arena. This is usually done by fg_wz or fg_turf.

So if you are making your own flag game you would do something like:

Code: Show/Hide

static void FlagGameInit(Arena *arena)
{
   flagcore->SetCarryMode(arena, CARRY_ALL);
   flagcore->ReserveFlags(arena, 15);
}

static void FlagGameFlagTouch(Arena *arena, Player *p, int fid)
{
   // ...
}

static void FlagGameCleanup(Arena *arena, int fid, int reason, Player *oldcarrier, int oldfreq)
{
   // ...
}

static void FlagGainCB(Arena *arena, Player *p, int fid, int how)
{
   // ...
}

static void FlagLostCB(Arena *arena, Player *p, int fid, int how)
{
   // ...
}

static void FlagOnMapCB(Arena *arena, int fid, int x, int y, int freq)
{
   // ...
}

static void FlagResetCB(Arena *arena, int freq, int points)
{
   // ...
}

static Iflaggame flaggame =
{
   INTERFACE_HEAD_INIT(I_FLAGGAME, "myflaggame")
   FlagGameInit,
   FlagGameFlagTouch,
   FlagGameCleanup
};

EXPORT int MM_bla(int action, Imodman *mm_, Arena *arena)
{
   // ...
   else if (action == MM_ATTACH)
   {
      mm->RegInterface(&flaggame, arena);
      mm->RegCallback(CB_FLAGGAIN, FlagGainCB, arena);
      mm->RegCallback(CB_FLAGLOST, FlagLostCB, arena);
      mm->RegCallback(CB_FLAGONMAP, FlagOnMapCB, arena);
      mm->RegCallback(CB_FLAGRESET, FlagResetCB, arena);
   }
   else if (action == MM_DETACH)
   {
      if (mm->UnregInterface(&flaggame, arena))
         return MM_FAIL;

      mm->UnregCallback(CB_FLAGGAIN, FlagGainCB, arena);
      mm->UnregCallback(CB_FLAGLOST, FlagLostCB, arena);
      mm->UnregCallback(CB_FLAGONMAP, FlagOnMapCB, arena);
      mm->UnregCallback(CB_FLAGRESET, FlagResetCB, arena);
   }
}

Cheese - Wed Mar 31, 2010 12:31 am
Post subject:
and eureka it works, although i still cant fathom why...

many thanks to you, good sir


edit:

now that i went back and looked, its an EXTREMELY odd way to do things, calling an interface that probably doesnt exist and sending it stuff >_<
Cheese - Fri Apr 02, 2010 2:23 am
Post subject:
i recently discovered you can send files from your continuum folder
big discovery, right? :P

however, i didnt send it from the top, i sent a file INSIDE A FOLDER in the continuum folder! :O
(ex: ?sendfile banners/meh.bmp)
was this possible in subgame with *putfile as well?

now knowing this, i cant help but wonder, is it possible for ?getfile to put the file INTO A FOLDER INSIDE your ss directory?
because that would mean the zone could put files there too.

and if that is true too, then couldnt we completely bypass the 4mb file transfer limit by sending the players requesting dl to a fake arena, then build the arena file structure, then send them to the real arena? :O
L.C. - Fri Apr 02, 2010 8:35 am
Post subject:
Cheese wrote:
and if that is true too, then couldnt we completely bypass the 4mb file transfer limit by sending the players requesting dl to a fake arena, then build the arena file structure, then send them to the real arena? :O
That's assuming there isn't a limit imposed on those two functions. If there is, and it happens to be the same limit, at least you can do up to 8 MB. sa_tongue.gif
Dr Brain - Fri Apr 02, 2010 8:42 am
Post subject:
IIRC, the incoming file name length is limited to 15 chars. That means unless your zone name is 3 characters, you're pretty much out of luck (assuming the incoming transfer will even allow directories; I haven't checked).
Cheese - Fri Apr 02, 2010 11:09 am
Post subject:
L.C. wrote:
[..]
That's assuming there isn't a limit imposed on those two functions. If there is, and it happens to be the same limit, at least you can do up to 8 MB. :p


but whos to say you cant send them to a different fake arena per file? :)

Dr Brain wrote:
IIRC, the incoming file name length is limited to 15 chars.


limited by asss or limited by the protocol?
Dr Brain - Fri Apr 02, 2010 11:39 am
Post subject:
It's a protocol limitation, but don't take my word for it. Open up the code and find out for yourself. If you're serious about overcoming the limitation, you'll have to at least get your feet wet.
Cheese - Tue Apr 06, 2010 3:06 am
Post subject:
somehow i have gotten this in a crash:

Code: Show/Hide

Assertion failed: ad->fis[i].state == FI_ONMAP, file core/flagcore.c, line 132

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
asss out of memory. restarting.



no idea what an assertion is...
i hadnt called setflags and i reserved 1 flag


also, when you get a crash due to a deadlock, it restarts, thats good, but it never can bind the listen port, so the restart is essentially useless...
Samapico - Tue Apr 06, 2010 8:40 am
Post subject:
When an assertion fails, it means something was not like it is supposed to, and could potentially lead to a crash.

So in that part of the code, ad->fis[i].state == FI_ONMAP, but it should have been something else (or the other way around, depending on what it printed out)

http://en.wikipedia.org/wiki/Assertion_(computing)
Quote:
In computer programming, an assertion is a predicate (i.e., a true?false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place.

Cheese - Tue Apr 06, 2010 2:55 pm
Post subject:
why isnt doesnt the flagcore reinitialize after a flag reset?
all this does is force the arena to be destroyed and be recreated before a different flag mode can be used...

how do i prevent the 'flag game didn't set carry mode' message if the arena has no flags?
Cheese - Thu Apr 08, 2010 12:40 am
Post subject:
how was the old *thor level accomplished?

can i replicate it just by setting
Weapons.type=W_THOR
and Weapons.level?

and will anything happen if i set the other fields like shrap, level, bounce, etc?
Dr Brain - Thu Apr 08, 2010 7:33 am
Post subject:
http://bitbucket.org/drbrain/hs_util/src/tip/kill.c line 97
Cheese - Thu Apr 08, 2010 9:32 pm
Post subject:
i remember reading about all the possible weapon packet types/values on a site or possibly src file somewhere that listed all the types and their alternate values somewhere. (bomb + alt = mine)
does anyone know of something like that?


also, im really only interested in the special cases, if that helps
(burst alt? decoy alt? thor alt?)
Samapico - Thu Apr 08, 2010 9:54 pm
Post subject:
Cheese wrote:
i remember reading about all the possible weapon packet types/values on a site or possibly src file somewhere that listed all the types and their alternate values somewhere. (bomb + alt = mine)
does anyone know of something like that?


also, im really only interested in the special cases, if that helps
(burst alt? decoy alt? thor alt?)
There's a good chance that special alt's don't do anything
Cheese - Fri Apr 09, 2010 2:38 am
Post subject:
also, why do i seem to be getting erratic behavior from readdir()
in the wincompat header?

when i throw it in a loop, it runs filenumber+2 times (why +2?) and returns a string with only a \0 character for every dirent->d_name
Arnk Kilo Dylie - Fri Apr 09, 2010 2:06 pm
Post subject:
I'd guess it's . and ..
Cheese - Sat Apr 17, 2010 3:01 am
Post subject:
fun fact:

i spent 10-15 mins and made a ?makefake and ?killfake command
i then wondered why it made 2 fakes instead of one.

turns out i hadnt looked at fake.c, which happened to have those already, and activated as well. I made the exact same command, and happened to use the exact same names.

dont make the same mistake i did :(
Cheese - Tue Apr 20, 2010 6:58 pm
Post subject:
what is the possible range for *objon?
i would guess its a power of 2, and i know its over 256...

and what is the point of failure?
does the lvz builder break first or the objon cmd?

PS:
also, it looks like theres a 256 object max?


edit:

found it.

Mine GO BOOM wrote:
By the data format alone, it supports upto 32,768 numbers (everything between 0 and 32,767). As if you should ever use that many without making Continuum use up 500meg of RAM, I'd suggest not.


so its (2^16)/2
thats like a signed short int, right?
Samapico - Wed Apr 21, 2010 1:39 pm
Post subject:
Cheese wrote:
what is the possible range for *objon?
i would guess its a power of 2, and i know its over 256...

and what is the point of failure?
does the lvz builder break first or the objon cmd?

PS:
also, it looks like theres a 256 object max?


edit:

found it.

[..]



so its (2^16)/2
thats like a signed short int, right?


The objectID is an unsigned 15 bit integer.
The way it's packed in the lvz file, the first bit indicates a mapobject or screenobject, and the following 15 bits are the objectID. Then you have other data such as x/y coordinates, layer, etc.

http://wiki.minegoboom.com/index.php/LVZ_Format


Note that Continuum has a limit of 255 (or maybe 256?) DIFFERENT images (see Image Number)
JoWie - Wed Apr 21, 2010 5:17 pm
Post subject:
I thought it was 255 max images per lvz file and 256 max total
Samapico - Wed Apr 21, 2010 5:23 pm
Post subject:
JoWie wrote:
I thought it was 255 max images per lvz file and 256 max total
Could be so... though I don't see why a single lvz could not have 256 images, unless the Continuum's implementation is kind of screwed up.
Cheese - Fri Apr 23, 2010 10:09 pm
Post subject:
how do i set up a callback?
ive tried:

in x.c
Code: Show/Hide

DO_CBS(CB_X,a,xFunc,(a,p,freq));



in x.h
Code: Show/Hide

#define CB_X "x"
typedef void (*xFunc)(Arena *a, Player *p, int freq);




but i have yet to get a single callback to work without crashing the zone.
what am i missing?


edit:
also, why on earth is DO_CBS defined as a

do
{
} while(0)

macro?
isnt that completely pointless?
Arnk Kilo Dylie - Sat Apr 24, 2010 12:08 am
Post subject:
No, adding a new {} block allows you to define new variable names under non-C99 compilers.
Cheese - Sat Apr 24, 2010 1:01 am
Post subject:
but u can just use a normal { } to do that, why the do while
Arnk Kilo Dylie - Sat Apr 24, 2010 2:47 am
Post subject:
Might be for added compatibility. I don't know any compiler that requires it as such.

If you're getting a crash a backtrace might be in order if DO_CBS is failing. Which is to say, you're probably doing something else wrong, but knowing where the crash is happening will give some vital information.
Cheese - Sat Apr 24, 2010 1:53 pm
Post subject:
how do i do a backtrace if im not on linux?
Dr Brain - Sat Apr 24, 2010 5:04 pm
Post subject:
Same way as on linux: use a debugger.
Cheese - Sat Apr 24, 2010 5:47 pm
Post subject:
found out using the MyBrain debugger:

logic: zone crashes largely due to null pointer usage, where in do_cbs does it use a pointer?

i now know why dr brain has the curious habit of putting
mm=mm2;
at the beginning of every load.

just like any other interface, if you call it without loading it, it crashes the zone.
you still cant use a null pointer...
JoWie - Sun Apr 25, 2010 5:45 am
Post subject:
the do { ... } while(0) is a common method to support using macro's in one liners, for example:

Code: Show/Hide

#define hmm(A,B) do { A *= 4; B += 6 } while(0)

int a = 5, b = 7;

if (1)
   hmm(a, b);


Cheese - Tue Apr 27, 2010 5:58 pm
Post subject:
so im terrible with pointers and memory stuff, and im trying to do:

Code: Show/Hide

Player *pstats[10];
//lock
FOR_EACH_PLAYER_IN_ARENA(p,a)
{
    //stuff

      pstats[0]=p;
}
//unlock
     //more stuff

    pstats[0]->name



but its crashing, im making 10 calls, some work properly, some output odd chars, and some crash the zone with a deadlock.

which is extremely confusing :S
what am i doing wrong?
Hakaku - Tue Apr 27, 2010 6:38 pm
Post subject:
What exactly are you trying to achieve? And why don't you just use player data?
Cheese - Tue Apr 27, 2010 6:54 pm
Post subject:
because im saving a player pointer?
Samapico - Tue Apr 27, 2010 7:20 pm
Post subject:
I'm taking a wild guess here, and I haven't worked with ASSS at all... But chances are the pointers you use are not safe to use because the data might be moved around, or even deleted when the player list changes.

The safest way would be to store some unique info (name or some ID) instead of a pointer, and find that info in the list everytime you want to take an action on a player.
Cheese - Tue Apr 27, 2010 7:38 pm
Post subject:
which is why theres the lock and unlock, to stop that from happening

ive also tried copying the entire player struct:

Code: Show/Hide

Player pstats[10];
//lock
FOR_EACH_PLAYER_IN_ARENA(p,a)
{
    //stuff

      pstats[0]=*p;
}
//unlock
     //more stuff

    pstats[0].name


Dr Brain - Tue Apr 27, 2010 10:10 pm
Post subject:
Which line does the debugger say it's crashing on?
Cheese - Thu Apr 29, 2010 2:24 am
Post subject:
i have set an arena [team] to only allow freqs 0-1, and set it to a 1 person limit (so players cant =1) with the new team settings.

however, for some reason it places a person on freq 0, then 1, then the rest of anyone who joins on freq 0, eventually making it 1000v1.

how can i get it to be 500v500 instead, while still not allowing =1?
Cheese - Mon May 03, 2010 10:56 pm
Post subject:
why does


int totalrp[2];
lm->Log(L_DRIVEL,"0a 0=%i 1=%i",totalrp[0],totalrp[1]);

output

D 0a 0=2293240 1=4207083



what the hell is going on?
its only 2 lines of code, nothing else
Samapico - Mon May 03, 2010 11:55 pm
Post subject:
Cheese wrote:
why does


int totalrp[2];
lm->Log(L_DRIVEL,"0a 0=%i 1=%i",totalrp[0],totalrp[1]);

output

D 0a 0=2293240 1=4207083



what the hell is going on?
its only 2 lines of code, nothing else
Well... because your ints are not initialized?
Cheese - Tue May 04, 2010 11:07 am
Post subject:
ints are always auto initialized to 0
Arnk Kilo Dylie - Tue May 04, 2010 1:40 pm
Post subject:
...

.....


no lol
Dr Brain - Tue May 04, 2010 1:44 pm
Post subject:
Variables are not initialized except in certain specific situations (situations such as using a completely different programming language, lol). Memory too, is not guaranteed to be zeroed when allocated (which is why amalloc zeros it out before returning it).
Cheese - Tue May 04, 2010 1:49 pm
Post subject:
WTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

since when omfg


spent like an hour trying to figure out why 1+2+3=1239854

:C
Dr Brain - Tue May 04, 2010 2:25 pm
Post subject:
Since before you were born.
Samapico - Tue May 04, 2010 5:22 pm
Post subject:
Some languages initialize variables, like VB6 (dunno about .net), but still it's an assumption you should never make
Cheese - Wed May 05, 2010 1:52 pm
Post subject:
lvz map objects are positioned using the top left corner as a reference instead of the center.

is this also true for screen objects?
Samapico - Wed May 05, 2010 7:30 pm
Post subject:
Why would anything be referenced to the center? Tiles go from (0,0) to (1023,1023), the pixels on your screen go from (0,0) to (X,Y) the same way...
If you are talking about the top-left corner of the image being placed at the specified coordinate, same deal.

Screen objects are referenced to top-left of the screen by default, but you can have them reference to whatever you want... just read the example.ini that comes with the lvz builder

C10,C-20 would be 10 pixels to the right from center, and 20 pixels above from center of the screen. In the lvz format, this is referred to as X type/Y type.
Cheese - Mon May 17, 2010 2:26 pm
Post subject:
so if i have an array in a struct, and want to do:
int[5]={1,2,3,4,5};
how do i do it?
Dr Brain - Mon May 17, 2010 2:50 pm
Post subject:
you can define it as part of the struct initializer, or you can spell it out:

my_struct->my_int[0] = 1;
my_struct->my_int[1] = 2;
my_struct->my_int[2] = 3;
my_struct->my_int[3] = 4;
my_struct->my_int[4] = 5;

A for loop is better if your values have some kind of sense to them. Any decent optimizing compiler will unroll the loop anyway, so never hesitate to use whichever is best for readability.
Cheese - Mon May 17, 2010 5:44 pm
Post subject:
nuuuuuuuuuuuuuuuuuu :C


i have 8 sets of 50 nonsensical numbers -___-"



o well, guess ill have to hack my way across the C yet again :(
time to convert to string + parse $$$
Dr Brain - Mon May 17, 2010 5:54 pm
Post subject:
If they're constant, you can declare them in a global array, and then use a for loop to copy them in.
Cheese - Thu May 20, 2010 12:43 am
Post subject:
so what would cause a crash after a successful module attach without any log messages, with a log message at the start of every function, with no deadlock?




related:
anyone know how to debug a dll, preferably with gdb?
Cheese - Fri May 21, 2010 7:15 am
Post subject:
so do u get a segfault immediately, or when the function returns?
Cheese - Thu Jun 03, 2010 9:08 pm
Post subject:
i wrote a turret module (autoturret/pointdefense) that uses the findTurretTarget(), fireControl(), and lhypot() functions from autoturret.c

it works just fine, as long as the range (int bd=1024*16) is set to the whole map.
if you lower the range, it will crash, or if you set it to detect nonfake nonteam players and there arent any, it will crash.

however, i cant figure out why, and i suck at math.
any ideas?
Dr Brain - Thu Jun 03, 2010 10:57 pm
Post subject:
Crashes where? Code?
Cheese - Fri Jun 04, 2010 11:05 am
Post subject:
Quote:
from autoturret.c

Quote:
int bd < 1024*16

Quote:
i cant figure out why



simply lower autoturret range to test, it will crash when noones in range
Dr Brain - Fri Jun 04, 2010 6:43 pm
Post subject:
If the problem is that it crashes when it can't find a player to shoot at, perhaps the solution is to make sure it doesn't shoot (or point) when there's no one there. Math shouldn't be involved.
Cheese - Thu Jun 10, 2010 2:39 pm
Post subject:
seems i have to start doing Player *p=NULL instead of just Player *p...


also, what would cause all my flags to hide themselves when i have fake players in ships?


and is there a way to get spectators to send position packets more often?
Cheese - Fri Jun 11, 2010 9:18 pm
Post subject:
what metric is the recharge on ships based off of?

if a warbird has 1000 recharge, what does that mean?
it gets 1000 energy per second? millisecond? year?



also, is it possible to prize fake players? (havnt looked into it yet)
Arnk Kilo Dylie - Sat Jun 12, 2010 2:10 am
Post subject:
If you're going to pile on a ton of questions about ASSS at least keep them focused to ASSS and don't double post...lordy

Respectively of the questions you asked/statements you said that have anything to do with the server,

1. Sure, though I can only think of one general reason why you'd ever need to initialize a stack Player *...unless you've got some crazy design going

2. Doing crazy things?

3. Sure, you can tell asss to send a prize packet to the fake player. It won't blow up. Ever heard of just trying something?
JoWie - Sat Jun 12, 2010 9:24 am
Post subject:
recharge is energy per 10 seconds
Samapico - Sat Jun 12, 2010 9:34 am
Post subject:
Cheese wrote:
what metric is the recharge on ships based off of?


Use the wiki, ffs
http://wiki.minegoboom.com/index.php/Special:Search?search=recharge&go=Go
Cheese - Sat Jun 12, 2010 2:13 pm
Post subject:
thanks
hehe, was barely conscious when i wrote that, but still got work done



also, i have

[Net]
AllowVIE=0
AllowCont=1

why was some retard able to waltz in my zone and load up about 7 VIE bots?
(as per ?info)
Arnk Kilo Dylie - Sat Jun 12, 2010 3:45 pm
Post subject:
Net:AllowVIE and Net:AllowCont not being actual settings may or may not have something to do with it..? Yet another thing you should probably check before asking..
Cheese - Sat Jun 12, 2010 4:00 pm
Post subject:
its in net.c, as well as being in http://forums.minegoboom.com/viewtopic.php?t=8659


/* cfghelp: Listen:AllowVIE, global, bool, def: 1
* Whether VIE protocol clients (i.e., Subspace 1.34 and bots)
* are allowed to connect to this port. */
ld->allowvie = cfg->GetInt(GLOBAL, secname, "AllowVIE", 1);
/* cfghelp: Listen:AllowCont, global, bool, def: 1
* Whether Continuum clients are allowed to connect to this
* port. */
ld->allowcont = cfg->GetInt(GLOBAL, secname, "AllowCont", 1);

yeah, its probably real.
you should check.
JoWie - Sat Jun 12, 2010 5:11 pm
Post subject:
Just use funky:auth_vie (in src/contrib)
Arnk Kilo Dylie - Sat Jun 12, 2010 5:58 pm
Post subject:
Listen:Allow* is not Net:Allow*

Do you think I didn't actually check this before posting I thought you could've gotten the hint about checking things before posting!

Also yeah I've never used any of those settings, auth_vie is always what I've used.
Cheese - Sat Jun 12, 2010 7:50 pm
Post subject:
auth_vie looks good, i never noticed it until now
it also looks redundant if you have allowvie=1

also, if its in funky, why isnt it in the funky folder?
Cheese - Sat Jul 10, 2010 3:05 am
Post subject:
yo when im tracking a fake player, what should i look before when the fake gets destroyed before the player pointer becomes invalid?
Arnk Kilo Dylie - Sat Jul 10, 2010 3:28 am
Post subject:
When you call EndFaked you should no longer be keeping the pointer anywhere.
JoWie - Sat Jul 10, 2010 7:11 am
Post subject:
CB_NEWPLAYER is right after a player gets allocated and right before the freeing
Cheese - Sat Jul 10, 2010 4:32 pm
Post subject:
JoWie wrote:
CB_NEWPLAYER is right after a player gets allocated and right before the freeing


i should have looked in player.h first right? lol -_-
thanks


Arnk Kilo Dylie wrote:
When you call EndFaked you should no longer be keeping the pointer anywhere.


but what if its not me calling it? :P
JoWie - Mon Jul 12, 2010 7:16 pm
Post subject:
Personally, I almost always watch for CB_NEWPLAYER when creating or dealing with fake players. It feels less error prone and I like playing with ?killfake
Cheese - Sun Jan 02, 2011 2:06 am
Post subject:
so im trying to move a fake player
it has a speed and thrust, which if i recall is pixels per 10s.
however, when placed in the middle of a square it currently moves to a corner as fast as it moves to a side.

Code: Show/Hide

//dt=change in time
//tp=target pos
//md=fake pos
               while(dt)
               {
                  dt--;
                  int dx=tp->position.x - md->pos.x;
                  int dy=tp->position.y - md->pos.y;
                  
                  md->pos.xspeed+=(dx > md->thr) ? md->thr : dx;
                  md->pos.yspeed+=(dy > md->thr) ? md->thr : dy;
                  
                  if(md->pos.xspeed > md->spd) md->pos.xspeed=md->spd;
                  if(md->pos.xspeed < -md->spd) md->pos.xspeed=-md->spd;
                  if(md->pos.yspeed > md->spd) md->pos.yspeed=md->spd;
                  if(md->pos.yspeed < -md->spd) md->pos.yspeed=-md->spd;
                  
                  md->pos.x+=md->pos.xspeed;
                  md->pos.y+=md->pos.yspeed;
               }


i am pretty bad at math, and i think i might be needing sin and cos somewhere, because the speed/time locus should be a circle and not a square



edit:

im thinking its something close to this: -oldcode-

edit2:

but now i think i might have it:

Code: Show/Hide

                  if(dx == 0) dx++;
                  double dir=atan(dy/dx);
                  md->pos.xspeed+=md->thr*sin(dir);
                  md->pos.yspeed-=md->thr*cos(dir);
                  
                  int spd=sqrt(pow(md->pos.xspeed,2)+pow(md->pos.yspeed,2));
                  if(spd > md->spd)
                  {
                     int excess=spd-md->spd;
                     md->pos.xspeed-=excess*sin(dir);
                     md->pos.yspeed+=excess*cos(dir);
                  }


edit3:

but now it only moves up vertically :(
i think somethings wrong with atan?
Dr Brain - Sun Jan 02, 2011 8:05 am
Post subject:
That looks like an infinite loop. That can't be a good thing.

EDIT: look at atan2 if you're having trouble with atan.
Cheese - Sun Jan 02, 2011 11:08 am
Post subject:
having dir=atan(dy/dx); or dir=atan2(dy,dx); both produce the same strange result where the bot circles me at an odd radius, so its probably very close to being correct

i know this is the last line i need to fix but i am terrible at math and have no idea how to fix it
Dr Brain - Sun Jan 02, 2011 11:32 am
Post subject:
I'm rather unclear on what you're trying to accomplish.
Cheese - Sun Jan 02, 2011 11:45 am
Post subject:
theres a fake player, and a target.
goal: fake player moves to target

so far:
Code: Show/Hide

      dt=TICK_DIFF(now,md->lastmove);
...
               while(dt)
               {
                  dt--;
                  int dx=tp->position.x - md->pos.x;
                  int dy=tp->position.y - md->pos.y;
                  
                  if(dx == 0) dx++;
                  double dir=atan(dy/dx); //<-----------------
                  md->pos.xspeed+=md->thr*sin(dir);
                  md->pos.yspeed-=md->thr*cos(dir);
                  
                  int spd=sqrt(pow(md->pos.xspeed,2)+pow(md->pos.yspeed,2));
                  if(spd > md->spd)
                  {
                     int excess=spd-md->spd;
                     md->pos.xspeed-=excess*sin(dir);
                     md->pos.yspeed+=excess*cos(dir);
                  }
                  
                  md->pos.x+=md->pos.xspeed;
                  md->pos.y+=md->pos.yspeed;
               }



with this, it is moving, but in strange ways

heres some detailed technical diagrams



Samapico - Sun Jan 02, 2011 12:54 pm
Post subject:
1) atan2 will work no matter in which quadrant the angle is (or if you prefer, no matter what's the sign of x and y)... i.e. if x is negative and y is positive, the angle output will be from pi/2 to pi. atan always returns an angle between -pi/2 and pi/2.
So you want to use atan2.

2)md->pos.xspeed+=md->thr*sin(dir);
md->pos.yspeed-=md->thr*cos(dir);

cos applies to x, and sin applies to y

3) just an optimization, but:
sqrt(pow(md->pos.xspeed,2)+pow(md->pos.yspeed,2))
should be
sqrt(md->pos.xspeed*md->pos.xspeed + md->pos.yspeed*md->pos.yspeed)
it's much more efficient

4) You can calculate the max speed in both x and y , instead of removing excess speed...
maxspeedx = <max ship speed> * cos(dir)
maxspeedy = <max ship speed> * sin(dir)

however... if the ship is going left, maxspeedx will be NEGATIVE, so you would need to check the absolute value to compare, probably...
Cheese - Sun Jan 09, 2011 2:35 am
Post subject:
so now im trying to construct a system of bitwise flags

problem is i have no idea what im doing
this is what ive got so far:
Code: Show/Hide

#define STATE_A 1
#define STATE_B 2
#define STATE_C 4
#define STATE_D 8
int oldstate=0;
setflags(int newflags, BOOL value) //falue is true to add flags, false to remove
{
   if(!value) newflags=!newflags;
   if(!oldstate & state) oldstate+=state;
}


any ideas where i could look in the asss source to find a better idea?
Samapico - Sun Jan 09, 2011 3:39 am
Post subject:
hmmm

Code: Show/Hide

setflag(int oldflag, int newflag)
{
oldstate |= newflag;  //this is equivalent to: oldstate = oldsate|newflag;
}

clearflag(int oldflag, int newflag)
{
oldstate = oldstate & (~newflag);
}


i.e.

setflag(oldstate, STATE_A);
clearflag(oldstate, STATE_B);



OR


following the structure you have in your example:

Code: Show/Hide

setflags(int newflags, BOOL value) //falue is true to add flags, false to remove
{
   if(value)
          oldstate |= newflags; //or 'oldstate = (oldstate | newflags);'
   else
          oldstate = (oldstate & (~newflags));
}



And I suggest you define your flags in a typedef enum
Dr Brain - Sun Jan 09, 2011 8:43 am
Post subject:
The "!" is a logical not, you want the "~" for bitwise not.

Set:
val |= flags;

Clear:
val &= ~flags;

I do this all the time for my work in embedded controllers. It's much more common to make two inline functions for set and clear than to make one function taking an option.
Samapico - Sun Jan 09, 2011 12:00 pm
Post subject:
Dr Brain wrote:
The "!" is a logical not, you want the "~" for bitwise not.
Oops, you're right... edited post to avoid confusion.
Cheese - Sun Jan 09, 2011 2:27 pm
Post subject:
yay i was getting close :D


also, it looks like it will be able to do sending it a combination of flags added together?
or should they be &'d together?


Samapico wrote:
And I suggest you define your flags in a typedef enum


why?
Dr Brain - Sun Jan 09, 2011 3:11 pm
Post subject:
Don't use + or &. You want |.

As far as I'm aware, an enum has no advantages over a define for flags and masks.
Samapico - Sun Jan 09, 2011 3:11 pm
Post subject:
Well it depends on how you use them I guess, but you could have functions that take a 'somethingFlag' as an argument, or variables of type 'somethingFlag', which is more explicit than 'int'. Much like using BOOL is clearer than using ints, even though they're the same thing.


And you can set multiple flags at once if you call like: set(flag1 | flag2)
Or clear multiple flags the same way: clear(flag1 | flag2)
Cheese - Sun Jan 09, 2011 3:28 pm
Post subject:
and this agrees with sama:

http://www.cprogramming.com/tutorial/enum.html
Dr Brain - Sun Jan 09, 2011 7:16 pm
Post subject:
You'll note that it says it doesn't help in C.

It doesn't hurt you, but like I said, there's no advantage.
Cheese - Sun Jan 09, 2011 7:17 pm
Post subject:
meh i guess its just good practice anyways :<
Arnk Kilo Dylie - Tue Jan 11, 2011 2:01 pm
Post subject:
Using enums in function declarations instead of ints tends to make certain python integration things more headachy ;)

Of course that never stopped me.
Cheese - Fri Jan 14, 2011 3:22 am
Post subject:
what might cause this?


Dr Brain - Fri Jan 14, 2011 7:01 am
Post subject:
Posting all of your topics in a single thread.

Did you try recovering the database?
Cheese - Fri Jan 14, 2011 9:10 pm
Post subject:
how would i do that

it seems i am forced to do this, because now the module wont load
and i dont want to disable persist


been poking at this dbtool.exe
not seeing anything
Samapico - Sat Jan 15, 2011 12:21 am
Post subject:
That green/black theme suggests you know how to get things done.



And if you don't, hack in from a public telephone.
JoWie - Sat Jan 15, 2011 9:15 am
Post subject:
Try emptying the data directory, unless you keep track of anything critical using persist.
Cheese - Sat Jan 15, 2011 2:35 pm
Post subject:
that worked, but which file was corrupted?
how did it break?

whats the __db.00* 1-3, and whats the data.db?
JoWie - Sun Jan 16, 2011 5:26 am
Post subject:
Berkeley DB. Database library that is not relational and has no networking. It is, for example, where the player points (billing is never used for points) and ?stats go.

When you play around with asss a lot (and it crashes all the time) they can get corrupted. I've had this a few times and clearing the data directory is the easiest solution. If I recall correctly, hyperspace was down for 1.5 days due to this problem.

BDB has safeguards to prevent this kind of thing, but you need to use transactions to get the full extent of these safeguards.
Cheese - Mon Jan 17, 2011 2:55 am
Post subject:
is there a LLEmptyListAndData() that empties a list by deallocating each link and the data it points to?
but doesnt delete the list itself, just everything in it


or do i have to call a for_each ghetto style?
Dr Brain - Mon Jan 17, 2011 6:34 am
Post subject:
LLEnum(&list, afree);
LLEmpty(&list);
Cheese - Mon Jan 17, 2011 8:33 am
Post subject:
icon_eek.gif

elite
Samapico - Mon Jan 17, 2011 10:08 am
Post subject:
Interesting
Arnk Kilo Dylie - Mon Jan 17, 2011 2:46 pm
Post subject:
LLEnumNC(list, afree); for compile-warning reducing goodness.
Cheese - Tue Jan 18, 2011 11:05 pm
Post subject:
how do i set a player's koth crown?
and is it possible to make a crown never expire?

im looking at koth.c, but it seems to only use sendtoone()
how would the rest of the players know they got a crown?

it also used SET_HAS_CROWN(p), where is that defined?
Samapico - Sun Jan 30, 2011 11:48 am
Post subject:
Arnk Kilo Dylie wrote:
LLEnumNC(list, afree); for compile-warning reducing goodness.
It still gives a warning:


passing argument 2 of 'LLEnumNC' from incompatible pointer type
Arnk Kilo Dylie - Sun Jan 30, 2011 10:46 pm
Post subject:
True. I was under the mistaken impression that afree accepted void * instead of const void *, considering that freeing the data invalidates it. LLEnumNC would be good for functions that accept void * instead of const void *. So I had it backwards.
Cheese - Mon Jan 31, 2011 1:11 am
Post subject:
so if it warns u, just cast it and tell it to stfu
Dr Brain - Mon Jan 31, 2011 6:54 am
Post subject:
Cheese wrote:
so if it warns u, just cast it and tell it to stfu


No, if it warns you then use LLEnum instead.
Cheese - Mon Jan 31, 2011 1:26 pm
Post subject:
it might be compiler specific then, because it throws me warnings for llenumnc(afree) and compiles with 0 warnings with llenum(afree)



but what im wondering is why you would waste space on writing two literally identical functions when you could simply cast the pointer in the extremely rare case you would use a const?
isnt it just a waste of space in the file and a waste of space in the binary?
this has hack written all over it
Arnk Kilo Dylie - Mon Jan 31, 2011 2:08 pm
Post subject:
Four posts up I said
That I made an assumption
afree took nonconst

Your understanding
of compilers and constness
may be lacking some

Casting away const
Defeats the purpose of it
I am no expert
Cheese - Mon Jan 31, 2011 8:27 pm
Post subject:
waste of space is bad
redundant code is bad too
why not just cast it
Arnk Kilo Dylie - Mon Jan 31, 2011 9:17 pm
Post subject:
It's like you're reading
my posts but you're not reading
the contents of them
Dr Brain - Tue Feb 01, 2011 8:07 am
Post subject:
Is the guy who created a 7 page thread really trying to lecture us on a waste of space?

If the space is so important to you, remove all the whitespace and tabs. That'll save far more room. If the code size is important, try optimize for size (-Os). It really does wonders. You could also write your code in assembly.

Casting is never a good idea. If you've got to cast something, you're probably doing crazy stuff (like implementing OO in a non-OO language). Type safety is there for a reason.
Samapico - Tue Feb 01, 2011 9:08 am
Post subject:
Buuuuuuuuuuurn
Cheese - Tue Feb 01, 2011 10:22 am
Post subject:
7 page thread instead of 100 1 page threads?
space saved $

writing a second literally identical function simply because you dont 'like' casting is just silly, its like writing a bastardized set of nested loops with 100 variables simply because you think 1 goto is never acceptable

casting is rarely used, but its there for a reason
Dr Brain - Tue Feb 01, 2011 11:45 am
Post subject:
Yes, a 1 page thread would allow forum searching (not everything is about you, you know), and save page space, preventing everyone from reading the last few posts to get caught up on stupid topic #45.

Feel free to cast your non-const functions into const functions, but don't expect the rest of us to do it.

Oh, and there are plenty of good ways to write nested loops without gotos.
Arnk Kilo Dylie - Tue Feb 01, 2011 2:30 pm
Post subject:
Dr Brain wrote:

If you've got to cast something, you're probably doing crazy stuff (like implementing OO in a non-OO language).

akd_lag for the win!


cheese
this is the third time I've said this now
READ UP ON CONSTNESS.
just because you can cast doesn't mean it's the correct way to do things. const isn't just some annoying tag--it has a purpose and you are defeating that purpose by ignoring it. if it bothers you, just use LLEnumNC all of the time and you won't have to cast anything, you just won't be getting benefit from const.

the difference is
one function is for iterating with functions that don't change the buffer (with the special exception of freeing I guess)
the other one is for things that do change the buffer.
why is this important? read up on constness.


p.s. goto is fine but it should be a last resort. even asss does some out of laziness, but as long as you use it like a pro and not like a newbie you're not doing anything wrong.
Cheese - Tue Feb 01, 2011 7:07 pm
Post subject:
so what is this shipinfo.dat?

is it implemented in subgame? what about asss?
the wiki page says its an arena file, but i wouldnt think an arena file would affect the zone list

anyone have more info on this?
Dr Brain - Tue Feb 01, 2011 7:56 pm
Post subject:
It has nothing to do with asss or subgame. Try reading that entry more carefully. It says it can be included in the arena's levelfiles (i.e. alongside lvzs).
Cheese - Tue Feb 01, 2011 8:27 pm
Post subject:
so then every user would have to put that file in their directory?
is there another way to get it there?

and i dont see where the ship names (the top part) is used, where might that be used?
is it only for the * thing?



also:
what is the 'target' field in the esc+q>profiles page used for?
(its the one above 'chats')
Dr Brain - Tue Feb 01, 2011 9:01 pm
Post subject:
Cheese wrote:
is there another way to get it there?


Something besides levelfiles?

Cheese wrote:
and i dont see where the ship names (the top part) is used, where might that be used?


Esc menu perhaps.

Have you tried any of this yourself?
Cheese - Tue Feb 01, 2011 9:56 pm
Post subject:
yep, its the ingame esc menu

this is pretty cool, why dont any zones make use of this?
Samapico - Tue Feb 01, 2011 10:42 pm
Post subject:
I thought it only had to do with replacing the ship's image on the menu... didn't know about the descriptions, that's pretty neat.
JoWie - Wed Feb 02, 2011 4:14 am
Post subject:
shipinfo.dat and ships.bm2 are also used in the zone list if "custom zone ships" is enabled.
They can not be contained in a .lvz for this to work however
Cheese - Fri May 27, 2011 12:07 am
Post subject:
so im trying to compile the core from the repository on linux, and its not going very well

so what is the purpose of each of the following dirs?

asss
asss/dist
asss/test

which should be the home dir?
where should the bin, arenas and conf dirs be?
why is the directory structure completely different than the windows installation?
where is there a place that explains these things?

ive managed to get a somewhat bastardized version to compile and run, sort of, but it dies during module loading as follows:

Code: Show/Hide

/asss/scripts$ ./run-asss
*** ASSS started
asss 1.5.0 built at May 26 2011 20:57:38
Loading modules...
I <cmod> loading C module 'unixsignal' from 'internal'
I <cmod> loading C module 'deadlock' from 'internal'
I <cmod> loading C module 'prng' from 'internal'
I <cmod> loading C module 'logman' from 'internal'
I <cmod> loading C module 'mainloop' from 'internal'
I <cmod> loading C module 'config' from 'internal'
I <cmod> loading C module 'log_file' from 'internal'
I <cmod> loading C module 'playerdata' from 'internal'
I <cmod> loading C module 'lagdata' from 'internal'
I <cmod> loading C module 'bw_default' from 'internal'
I <cmod> loading C module 'net' from 'internal'
I <cmod> loading C module 'chatnet' from 'internal'
I <cmod> loading C module 'arenaman' from 'internal'
I <cmod> loading C module 'mapdata' from 'internal'
I <cmod> loading C module 'capman' from 'internal'
W <config> Can't find file for arena '(null)', name 'groupdef/mod.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/smod.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/sysop.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/sysop.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/mine.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/default.txt'
I <cmod> loading C module 'mapnewsdl' from 'internal'
I <cmod> loading C module 'core' from 'internal'
I <cmod> loading C module 'clientset' from 'internal'
I <cmod> loading C module 'persist' from 'scoring'
db_env_create: Permission denied
E <cmod> error loading module 'persist'
Unrecoverable error (5): Error in loading module 'scoring:persist'
*** ASSS exited: Error loading modules


JoWie - Fri May 27, 2011 6:08 am
Post subject:
The directory structure also looks like that on windows.
If someone makes a release they compile it and move the contents of dist/ one directory up.
If you download a linux tarball you will see the same directory structure as you are used to

test/ is just a bunch of random code used to develop complex code isolated from the bigger application.
Dr Brain - Fri May 27, 2011 6:40 am
Post subject:
The idea is that you symlink the asss/bin directory into a zone directory structure. asss/dist has the directory structure, so you can run it from there, but I'd recommend making a new one (outside asss) so you don't get conflicts when updating the repository.
Cheese - Sun May 29, 2011 2:01 am
Post subject:
i found out why persist wasnt loading, i had copied the old data folder from a win32 system.
i made a new empty data folder, and it worked

however, it now dies trying to load the security module as follows:
Code: Show/Hide

E <cmod> can't find file: security
Unrecoverable error (5): Error in loading module 'security:security'
*** ASSS exited: Error loading modules


...so its looking like security.so isnt included?
and theres no source files, so its not going to be built either?
is it supposed to be the scrty files?

and im still getting this during load, even though the files exist in conf/groupdef:
Code: Show/Hide

I <cmod> loading C module 'capman' from 'internal'
W <config> Can't find file for arena '(null)', name 'groupdef/mod.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/smod.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/sysop.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/sysop.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/mine.txt'
W <config> Can't find file for arena '(null)', name 'groupdef/default.txt'
I <cmod> loading C module 'mapnewsdl' from 'internal'


my dir structure looks like this atm:
Code: Show/Hide

/asss$ ls
arenas  bin  build  clients  conf  data  dataOLD  dist  doc  log  lvz  maps  news.txt  scripts  scrty  scrty1  src  test  tmp


would i be getting these errors because im doing /asss$ cd scripts/ and then doing /asss/scripts$ ./run-asss?
because if i try to do /asss$ scripts/run-asss it dies with the generic
"This directory doesn't look like a valid zone directory."
Dr Brain - Sun May 29, 2011 8:14 am
Post subject:
See here: http://forums.minegoboom.com/viewtopic.php?t=8850

Also, edit scripts/run-asss to have the right path for your asss directory.
Cheese - Sun May 29, 2011 10:44 am
Post subject:
already saw that, does this mean that it doesnt exist yet?


it runs now, but it does lots of fun stuff, like this:
W <mapnewsdl> news file 'news.txt' not found in current directory
W <config> Can't find file for arena '(public)', name 'conf/cfg/highlag.conf'
W <mapnewsdl> {0} can't load level file, falling back to tinymap.lvl


also, for lulz, i wrote this, which noone else has bothered to write for some reason:
http://wiki.minegoboom.com/index.php/Installing_ASSS_on_Linux
Dr Brain - Sun May 29, 2011 3:56 pm
Post subject:
Pretty much everything you wrote there is wrong. Just FYI. Afraid I don't have time to correct it, though. First two steps are ok. Last step is ok, minus the cp part.
Cheese - Mon May 30, 2011 12:10 am
Post subject:
theres nothing to correct, all steps are required
half the files are in the dist folder
there is no security.so
there is no scoring.so, and the stuff is commented out in the repository modules.conf

nothing is wrong, thats what it takes to get it running










also, my file structure is exactly the same as my other machine and yet on linux im trying to figure out why its not finding my maps and etc
in an arena.conf i have:
#include conf/cfg/highlag.conf
General:Map=maps/map.lvl
its not finding either
Dr Brain - Mon May 30, 2011 6:53 am
Post subject:
Code: Show/Hide

If installed, you should find the locations of your Python, MySQL, and other dependencies before you begin.


BDB?

Code: Show/Hide

First, you need to clone the files from the ASSS repository.

    hg clone https://bitbucket.org/grelminar/asss ../asss



Fine, except possibly the .. part.

Code: Show/Hide

Then, after the files have transferred, you will need to build the program files from source code.

    cd src
    mv system.mk.dist system.mk


Misleading, but ok.

Code: Show/Hide


If you have Python or MySQL installed, you must point the compiler at them.

    vim system.mk


What about BDB?

Code: Show/Hide

Find the following lines and change them to their respective locations

    MYSQL_HOME = /opt/mysql
    PYTHON_HOME = /usr


and DB_HOME?

Code: Show/Hide


If you do NOT have Python or MySQL installed, you must comment out the following lines, by adding a # in front of them:

    have_bdb := yes
    have_mysql := yes
    have_python := yes


What about BDB?

Code: Show/Hide


Then build the files.

    make


Fine.

Code: Show/Hide

You will then get to watch a nice wall of spam.
Because the developers wanted to be able to update everything on a server already running ASSS, you must now copy all the files into their proper locations.

    cd dist
    mv arenas ../arenas
    mv clients ../clients
    mv conf ../conf
    mv maps ../maps
    mv news.txt ../news.txt
    mv scrty ../scrty
    mv scrty1 ../scrty1



Wrong on every level. Did you completely ignore what I wrote about symlinking bin/ into a directory structure?

cp -R dist ~/my_zone
ln -s bin ~/my_zone (may need tweaking, I don't have a linux box to test with)

Code: Show/Hide

Since the security module does not exist yet, you will have to go into modules.conf

    comment out security:security
    comment out security:enc_cont
    uncomment enc_null


Also misleading, but ok.

Code: Show/Hide


Since the scoring module apparently does not exist yet, you will have to copy scoring.so from a preexisting server into your bin directory.

    new server owners are screwed
    all scoring:* are already commented out
    hope you don't like points


Either you missed a compile error, or you intentionally disabled the scoring module by disabling have_bdb. Either way, don't blame us for it.

Code: Show/Hide


Update ASSSHOME with the path to your ASSS root directory.

    cd scripts
    vim run-asss


path is wrong, since you totally screwed up your directory.

Code: Show/Hide

For ease of access, you may want to move the run-asss script to the root directory.

    mv run-asss ../run [optional, update ASSSHOME]


Again, you've screwed up your directory structure.
JoWie - Mon May 30, 2011 8:30 am
Post subject:
This is what I do on ubuntu (just tested this on ubuntu server 10.10 x86_64):

$ sudo apt-get install build-essential python python-dev mercurial libdb4.8-dev mysql-client libmysqlclient-dev gdb nano

$ 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

$ uname -m
Place the 32 or 64 bit security.so 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.

The run-asss script can also be useful (needed for ?recyclezone, etc):
$ cp ~/asss-trunk/scripts/run-asss ~/zone/run-asss
$ nano ~/zone/run-asss
Change line 6 to:
Code: Show/Hide

ASSSHOME=$HOME/zone

$ chmod +x ~/zone/run-asss

If you are using a ssh terminal you may want to run it using:
$ nohup ~/zone/run-asss &
Cheese - Mon May 30, 2011 8:46 am
Post subject:
point is, i can see why so few people are running this




Dr Brain wrote:

Either you missed a compile error, or you intentionally disabled the scoring by disabling have_bdb


nope, nope, and nope
perhaps its just disabled by default
JoWie - Mon May 30, 2011 8:51 am
Post subject:
You only need to do this if you want the latest trunk version.

You could just download the latest release, unzip it and run it. no compiling needed.
Cheese - Mon May 30, 2011 9:16 am
Post subject:
didnt he release non-rc 1.5.0 somewhere? :<

so should i just dl a copy, pirate the security.so, and then delete everything?

edit: nope, that just gives this:
Code: Show/Hide

I <cmod> loading C module 'security' from 'security'
Illegal instruction
*** ASSS exited: Got signal 4, restarting...


edit2: was bored so tried the 32bit version too for lulz
Code: Show/Hide

I <cmod> loading C module 'security' from 'security'
E <cmod> error in dlopen: asss/bin/security.so: wrong ELF class: ELFCLASS32
Unrecoverable error (5): Error in loading module 'security:security'
*** ASSS exited: Error loading modules

JoWie - Mon May 30, 2011 9:32 am
Post subject:
Are you sure you downloaded the correct architecture? (32 / 64 bit)
"uname -a" may help
Cheese - Mon May 30, 2011 9:35 am
Post subject:
yep
made sure of it too
see above


also doesnt this makefile do make deps automatically when u do make?
JoWie - Mon May 30, 2011 10:07 am
Post subject:
if I recall correctly, you need to run make deps any time you add/remove a source/make file.

What distro are you using? Post "uname -a" and "cat /etc/*-release"
Cheese - Mon May 30, 2011 10:40 am
Post subject:
Linux li124-244 2.6.38-x86_64-linode17 #1 SMP Thu Apr 28 22:18:47 UTC 2011 x86_64 GNU/Linux

cat: /etc/*-release: No such file or directory
JoWie - Mon May 30, 2011 10:58 am
Post subject:
Try
$ echo /etc/*_ver* /etc/*-rel*; cat /etc/*_ver* /etc/*-rel*
Cheese - Mon May 30, 2011 11:02 am
Post subject:
apparently debian 6.0.1
lol
Cheese - Tue May 31, 2011 12:00 pm
Post subject:
so i found out that a lot of these problems were being caused by a permissions error that somehow occurred during the server migration

basically i had to go through the entire file structure and chmod the broken stuff, so most of the missing file stuff is solved


however, the zone still cant find the maps, which i want to keep in asss/maps, and in each arena.conf i have general:map=maps/map.lvl, but it cant find the map despite it being in the proper location
JoWie - Tue May 31, 2011 12:49 pm
Post subject:
Are you sure the working directory is correct? (should not be asss/bin)
Cheese - Tue May 31, 2011 3:47 pm
Post subject:
how would i find that out?

im running the script from the asss directory with assshome=.
JoWie - Tue May 31, 2011 4:49 pm
Post subject:
That script should always set the working directory correctly.

Are you sure all the permissions are correct?
you could try something like:
Code: Show/Hide

sudo chown youruser:youruser -R ~/zone
find ~/zone -type d -exec chmod u=rwx,go=rx {} \;
find ~/zone -type f -exec chmod u=rw,go=r {} \;
chmod u+x ~/zone/bin/asss
chmod u+x ~/zone/run-asss

youruser is whatever user asss runs under (not root)

What happens if you attempt to ?getfile the map? Use the same path as you put in the config.
Cheese - Tue May 31, 2011 5:13 pm
Post subject:
i remember i had to chmod the maps, so they should be working

i assume directories should be drwxr-xr-x (755) and files should be -rw-r--r-- (644)?



also @ dr brain:
it seems that the auto build script makefile thingy automatically made everything in asss/bin into a symlink to asss/build and asss/src/py or something
Samapico - Tue May 31, 2011 5:30 pm
Post subject:
Cheese wrote:
however, the zone still cant find the maps, which i want to keep in asss/maps, and in each arena.conf i have general:map=maps/map.lvl, but it cant find the map despite it being in the proper location
You don't need to add the 'maps' part of the path in that particular case.
general:map = yourmap.lvl should work fine, even if the file is in maps\
LVZ files can also be in there
Dr Brain - Tue May 31, 2011 5:40 pm
Post subject:
Cheese wrote:
also @ dr brain:
it seems that the auto build script makefile thingy automatically made everything in asss/bin into a symlink to asss/build and asss/src/py or something


Was that a question?
Cheese - Tue May 31, 2011 6:06 pm
Post subject:
no?



ok weird i had to do more chmod stuff, and then maps/lvz started working
now i just have to wait for 64 bit security module and then i have a fully functional zone :D
Cheese - Sat Jun 11, 2011 10:14 pm
Post subject:
so if someone compiles a .dll module, will it be able to be used by asss on a linux system, even if theyre both 32bit or 64bit machines?


if not, how can someone compile a .so file in an IDE that does .dll files?
JoWie - Sun Jun 12, 2011 7:08 am
Post subject:
dll is windows only and only works on the correct architecture. It is possible to run 32 bit dll's on 64bit, but only if asss is also 32bit.

Cross compiling linux on windows is possible, but I do not think it is worth the effort. It would involve getting the linux kernel source, building glibc yourself, building GCC yourself, etc.

I would just upload the sources to your server and hit "make" or use a VM. The .so is then found in build/
Of course you could configure your IDE to automate this, SSH into your server/VM, upload, build, download the .so
Cheese - Mon Jul 18, 2011 3:06 pm
Post subject:
so what would cause this backtrace:

Code: Show/Hide

#3  0x000000000045f807 in handle_sigsegv ()
No symbol table info available.
#4  <signal handler called>
No symbol table info available.
#5  0x000000000041f1b1 in lookup_sparse ()
No symbol table info available.
#6  0x0000000000420e52 in FindEmptyTileNear ()
No symbol table info available.
#7  0x00007f93b402a74d in newflag ()
   from asss/bin/flags.so


from this code:
Code: Show/Hide

local Imapdata *map;
      map->FindEmptyTileNear(a,&fi.x,&fi.y);


because you would think that code compiled using gcc that compiled successfully on windows would also compile using gcc elsewhere, especially not using any windows-only code...

so why is mapdata segfaulting?
JoWie - Mon Jul 18, 2011 6:18 pm
Post subject:
The cause could have been much earlier on.
For example if you have a module which accidentally writes stuff to memory it is not supposed to. (I had this once when I accidentally left the player data key to -1).

Have you tried recompiling with full debug symbols?
Does it always crash in the same place, or does it differ?
Does the crash seem to be caused by a specific timing of things (is it hard to reproduce) ?
Try commenting out non standard modules until the crash goes away.
Cheese - Mon Jul 18, 2011 7:13 pm
Post subject:
the code compiles, runs, and otherwise operates flawlessly on windows
all im doing is recompiling on linux

crashes in the same spot every time
Arnk Kilo Dylie - Mon Jul 18, 2011 10:02 pm
Post subject:
Value of a?
Value of fi.x? Value of fi.y?
...When is it being called?
More code required to give an answer.


When things crash when changing platforms I'd wager it's bad code that just wasn't poking illegal memory on a different platform.
Cheese - Wed Jul 20, 2011 8:32 pm
Post subject:
so what is lookup_sparse() and why cant i find sparse.inc anywhere
















so why doesnt the flag core pass turf flag coords instead of -1,-1 when it sends flagonmap after a flag touch?
that seems silly
>_>








everything looks fine, but my best guess is that its somewhere in here, maybe that im declaring fi and then sending it by reference, and maybe getflags is messing with it somehow:


Code: Show/Hide


   FlagInfo fi;
   fi.x=x;
   fi.y=y;
   if(old) flag->GetFlags(a,fid,&fi,1);
   fi.state=FI_ONMAP;
   if(carried) fi.state=FI_CARRIED;
   fi.freq=freq;
   fi.carrier=p;
//printf: a=31305840 &fi.x=-1619391424 &fi.y=-1619391420 fi.X=147456 fi.Y=0
x=-1 y=-1
      map->FindEmptyTileNear(a,&fi.x,&fi.y);


the arena is legit, its being sent -1,-1, and something is wrong with either &fi or fi.x or fi.y
Dr Brain - Sat Jul 23, 2011 10:31 pm
Post subject:
sparse.inc is built by a python script. Look at the build scripts for further info, but it's a good bet that it shows up in your build dir during compilation.

But the fact that you're getting negative flag coordinates in your algorithm should be your top concern.
Cheese - Sun Jul 24, 2011 12:06 am
Post subject:
which is why i was wondering why the flagcore module, a core module, sends -1,-1 as coordinates when turf is enabled...
this shouldnt even matter, let alone crash the entire zone, when dealing with turf flags, where only the freq matters

my thoughts are that I have these defines:
#define NEUT_FREQ -1
#define NULL_POS -1
and that I am updating the flag data with NULL_POS instead of first getting the flag's previous location, and then sending -1 to map->FindEmptyTileNear(), which can't handle -1 and kills everyone


i really wonder why every single turf flag is initialized by the flag core at -1,-1 despite me sending it a completely valid location every single time, it really is quite ridiculous =/

in flagcore.h:
DO_CBS(CB_FLAGONMAP, a, FlagOnMapFunc, (a, fid, -1, -1, ofi->freq));



what i cant figure out is why code that is completely platform independent would cause a core module to segfault while on a linux platform
JoWie - Sun Jul 24, 2011 8:23 am
Post subject:
Continuum assigns turf flag id's based on the map location. So just use that to make a flagcore patch
Dr Brain - Sun Jul 24, 2011 3:00 pm
Post subject:
It's probably failing on both, you just aren't accessing memory outside your segment on one, because of differences in what's in memory adjacent to the sparse array.

That's my best guess, anyway.
Cheese - Sun Jul 24, 2011 5:52 pm
Post subject:
in case you were curious, this is the flags.c in here

im looking through the code for any problems, and i am simply not finding any
i had to trace through 3 different modules just to get here, and this is also keeping distension from getting up and running, through 1 call to flags->TurfFlagFreq(a,0,NEUT_FREQ);
Cheese - Sat Jul 30, 2011 2:27 am
Post subject:
so anyways, i got bored yesterday and wrote a chatnet client, using this as a reference

seemed not to work for a long time before i discovered that it used TCP and not UDP.
so then it started working again, sent LOGIN, got LOGINOK, and then sent "GO:\n"
this works for every zone, but the problem is that [strike]nothing is ever sent back after that[/strike], even after sending fun things like GO:1 or GO:abc

it doesnt send anything back except things like "NOOP\nOK:Cheese" instead of just "NOOP" or anything else its supposed to send

what am i missing here?
Cheese - Mon Aug 01, 2011 2:46 am
Post subject:
question 2:

so im trying to write a batch file for windows
is there any way to get the directory of the file which has been dragged onto it?
like how do i take the file.txt off of /a/b/c/file.txt?
JoWie - Mon Aug 01, 2011 3:55 am
Post subject:
Cheese wrote:
question 2:

so im trying to write a batch file for windows
is there any way to get the directory of the file which has been dragged onto it?
like how do i take the file.txt off of /a/b/c/file.txt?


Seriously? http://lmgtfy.com/?q=windows+batch+pass+arguments %~dp1
Cheese - Mon Aug 01, 2011 11:33 am
Post subject:
clearly you didnt read the third line
JoWie - Mon Aug 01, 2011 12:34 pm
Post subject:
Cheese wrote:
clearly you didnt read the third line

Yes I did, it is in my answer: %~dp1
Cheese - Tue Aug 02, 2011 12:31 am
Post subject:
awesome thanks for the tip
http://ss64.com/nt/syntax-args.html
Cheese - Wed Aug 03, 2011 3:14 am
Post subject:
also, turns out i was receiving things like "NOOP\n" written over "LOGINOK" because for some reason sprintf wasnt putting nulls on the end like it should have while i was reusing buffers, so now i have to send and receive everything like "NOOP\n\0"





also, what are the restrictions on the sound files that continuum can play?
does it differ per file, like victory music?
what bit rate?
what sample rate?
mono/stereo?
8bit? 16? 32?
Dr Brain - Wed Aug 03, 2011 7:30 am
Post subject:
sprintf in C is guaranteed to print a null character. Same with snprintf.

EDIT: at least all the documentation I can find online backs this up. If you can find documentation that doesn't, I'd be very interested to see it.
Cheese - Thu Aug 04, 2011 4:23 am
Post subject:
yeah, thats what i was reading everywhere, and i couldnt figure out why my otherwise flawless code wasnt running
i figured the only way i could be getting the results i was was that i needed to manually add \0, and once i did everything started working properly...


also:
so why does chatnet send Player1\nPlayer2\n\0 on 1 line instead of one per line when you enter an arena?
thats pretty dumb



edit:
i was using this for the endline business for awhile
char* nl=strchr(rbuf,'\n'); *nl=0;

and then later i had quite forgotten about something that turned to be amazing, something which i had used so often and later discarded for something better, something that works perfectly for chatnet clients in C:
STRTOK! \o/
JoWie - Thu Aug 04, 2011 5:50 am
Post subject:
Dr Brain wrote:
sprintf in C is guaranteed to print a null character. Same with snprintf.

EDIT: at least all the documentation I can find online backs this up. If you can find documentation that doesn't, I'd be very interested to see it.


Visual Studio:
http://msdn.microsoft.com/en-us/library/ybk95axf%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/2ts7cx93%28v=vs.71%29.aspx
JoWie - Thu Aug 04, 2011 5:59 am
Post subject:
Cheese wrote:

also:
so why does chatnet send Player1\nPlayer2\n\0 on 1 line instead of one per line when you enter an arena?
thats pretty dumb


Hint: asss has nothing to do with that, and it does not send you a \0
Dr Brain - Thu Aug 04, 2011 8:12 am
Post subject:
Yes, sprintf is guaranteed to print a null character. _snprintf (notice the n) is a MS thing and doesn't conform to the standard snprintf which does always print a null.

Cheese, do you realize that \n means a new line? You can't have that string all one one line, because it's several lines.
JoWie - Thu Aug 04, 2011 8:42 am
Post subject:
Dr Brain wrote:
Yes, sprintf is guaranteed to print a null character. _snprintf (notice the n) is a MS thing and doesn't conform to the standard snprintf which does always print a null.


Yea, VS does not have snprintf. But a common mistake is that people use #define snprintf _snprintf
Dr Brain - Thu Aug 04, 2011 2:12 pm
Post subject:
Cheese has been talking about sprintf the whole time, so I don't think that's his issue. But if it is, I guess that should be a lesson about reading the documentation.
Cheese - Mon Aug 08, 2011 10:27 pm
Post subject:
so what characters are allowed in player names?
letters, numbers, and what else?
Cheese - Mon Aug 22, 2011 11:31 am
Post subject:
does anyone actually know how to use ToggleSet() in objects.c correctly?
I can't find source code that uses this anywhere.

I used this, which seems to work on windows, but not on linux:

Code: Show/Hide


   Target t;
   t.type=T_ARENA;
   t.u.arena=a;
   
   int top0=0;
   int top1=0;
   int topempty=0;
   int bottom0=0;
   int bottom1=0;
   int bottomempty=0;
   int hold0=0;
   int hold1=0;
   
   short ids[]={LVZ_TOPBASE_ARMY0,LVZ_TOPBASE_ARMY1,LVZ_TOPBASE_EMPTY,LVZ_BOTBASE_ARMY0,LVZ_BOTBASE_ARMY1,LVZ_BOTBASE_EMPTY,LVZ_SECTOR_HOLD_FREQ0,LVZ_SECTOR_HOLD_FREQ1};
   char states[]={top0,top1,topempty,bottom0,bottom1,bottomempty,hold0,hold1};
   obj->ToggleSet(&t,ids,states,sizeof(ids)/sizeof(ids[0]));


this piece of code works on windows machines, but seems to segfault on linux machines at core/objects.c:686
JoWie - Mon Aug 22, 2011 2:39 pm
Post subject:
Code: Show/Hide

short ids[64];
char ons[64];

ids[0] = 5000; ons[0] = 1;
ids[1] = 5001; ons[1] = 1;
ids[2] = 5002; ons[2] = 1;
ids[3] = 5003; ons[3] = 1;

objs->ToggleSet(&tgt, ids, ons, 4);

Cheese - Mon Aug 22, 2011 5:31 pm
Post subject:
but why does the prototype have char in it? :(
void (*ToggleSet)(const Target *t, short *id, char *ons, int size);



these didnt work either

Code: Show/Hide


   short ids[8];
   ids[0]=LVZ_TOPBASE_ARMY0;
   ids[1]=LVZ_TOPBASE_ARMY1;
   ids[2]=LVZ_TOPBASE_EMPTY;
   ids[3]=LVZ_BOTBASE_ARMY0;
   ids[4]=LVZ_BOTBASE_ARMY1;
   ids[5]=LVZ_BOTBASE_EMPTY;
   ids[6]=LVZ_SECTOR_HOLD_FREQ0;
   ids[7]=LVZ_SECTOR_HOLD_FREQ1;
   short states[8];
   states[0]=top0;
   states[1]=top1;
   states[2]=topempty;
   states[3]=bottom0;
   states[4]=bottom1;
   states[5]=bottomempty;
   states[6]=hold0;
   states[7]=hold1;
   obj->ToggleSet(&t,ids,states,8);


   // short ids[]={LVZ_TOPBASE_ARMY0,LVZ_TOPBASE_ARMY1,LVZ_TOPBASE_EMPTY,LVZ_BOTBASE_ARMY0,LVZ_BOTBASE_ARMY1,LVZ_BOTBASE_EMPTY,LVZ_SECTOR_HOLD_FREQ0,LVZ_SECTOR_HOLD_FREQ1};
   // short states[]={top0,top1,topempty,bottom0,bottom1,bottomempty,hold0,hold1};
   // obj->ToggleSet(&t,ids,states,sizeof(ids)/sizeof(ids[0]));

JoWie - Mon Aug 22, 2011 6:45 pm
Post subject:
typo, i edited my post.

anyways i have used that function a lot, i've never had a crash.

line 686 tells you something went wrong much earlier on.
maybe a corrupted lvz, or you are using toggleset really early in the arena creation and the thread locking or whatever messes up
Samapico - Mon Aug 22, 2011 6:59 pm
Post subject:
Cheese wrote:
but why does the prototype have char in it? icon_sad.gif
... just use a char array and put 0 or 1, don't use 'short's for the state
Cheese - Tue Dec 13, 2011 2:47 pm
Post subject:
when im in another zone and i do ?find player, and that player is located in an asss zone, what file handles reporting to the biller/me the zone name?
Dr Brain - Tue Dec 13, 2011 9:54 pm
Post subject:
I don't believe that the request goes to the target's zone at all. The biller knows where all the logged in players are, and so just supplies the name of the zone to the player issuing the ?find command.
Cheese - Thu Dec 15, 2011 4:00 pm
Post subject:
what does objects->Image() do?
is it supposed to send a packet to the client telling it that the lvz thing is changing from one picture to a different one?

additionally, im trying to move around a lvz picture, by using
lvz->Move(&tgt,num,srcx*16,srcy*16,0,0);
lvz->Toggle(&tgt,num,1);
they appear, but they dont appear to be going anywhere...
Anonymous - Sat Dec 17, 2011 6:56 am
Post subject:
Help on '?objimage':
Targets: any
Args: <id> <image>
Change the image associated with an object id.
Object commands: ?objon ?objoff ?objset ?objmove ?objimage ?objlayer ?objtimer ?objmode ?objinfo ?objlist

Looks like it sets the image id like in a lvz, and you can also change the layer and mode and all the other stuff on the fly.
Cheese - Tue Jan 17, 2012 1:26 am
Post subject:
so if i draw a region in one spot, and a region with the same name in another spot, is there a way to iterate through each separate box?
Dr Brain - Tue Jan 17, 2012 6:58 am
Post subject:
There is no concept of a box, even. What are you trying to do?
JoWie - Tue Jan 17, 2012 8:13 am
Post subject:
Regions are not kept in memory in such a way that makes such a thing easy.

Regions are kept in the same way as tiles:
A spare matrix that effectively means you can do tiles[tile x][tile y] = tile id;
Sparse means 0 values are not stored.

In regions it looks like
regions[tile x][tile y] = region id (u8);
If regions overlap, you get another region id. So one region may have multiple id's

So if you want to retrieve a "box" of a region, you would have to go about it in the same way as retrieving a "box" of wormholes.
Cheese - Thu Apr 05, 2012 2:59 am
Post subject:
Code: Show/Hide

asss 1.5.0 built at Jul 20 2011 21:20:59


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1b71700 (LWP 28580)]
0x00000000004358fa in cleanup (p=0x6ede70, a=0x6ef680, reason=2) at core/flagcore.c:105
105                     if (ad->fis[i].state == FI_CARRIED &&
(gdb) l
100             adata *ad = P_ARENA_DATA(a, adkey);
101
102             LOCK();
103             ad->during_cleanup = TRUE;
104             for (i = 0; i < ad->count; i++)
105                     if (ad->fis[i].state == FI_CARRIED &&
106                         ad->fis[i].carrier == p)
107                     {
108                             ad->fis[i].state = FI_NONE;
109                             ad->fis[i].carrier = NULL;
(gdb)

(gdb) bt
#0  0x00000000004358fa in cleanup (p=0x6ede70, a=0x6ef680, reason=2) at core/flagcore.c:105
#1  0x0000000000436d36 in shipfreqchange (p=0x6ede70, newship=8, oldship=0, newfreq=9999, oldfreq=0) at core/flagcore.c:469
#2  0x000000000042e742 in SetShipAndFreq (p=0x6ede70, ship=8, freq=9999) at core/game.c:958




i think i found a bug in the flag core
so what would cause this?
only thing i can think of is that fis is bad
Cheese - Fri Jul 26, 2013 12:13 pm
Post subject:
so i had the idea of changing the way how the asss core loads modules, in hopes to resolve circular references in interfaces


proposed process:
a MM_PRELOAD call for all modules at program start, only legal actions in this is reg_interface()
after this all modules have interfaces up
then MM_LOAD call is made
all modules then call get_interface()

downside:
all modules would have to check on each interface function if itself is loaded if a dependency is missing or noop

anyone see any problems with this?
would this work?
it seems (deceptively?) easy to implement
if this gets put in, module load order wouldnt matter at all
Cheese - Fri Jul 26, 2013 2:59 pm
Post subject:
alternative idea:


10 pass MM_LOAD, all modules keep track of interface count, then report success in MM_AFTERLOAD, otherwise unload themselves
Dr Brain - Sun Jul 28, 2013 7:37 am
Post subject:
Cheese wrote:
anyone see any problems with this?


Every single module ever written would have to be modified. That's a pretty big problem.
Cheese - Sun Jul 28, 2013 1:22 pm
Post subject:
not significant compared to a permanent future of having to deal with shit
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group