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
ASSS vs Python(bugs) vs C++ vs merv vs TWCore vs Java
Goto page Previous  1, 2
 
Post new topic   Reply to topic Printable version
 View previous topic  Making a DLL with multiple classes? Post :: Post Finished  View next topic  
Author Message
Gus.
Seasoned Helper


Age:37
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 166
Location: Colorado
Offline

PostPosted: Sun Dec 11, 2005 5:33 pm    Post subject: Reply to topic Reply with quote

Once someone makes a decent point that gives TWCore a reason to be in the battle i will edit him in.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Bak
?ls -s
0 in


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

PostPosted: Sun Dec 11, 2005 5:50 pm    Post subject: Reply to topic Reply with quote

java is easy to code in
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Mon Dec 12, 2005 12:29 am    Post subject: Reply to topic Reply with quote

Its the only java core that has bots already developed.
_________________
There are 7 user(s) ignoring me right now.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Mon Dec 12, 2005 2:49 am    Post subject: Reply to topic Reply with quote

Bak wrote:
pythons limitations are that you can't create interfaces with it and it only supports a (large) subset of the functions you can use in C. And there are workarounds for the functions it doesn't support.

In one example I wanted to perform an action whenever a player fired a bomb. ... The solution (hack) I came up with was to, rather than recompile pymod with a new callback, use a c module to perform the necessary logic, and issue a callback python can use (I chose CB_CHATMSG with a unique mode that identified this as a bomb callback (normalled CB_CHATMSG uses modes 0-12, so I used 13)).


This should really be in another section, but oh well.

I am indeed disgused by that hack. You're already compiling another C module, so why not write up a little header file for the callback you want to define, stick it in some directory, and then rebuild pymod to pick up the new definition? I realize that procedure is annoying, and far from optimal, but surely it's better than overloading another callback like that.

