ntech
Junior Member
Posts: 99
|
Post by ntech on Apr 30, 2019 18:13:47 GMT
Hey all, for a LONG time I've wanted to make a MUD (https://en.wikipedia.org/wiki/MUD) in JustBasic. Luckily, JB supports good ole' COM ports. However, these aren't able to connect to ethernet. That's changing!
In my project to create a working telnet/MUD server in JustBasic, I'll first write up (in Python) a bi-directional TCP/COM gateway that'll attach itself to COM2 and accept TCP connections on localhost, port 4000. Any connections shall be transmitted over COM2 - "!!CONNECTION IPADDRESS CONNECTION_ID" shall be sent over the COM port. To receive data from clients, the JB server shall read "CONNECTION_ID <here goes what the client sent>" from the COM port and reply with "CONNECTION_ID <here goes the response>".
The significance is that JB shall now be able to act as a server for any type of TCP-based communication: HTTP, HTTPS, SMTP, Telnet, etc.
I would appreciate pointers on how to receive that data, as well as open the COM port. Like, a subroutine to open the COM port (COM2), a function to read data from the COM port, and lastly, a function to send data.
|
|
|
Post by Rod on May 1, 2019 8:09:53 GMT
That sounds exciting. If you have not found the serial article on the LBPE have a browse. alycesrestaurant.com/lbpe/AccessingSerialPort.htmlIt may answer some of your questions. The project might benefit from having an initial test game, something simple like wumpas or the like. Then folks would be better able to help you with the serial messaging.
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on May 2, 2019 15:24:22 GMT
Currently, I've setup a bridge between two COM ports, one on which JB listens/responds, and the other to which a relay messages inputs from a socket listener on port 3000. To help JB to recognize which client is sending which message, each message is prefixed with an identifier: "<clientID> <whatItSent>". Also, there's notifications like "NP <newConnection> <connectionIP>", "DC <disconnectedPlayer'sID>", by which the relay informs JB over the COM port. The server may send information to one client by "<clientID> <toSend>", shutdown the relay by "zapzap", and send information to all clients by "all <toSend>". When I've tweaked all the bugs out and created a sample program showing how to interact with the relay (to create a simple 567 MUD -- 5 rooms, 6 objects, 7 commands) I'll post the ZIP file
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on May 2, 2019 19:58:40 GMT
Ok, version 1 is ready to go! jbfilesarchive.com/phpBB3/viewtopic.php?f=15&t=2149Download the ZIP file. Install com0com Run "runRelay.bat" Run "communicator.bas" Run "telnet.bat" Play 567MUD! - 5 rooms, 6 items, 7 commands. Once you're done playing, have fun improving communicator.bas (aka 567MUD), implementing a HTTP server, or even a SMTP server. Please read README.txt before doing anything, as it contains a step-by-step guide of how to do everything. Total setup time: around 2 minutes. No thinking required
|
|
|
Post by Rod on May 3, 2019 15:29:01 GMT
Ahhhh….. My Virus Protection is refusing the download. This is unusual since Windows Defender rarely steps in to protect me. It will dissuade some folks from trying the code. I don't even know how I bypass defender at this point cause it has never kicked in before. Perhaps it is the executable code that causes the problem. Can it be packaged as source code rather than installable/executable code? Or can we break it down into smaller blocks till we see what Defender is getting upset about?
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on May 3, 2019 15:47:01 GMT
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on May 3, 2019 18:23:07 GMT
Please update me if it persists in flagging it as malware.
|
|
|
Post by Rod on May 4, 2019 8:45:52 GMT
All downloaded without Defender complaint. It is a big download, the Python support is big. OK for me on a fiber link and a big spare hard disc. Holiday weekend here so it will be a day or so till I get to play with it.
|
|