Short: UDPfuncsV2.0 for Blitz-good for Net games Author: anton@ww.co.nz (Anton Reinauer) Uploader: anton@ww.co.nz (Anton Reinauer) Version: 2.0 Type: dev/basic Requires: dev/basic/TCP-to-Blitz.lha, WB 2.0+, min 1.5 meg mem. These are functions to use the UDP protocol for multiplayer internet games in Blitz2. Also there is a small IRC-like chat program which is a good Net game communications test-bed. It checks wether packets have arrived at their destination by using an acknowledgement system, and resends packets if necessary. Also it can also act as either a Server or Client with log-in routines- each player is informed of the new player and starts sending any messages to the new player, as the communication is still peer-to-peer. There's a few TCP functions as well, like converting an ASCII address to numerical (long), and vice-versa, getting your local IP address etc. Some of the log-in and message protocols could be used in TCP games as well. It has an Arexx port to allow you to automatically connect to other UDP_Chat programs from AmiComSys- you just have to pass a host address to UDP_Chat. UDP is more appropriate for fast action games, like Doom clones, Xwing clones, or platformers, maze games etc; anything that needs small lags (ping times), to remain playable over the Internet/LAN. What's new in V2.0! -------------------- Version 2.0 27/07/98 ------------ Changed printing of Ping times, so they are now printed out correctly for each player, and you can now tell what your player number now is (`Me' is printed in place of your Ping time). Before it just printed out the Ping time of the last packet received. The Server is always Player 1. I fixed a bug which was numbering the clients wrongly, at the same time. Put in a ARexx interface, so you can log into a Server from AmiComSys, by passing the host address to UDP_Chat from AmiComSys (through a small Rexx program). The Function Connect_UDP{} has been renamed to the more logical Initialise_UDP{}, as it doesn't actually connect to anything. It now closes the bsdsocket.library in Initialise_UDP{} instead of at the end of the program- Paul had done this in his TCP_Funcs, but I hadn't transfered his code across properly. :-/ I renamed the programs to their actual version number, rather than the quick filename I gave them (ie: UDP_ChatV1.9.bb2, rather than UDP_Chat4.bb2)- doh! Changed Close_UDP{} to Exit{} and put it back in UDP_Chat. It now deallocates the receive memory buffer (UDP_mem.l) allocated in UDPHeader.bb2, and closes the Rexxport and UDP socket if they've been opened, (tidier than having it all at the end). So you can just call Exit{} to exit from anywhere (with an error string if needed), rather than have those naughty Gotos! :) Initialised `sock.l' to -1 so Exit{} routine can work Added in a #DEBUG constant to switch on debug info, and allow multiple copies of UDP_Chat on one machine (currently all debug info is still printed out). Changed default Port number to 27,272- (3,001 was too low for practical use). Put `ypos' above `GoSub Init_Gui', so can now call Exit{} from Init_Gui. Added this History File! ============================= Archive contents ============================= Original Packed Ratio Date Time Name -------- ------- ----- --------- -------- ------------- 2012 1043 48.1% 02-Aug-98 16:50:30 +History.readme 14715 4624 68.5% 16-Jun-98 17:22:22 +UDP_ChatV1.6.asc 20690 6332 69.3% 16-Jun-98 17:22:54 +UDP_ChatV1.7.asc 24370 7091 70.9% 16-Jun-98 17:23:16 +UDP_ChatV1.8.asc 267 196 26.5% 12-May-98 22:17:14 +Quit_UDP_Chat.rexx 1290 666 48.3% 29-Jul-98 15:04:56 +UDP_Chat.rexx 12320 5264 57.2% 02-Aug-98 17:00:54 +UDP-Examples.readme 2096 814 61.1% 08-Feb-98 23:23:04 +net_protocol_header.bb2 2987 1275 57.3% 24-Jan-98 23:42:02 +TCPFuncs.bb 23616 7216 69.4% 16-Jun-98 17:23:42 +UDP_ChatV1.9.asc 3056 1336 56.2% 02-Aug-98 16:17:18 +UDP_Receive2.asc 3014 1255 58.3% 02-Aug-98 16:12:56 +UDP_Send.asc 3209 1347 58.0% 02-Aug-98 16:16:58 +UDP_Send2.asc 22203 8736 60.6% 23-Apr-98 12:58:06 +Lag problems in Net games 1238 214 82.7% 08-Feb-98 23:23:04 +net_protocol_header.bb2.xtra 3199 1375 57.0% 02-Aug-98 16:13:42 +UDP_Receive.asc 1246 209 83.2% 27-Jul-98 21:13:38 +UDP_ChatV2.0.bb2.xtra 1246 190 84.7% 27-Jul-98 21:24:48 +UDPFuncs.bb2.xtra 588 294 50.0% 11-Apr-98 21:54:18 +UDPHeader.bb2 1238 185 85.0% 11-Apr-98 21:54:22 +UDPHeader.bb2.xtra 2096 814 61.1% 08-Feb-98 23:23:04 +net_protocol_header.bb2 26872 8282 69.1% 27-Jul-98 21:22:52 +UDP_ChatV2.0.asc 24922 8059 67.6% 27-Jul-98 21:13:38 +UDP_ChatV2.0.bb2 3244 1357 58.1% 27-Jul-98 21:24:46 +UDPFuncs.bb2 -------- ------- ----- --------- -------- 201734 68174 66.2% 03-Aug-98 12:22:36 24 files