Anyway, I might as well use this opportunity to get some feedback on my ideas. My solution for this particular problem would be something along these lines: you'd write a header file (foo.h) with pycb and pyint declarations, just like the standard ones, but then you'd run pymod-process on it (actually, you'd write a makefile rule to do it), and it would generate a new module: pyglue_foo, that when loaded, would provide python code access to your new callbacks and interfaces. The difference would be that you don't have to recompile pymod yourself. The downside is that there's an extra module to deal with. It might be possible to add some extra magic to auto-load that module whenever it's needed. Of course, then there's extra magic to deal with.

Unfortunately, because of how the python interface is currently structured, there's not much hope for exposing new callbacks and interfaces between C and python without writing a header file, generating some code, and compiling it into a module. That module might not be pymod itself, though. On the bright side, there's considerably more hope for callbacks/interfaces that go between python modules only, not touching C.

Comments? Questions?

By the way, it wouldn't be that hard to add support for real packet callbacks to python. I haven't done it because of efficiency concerns (I don't want python in the fast path for position packets), and because I was hoping to keep the interface higher-level. That is, it should be possible to do everything you would want to do without handling raw packets in python, although it may require creating more callbacks, like a general position packet callback. I think I'd rather do that, then expose raw packets. So if a position packet callback would be useful, please request that too.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


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

PostPosted: Mon Dec 12, 2005 4:33 am    Post subject: Reply to topic Reply with quote

I would like a player position callback.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Mon Dec 12, 2005 10:45 am    Post subject: Reply to topic Reply with quote

I would like you to stop using multiple identifiers for the same purpose.

IE:
- ? and * for the same commands
- Char 10 and 13 for packet delimiters in chatnet.


=(
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Muskrat
Server Help Squatter


Age:38
Joined: Aug 24 2004
Posts: 829
Location: Swamp
Offline

PostPosted: Mon Dec 12, 2005 12:05 pm    Post subject: Reply to topic Reply with quote

* is only used in the sgcompat module...
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Tue Dec 13, 2005 3:31 pm    Post subject: Reply to topic Reply with quote

Bak: Ok, I noted it as a feature request. But no comments about the other stuff? You're allowed to say "both of those options suck" (although that doesn't mean anything will change).

Cerium:
If I could get rid of * for commands, I would, but that's a question of backwards compatibility.

As far as chatnet delimiters, I consider that an instance of the well-accepted principle of network communications: be liberal in what you accept, be conservative in what you produce. asss itself will always produce line feeds (10s), so that's all you have to accept, if you want. And you can write your code to produce just line feeds also. Overall, no more complex code than if I just picked one.

And accepting both means I can telnet to the chatnet port, log in, and hold a conversation, without any client.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Bak
?ls -s
0 in


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

PostPosted: Tue Dec 13, 2005 3:43 pm    Post subject: Reply to topic Reply with quote

Adding real packet support would be useful, if it's not too hard to do. Although for something like player position packets it would slow down the execution significantly, the capability could be useful for other packets. I would suggest putting a note near the function that says to use it conservatively in python and a short reason. Let the programmer shoot themselves in the foot if they want to.

As for the pyglue solution, it's better than recompiling pymod, but still not ideal. I'll need to look more into how pymod works before I can suggest a better alternative.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Tue Dec 13, 2005 4:35 pm    Post subject: Reply to topic Reply with quote

Grel, for the most part I was just giving you shit, as I dont use ASSS or chatnet primarily. Though, the little work I have done with them, I noticed those quirks and I found it to be somewhat annoying.

Anyway:
Why even have hardcoded/designated command characters? Why not let modules/command classes/whatever decide how to determine what a command is by processing the message directly, or by registering a prefix with the command manager or such.
Besides, the '?' is so 1997.

With ChatNet, it bothered me because when I was processing the stream, I was left wondering how exactly you broke up the packets. Did you use a system-defined line break character/variable, or did you specify 10 or 13 (or both)? Should I expect it to change from system to system? What about the bit of overhead to check and dismiss empty packets resulting from doubled up delimiters? How about fubar'd data from a missed/skipped delimiter?
I eventually decided to default to 10 and provided a function to toggle it, banking on the assumption that you didnt use both. Maybe next time Ill just ask you.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Wed Dec 14, 2005 12:52 am    Post subject: Reply to topic Reply with quote

Cerium: it's better for users for there to be some consistency between what is interpreted by the server and what gets sent in pub chat. I wouldn't want to use a server where stuff I typed in the chat box may or may not get sent to the rest of the arena, depending on what set of modules happen to be loaded.

I thought the protocol was pretty clear as far as delimiters go: either 10 or 13 or any combination of those can end a message.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed Dec 14, 2005 1:51 am    Post subject: Reply to topic Reply with quote

Well it pretty much goes without saying that commands should follow some kind of uniform definition, but what if I want to use a ! in my zone, or even ? for player commands, * for admin commands and ! for arena-specific commands? Even newbie developers will use (mostly) the same syntax for their commands.

Indeed, I read the protocol and got 99% of my chatnet knowledge from it. But whats wrong with a simple null character? or even always using 10 OR 13, not both? Why leave it so open ended and force the clients to add some unnecessary overhead to properly parse packets? I dont see why you use these dynamics in a communications protocol but not in something like the command manager; seems backward imo.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Wed Dec 14, 2005 2:05 am    Post subject: Reply to topic Reply with quote

Cerium wrote:
add some unnecessary overhead to properly parse packets

Keep reading bytes until:
curByte == 0x10 || curByte == 0x13
Then, check next byte. If same, move pointer ahead one. Else, its a new command to parse.

Wow, very hard. In fact, most scripting languages have line-parsers built into them that will correctly handle 10/13/both endings of lines in strings. Null characters are awkward to do with a telnet client, and adding in simple support of spliting lines via 10/13/both in a programming tool is dead simple.

In the beginning, Grel wanted all commands to be ? only. But, because ASSS wouldn't be a night-day swap for all zone admins, he had to deal with the fact most admins and bots used * and wouldn't be very easy to change around. Having different sets of commands, where ?arena does one thing, *arena does another, and under your suggestion, !arena can do a third, it becomes annoyingly complex. It is easier to just state that all commands are done via ?, but we need the * to allow people to transfer over to ASSS.

IRC, Battlenet, etc, they all work where every command begins with a / in front. I don't see a need to have more command symbols than is needed. ! only came around because bots needed a command symbol that servers would not strip away. Let ! die with the bots.
Back to top
View users profile Send private message Add User to Ignore List Send email
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed Dec 14, 2005 2:58 am    Post subject: Reply to topic Reply with quote

I never said it was hard, but its literally twice the work necessary if the other end is only using 0x13. Im very nazi-ish when it comes to wasting instructions when you dont/shouldnt need to.
To be honest though, I never saw chatnet as a protocol for telnet clients, despite all the signs, nor did anyone else Ive had this discussion with. I guess if thats what the intention for chatnet is I can just accept it for what it is, but meh, whatever.

Thats stupid. If some zone wants to use 18 tildes for their command prefixes, why stop them? Obviously they have a reason to want to set it up that way, be it preference or mental retardation. If I were to setup a zone, it would probably be setup how I described above. I find it to be more organized, and would probably make setting up player access easier.
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: Wed Dec 14, 2005 9:40 am    Post subject: Reply to topic Reply with quote

Cerium wrote:
Thats stupid. If some zone wants to use 18 tildes for their command prefixes, why stop them? Obviously they have a reason to want to set it up that way, be it preference or mental retardation. If I were to setup a zone, it would probably be setup how I described above. I find it to be more organized, and would probably make setting up player access easier.


If some zone wants to do that, then there's nothing stopping them from adding an 18 tilde command prefix, or just checking incoming chat packets.

I prefer the current system. I'd rather not specify that I want both *shipstatus and ?shipstatus.
_________________
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 Dec 14, 2005 12:59 pm    Post subject: Reply to topic Reply with quote

Cerium wrote:
Im very nazi-ish when it comes to wasting instructions when you dont/shouldnt need to.

Are you kidding me, Mr. Java?
_________________
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
Cerium
Server Help Squatter


Age:43
Gender:Gender:Male
Joined: Mar 05 2005
Posts: 807
Location: I will stab you.
Offline

PostPosted: Wed Dec 14, 2005 7:45 pm    Post subject: Reply to topic Reply with quote

Cyan~Fire wrote:
[..]


Are you kidding me, Mr. Java?


Hah! Zing.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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: 34 page(s) served in previous 5 minutes.

phpBB Created this page in 0.480299 seconds : 41 queries executed (86.6%): GZIP compression disabled