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

Server Help | ASSS Wiki (0) | Shanky.com
It would be great to...

 
Post new topic   Reply to topic Printable version
 View previous topic  Objects Post :: Post S2C Packet 0x02 Extension: Arena name  View next topic  
Author Message
Bak
?ls -s
0 in


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

PostPosted: Tue Aug 02, 2005 9:15 pm    Post subject: It would be great to... Reply to topic Reply with quote

It would be great to be able to allocate per player or per arena data with an arena paramenter. One use would be saving space by only allocating memory for arenas where a module is attached, so a subarena with a few hundred bytes of player data doesn't have to allocate that much for every player. It would complicate the way data is stored, but I'm sure there's a way to do it. Also if net could have an arena paramenter on AddPacket and RemovePacket that would be good, so I don't have to allocate arena data to tell me whether the module is attached or not.
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Tue Aug 02, 2005 10:12 pm    Post subject: Reply to topic Reply with quote

Memory is cheap. Don't fret over it. A few hundred bytes is a drop in an ocean.

As for the attached thing, it might just be simpler to get a function in the module manager. Something along the lines of

Code: Show/Hide

mm->IsAttached("mymodule", arena);


because net packets aren't the only time you want to check if you're attached.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Aug 03, 2005 10:23 am    Post subject: Reply to topic Reply with quote

Dr Brain wrote:
Memory is cheap. Don't fret over it. A few hundred bytes is a drop in an ocean.

Still, there's not point in wasting it.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Wed Aug 03, 2005 5:23 pm    Post subject: Reply to topic Reply with quote

The whole point of the per-arena/per-player data stuff is specifically to avoid separate allocation, so there's no way they'll be changed to do this. What you can do, though, is to allocate room for a pointer to your private data in the per-arena space, and then allocate a larger chunk of space manually. E.g.:

Code: Show/Hide
typedef struct my_adata { ... } my_adata;
int MM_foo(...) {
  if (action == MM_LOAD) {
    adkey = aman->AllocateArenaData(sizeof(my_adata *));
  } else if (action == MM_ATTACH) {
    my_adata **adp = P_ARENA_DATA(arena, adkey);
    *adp = amalloc(sizeof(**adp));
  } else if (action = MM_DETACH) {
    my_adata **adp = P_ARENA_DATA(arena, adkey);
    afree(*adp);
  }
  ...
}


Then you can check whether the pointer in the arena data is null or not to see if you're attached to the arena.

Note that this is described in the developer guide, section 5.4.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

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


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

phpBB Created this page in 0.687077 seconds : 26 queries executed (96.8%): GZIP compression disabled