• Several Baja questions

    From Evan Elias to All on Tuesday, August 15, 2000 14:59:41
    OTE: DCTEdit v0.04 [10]
    I've been tinkering with the idea of porting my game DoorMUD to baja, sort of anyway. It would work by having an external "server" program (ie, a standard EXE written w/ C++, that isn't a door) running in the background while players are in the game. A Baja "client" module would communicate with the server, using files for input and output. I think this might have the potential to be very efficient, since only one copy of the server would need to be running at any time. So if 5 users were in the game, only 1 DOS program would be running, instead of 5.

    However, I have a few Baja questions before I can get started on this:

    1. How fast/efficient are the Baja file manipulation routines? When file-sharing is used, is it compatible with C's sopen function?

    2. How do I open files in binary mode? Or is that the default for baja's fopen?

    3. Which system variable stores the node number? (I wasn't sure if _USERON.NUMBER was the node number or the account number)

    4. What happens when a user hangs up? Does the module just quit? That would be very bad for me, since the MUD needs to perform routines so that the player is no longer listed as online... is there a way to set a certain subroutine to be called in case of a hang-up?

    Any help is GREATLY appreciated :)

    Thanks,
    Evan Elias
    http://dmud.thebbs.org
  • From Digital Man to Evan Elias on Tuesday, August 15, 2000 19:05:35
    RE: Several Baja questions
    BY: Evan Elias to All on Tue Aug 15 2000 09:59 pm

    I've been tinkering with the idea of porting my game DoorMUD to baja, sort o anyway. It would work by having an external "server" program (ie, a standar EXE written w/ C++, that isn't a door) running in the background while playe are in the game. A Baja "client" module would communicate with the server, using files for input and output. I think this might have the potential to very efficient, since only one copy of the server would need to be running a any time. So if 5 users were in the game, only 1 DOS program would be running, instead of 5.

    Or perhaps even easier (but perhaps not quite as efficient), create a 32-bit WinSock/telnet version. This could be Synchronet-specific (getting the socket handle from XTRN.DAT) or better yet, DOOR32.SYS compatible (which is supported by Synchronet, Mystic and EleBBS at the moment). This would still be a single-instance per user, but the fact that it was 32-bit and used sockets directly would improve the performance dramatically.

    However, I have a few Baja questions before I can get started on this:

    1. How fast/efficient are the Baja file manipulation routines?

    Only slightly slower than a native 32-bit application.

    When
    file-sharing is used, is it compatible with C's sopen function?

    Yes.

    2. How do I open files in binary mode? Or is that the default for baja's fopen?

    I believe (I don't have the docs in front of me), it only supports binary mode.

    3. Which system variable stores the node number?

    I believe it's _node_num (check DOCS\BAJA.DOC).

    (I wasn't sure if
    _USERON.NUMBER was the node number or the account number)

    That is the account/user number.

    4. What happens when a user hangs up? Does the module just quit?

    Yes, unless the OFFLINE Baja function has been called.

    That woul
    be very bad for me, since the MUD needs to perform routines so that the play is no longer listed as online... is there a way to set a certain subroutine be called in case of a hang-up?

    You can use the OFFLINE Baja function and check for disconnection manually I think (_sys_status bit ON_REMOTE).

    Rob
  • From Evan Elias to Digital Man on Wednesday, August 16, 2000 13:02:22
    RE: Several Baja questions
    BY: Digital Man to Evan Elias on Wed Aug 16 2000 02:05 am

    OTE: DCTEdit v0.04 [14]
    Or perhaps even easier (but perhaps not quite as efficient),
    create a 32-bit WinSock/telnet version. This could be
    Synchronet-specific (getting the socke handle from XTRN.DAT)
    or better yet, DOOR32.SYS compatible (which is support by
    Synchronet, Mystic and EleBBS at the moment). This would
    still be a single-instance per user, but the fact that it
    was 32-bit and used sockets directly would improve the
    performance dramatically.

    Well, only problem for me there is, I don't know much about 32-bit coding :(
    So making a Baja port would probably be easier for me. Plus, I like the concept of not having an extra window open for each user in the game, and added features like seeing who's online, global paging, etc are always nice.

    You can use the OFFLINE Baja function and check for
    disconnection manually I think (_sys_status bit ON_REMOTE).

    Are there any known issues regarding this that I'll have to worry about? (ie , functions working differently in offline mode). One thing that concerned me was if you're inputting an entire string in offline mode, I wasn't sure if there was a way to detect hang-ups in that case, since the function doesn't return until the user hits enter... if they hang up in offline mode, will the function terminate or will it just freeze?

    Thanks for answering all my questions... got one more though :) Is there an easy way to take the current command character and add it to a string? I noticed there wasn't an option in sprintf to put the command character into a string, and I didn't see any other ways to do it either, since very few functions allow you to manipulate the command char.

    The reason I want to append it to a string is I want to do most string input one character at a time (using inkey) so that other operations can be done while a user is in the process of entering a string.

    The only way I could think of to put the command character onto the end of a string was to have a separate cmdkey for every key on the keyboard, and then manually add the proper character to the string using strcat... but that would be somewhat tedious since there'd be a billion cmdkey's. Is there an easier way?

    Thanks,
    Evan Elias
  • From Evan Elias to Digital Man on Wednesday, August 16, 2000 13:24:31
    RE: Several Baja questions
    BY: Digital Man to Evan Elias on Wed Aug 16 2000 02:05 am

    OTE: DCTEdit v0.04 [1]
    One other problem I'm having w/ trying to do key-by-key string input... all of the character input functions (inkey, getkey, getkeye) seem to convert the character to upper-case. Is there any way around this?

    Much thanks,
    Evan Elias
  • From Digital Man to Evan Elias on Wednesday, August 16, 2000 23:37:10
    RE: Several Baja questions
    BY: Evan Elias to Digital Man on Wed Aug 16 2000 08:02 pm

    RE: Several Baja questions
    BY: Digital Man to Evan Elias on Wed Aug 16 2000 02:05 am

    OTE: DCTEdit v0.04 [14]
    Or perhaps even easier (but perhaps not quite as efficient),
    create a 32-bit WinSock/telnet version. This could be
    Synchronet-specific (getting the socke handle from XTRN.DAT)
    or better yet, DOOR32.SYS compatible (which is support by
    Synchronet, Mystic and EleBBS at the moment). This would
    still be a single-instance per user, but the fact that it
    was 32-bit and used sockets directly would improve the
    performance dramatically.

    Well, only problem for me there is, I don't know much about 32-bit coding :(

    In general, 32-bit programming is much like 16-bit programming, but with the memory limitations. :-) Honestly, as long as you're using a 32-bit development tool, there aren't many differences, except of course in C/C++ ints are 32-bit instead of 16-bit (use shorts or longs to specify size).

    So making a Baja port would probably be easier for me. Plus, I like the concept of not having an extra window open for each user in the game, and added features like seeing who's online, global paging, etc are always nice.

    Look into the Synchronet XSDK for C/C++ programmers. You get all these advantages and then some.

    You can use the OFFLINE Baja function and check for
    disconnection manually I think (_sys_status bit ON_REMOTE).

    Are there any known issues regarding this that I'll have to worry about? (ie functions working differently in offline mode). One thing that concerned me was if you're inputting an entire string in offline mode, I wasn't sure if there was a way to detect hang-ups in that case, since the function doesn't return until the user hits enter... if they hang up in offline mode, will th function terminate or will it just freeze?

    I don't know off-hand. You could always experiment with it.

    Thanks for answering all my questions... got one more though :) Is there an easy way to take the current command character and add it to a string?

    getkey
    strcat my_str str

    I
    noticed there wasn't an option in sprintf to put the command character into string, and I didn't see any other ways to do it either, since very few functions allow you to manipulate the command char.

    The command character is always put into the first character of the command string, so any function that operates (or can operate) on the command string (str) can use the command char too.

    Rob
  • From Evan Elias to Digital Man on Sunday, August 20, 2000 03:16:40
    RE: Several Baja questions
    BY: Digital Man to Evan Elias on Thu Aug 17 2000 06:37 am

    OTE: DCTEdit v0.04 [6]
    Look into the Synchronet XSDK for C/C++ programmers. You get
    all these advantages and then some.

    Ok, I'll give it a look then :) Where can I download it from?

    getkey
    strcat my_str str

    The command character is always put into the first character
    of the command string, so any function that operates (or can
    operate) on the command string (str) can use the command
    char too.

    Are you sure about that? I couldn't get it to work :( Getkey (or getkeye, inkey, etc) didn't seem to modify the command string when I tried... I did a second test, just having "getkey" then "print str", the command string was unchanged :(

    Well, if I can figure out the Synchronet XSDK I suppose I'll just use that instead of baja anyway, so it's no big deal.

    Thanks,
    Evan
  • From Digital Man to Evan Elias on Sunday, August 20, 2000 08:40:15
    RE: Several Baja questions
    BY: Evan Elias to Digital Man on Sun Aug 20 2000 10:16 am

    Look into the Synchronet XSDK for C/C++ programmers. You get
    all these advantages and then some.

    Ok, I'll give it a look then :) Where can I download it from?

    ftp://vert.synchro.net/main/sbbs/xsdk_300.zip

    getkey
    strcat my_str str

    The command character is always put into the first character
    of the command string, so any function that operates (or can
    operate) on the command string (str) can use the command
    char too.

    Are you sure about that? I couldn't get it to work :(

    Rob
  • From Digital Man to Evan Elias on Sunday, August 20, 2000 08:41:06
    RE: Several Baja questions
    BY: Evan Elias to Digital Man on Sun Aug 20 2000 10:16 am

    Are you sure about that? I couldn't get it to work :( Getkey (or getkeye,

    I'll check it out when I get back to the states in a week or so.

    Rob
  • From Reaper Man@TIME to Evan Elias on Friday, August 18, 2000 11:22:00
    RE: Several Baja questions
    BY: Evan Elias to Digital Man on Wed Aug 16 2000 08:02 pm

    Well, only problem for me there is, I don't know much about 32-bit coding :( So making a Baja port would probably be easier for me. Plus, I like the concept of not having an extra window open for each user in the game, and added features like seeing who's online, global paging, etc are always nice.

    hmm, what if instead of spawning multiple copies, you had a host program that connected to the sockets, and another program that would make a connection with the host and tell it what node to load up.
    am i just talking out my fourth point of contact or would it work?

    ---
    ■ Synchronet ■ Time Warp of the Future Time.Darktech.Org 9am pt - 12am pt
  • From Evan Elias to Digital Man on Monday, August 21, 2000 14:05:25
    RE: Several Baja questions
    BY: Digital Man to Evan Elias on Sun Aug 20 2000 03:40 pm

    OTE: DCTEdit v0.04 [1]
    Ok, I'll give it a look then :) Where can I download it
    from?
    ftp://vert.synchro.net/main/sbbs/xsdk_300.zip

    Much thanks... downloading it right now :)
  • From Evan Elias to Reaper Man on Monday, August 21, 2000 14:10:09
    RE: Several Baja questions
    BY: Reaper Man to Evan Elias on Fri Aug 18 2000 06:22 pm

    OTE: DCTEdit v0.04 [4]
    hmm, what if instead of spawning multiple copies, you had a
    host program tha connected to the sockets, and another
    program that would make a connection w the host and tell it
    what node to load up. am i just talking out my fourth point
    of contact or would it work?

    The problem there is that I think one copy of the external program needs to be running per node. When an external program terminates for a node, control passes back to the BBS... I don't think there's a way to avoid that :( So if there wasn't one copy running per node, I don't think there'd be a way for the BBS to know that the user was still in the door.

    I'm not sure though... I can always try tinkering with stuff. After all, I didn't even think originally there was any way I could get my door to run multi-node in the first place :)
  • From Reaper Man@ROVER to Evan Elias on Thursday, August 24, 2000 09:08:00
    RE: Several Baja questions
    BY: Evan Elias to Reaper Man on Mon Aug 21 2000 09:10 pm

    I'm not sure though... I can always try tinkering with stuff. After all, I didn't even think originally there was any way I could get my door to run multi-node in the first place :)

    yeah, i didn't consider how the bbs would see if the user was done...
    perhaps you could have several "nodes" that would talk to a central proccess via tcp ports for lack of better idea. the first node to come up would spawn this "server" and once every node had disconnected from the "server" it would terminate itself.

    I have a warmer, fuzzier feeling about this method...

    ---
    ■ Synchronet ■ Rover Central, Kenora Ontario, Canada
  • From Evan Elias to Reaper Man on Wednesday, August 30, 2000 10:46:21
    RE: Several Baja questions
    BY: Reaper Man to Evan Elias on Thu Aug 24 2000 04:08 pm

    OTE: DCTEdit v0.04 [4]
    yeah, i didn't consider how the bbs would see if the user
    was done... perhaps you could have several "nodes" that
    would talk to a central proccess via tcp ports for lack of
    better idea. the first node to come up would spaw this
    "server" and once every node had disconnected from the
    "server" it woul terminate itself. I have a warmer, fuzzier
    feeling about this method...

    Well, that would definitely work, but alas the original problem is back -- there'd be one copy of the "client" program open for each node in the game :( Ohwell... not really a big deal... I just liked the concept of potentially being able to have many users in the game at once without the visual clutter of having so many programs running on the Windows taskbar.
  • From Tracker1@RGRGUMBY to Reaper Man on Wednesday, August 30, 2000 17:24:00
    RE: Several Baja questions
    BY: Reaper Man to Evan Elias on Thu Aug 24 2000 04:08 pm

    RE: Several Baja questions
    BY: Evan Elias to Reaper Man on Mon Aug 21 2000 09:10 pm

    I'm not sure though... I can always try tinkering with stuff. After all, didn't even think originally there was any way I could get my door to run multi-node in the first place :)

    yeah, i didn't consider how the bbs would see if the user was done... perhaps you could have several "nodes" that would talk to a central proccess via tcp ports for lack of better idea. the first node to come up would spaw this "server" and once every node had disconnected from the "server" it woul terminate itself.

    I have a warmer, fuzzier feeling about this method...

    microsoft calls this COM.. :)


    ---
    ■ Synchronet ■ Rangergumby's Outpost - tracker1.darktech.org
  • From Reaper Man@FLAMINT to Evan Elias on Friday, September 01, 2000 08:28:00
    RE: Several Baja questions
    BY: Evan Elias to Reaper Man on Wed Aug 30 2000 17:46:00

    Well, that would definitely work, but alas the original problem is back -- there'd be one copy of the "client" program open for each node in the game : Ohwell... not really a big deal... I just liked the concept of potentially being able to have many users in the game at once without the visual clutter of having so many programs running on the Windows taskbar.

    thats the easy part...
    just have the server on the task bar, and all the "nodes" could opt to not show up in the task bar.
    and if you did a ctrl-alt-del you could either have them listed in there by node number conected to, or have them run as windowless apps, kinda like a .dll

    ---
    ■ Synchronet ■ Flamin' Torch BBS - Fired Up and ready to go flamint.dyndns.org
  • From Evan Elias to Reaper Man on Saturday, September 02, 2000 06:39:53
    RE: Several Baja questions
    BY: Reaper Man to Evan Elias on Fri Sep 01 2000 03:28 pm

    OTE: DCTEdit v0.04 [4]
    thats the easy part... just have the server on the task bar,
    and all the "nodes" could opt to not s up in the task bar.
    and if you did a ctrl-alt-del you could either have them
    listed in there by node number conected to, or have them run
    as windowless apps, kinda like a .dll

    Hmm.. how do I go about making a program not show up on the task bar? As I've said before... my Windows programming experience is somehwat lacking :(

    Actually though, there's no need for a separate server program now, since the Windows console port runs quickly enough regardless of how many users are in the game.

    But I would still like to have a way to make the program not clutter the task bar, possibly as a command-line option for BBS's that are centered around MUDs and hence would often have many copies of the door open at once.

    So if ya know how to make a C++ Win32 Console program not show up on the taskbar, please let me know :)
  • From Reaper Man@FLAMINT to Evan Elias on Sunday, September 03, 2000 10:02:00
    RE: Several Baja questions
    BY: Evan Elias to Reaper Man on Sat Sep 02 2000 13:39:00

    So if ya know how to make a C++ Win32 Console program not show up on the taskbar, please let me know :)

    ok I do know how to do this in vb.
    one place you might look is the msdn library site.
    they have some kind of online search and you can see what other people have written on the topic.
    http://search.microsoft.com/us/dev/default.asp
    no hatemail please... but there are a few good things here when it comes to api calls and I guess they will have something about c++ since they have this visual C++ stuff.

    ---
    ■ Synchronet ■ Flamin' Torch BBS - Fired Up and ready to go flamint.dyndns.org
  • From Evan Elias to Reaper Man on Monday, September 04, 2000 06:57:05
    RE: Several Baja questions
    BY: Reaper Man to Evan Elias on Sun Sep 03 2000 05:02 pm

    OTE: DCTEdit v0.04 [0]
    ok I do know how to do this in vb. one place you might look
    is the msdn library site. they have some kind of online
    search and you can see what other people have written on the
    topic. http://search.microsoft.com/us/dev/default.asp no
    hatemail please... but there are a few good things here when
    it comes to calls and I guess they will have something about
    c++ since they have this visual C++ stuff.

    Ok, I'll give it a look. Thanks!

    Evan Elias