Worklog for SurreaL

Worklog 1

Return to Worklogs

So..very..close!(Posted 2002-01-06)
Well, after a full day dedicated to hunting down the bugs that have popped up with this quirky little library, I seem to have actually squashed them all..*knocks on wood*

This of course can't be true, but at least all the major ones that I can see so far :)
So! Only one thing seems to remain to be implemented, and thats the reliability sends of UDP messages. Its in there half-assed, with ACKs and so forth, but there is no actual re-sending if an ACK is not received. I wanted to base the 'timeout' period of waiting for the ACK on the ping of the player, so I'll hold off on working on that until tommorow.. its late and I'm *very* pleased with what I've pulled off today anyhow. I'll offically release it soon hopefully, I didn't think it'd take this long but I wasn't really eager to work on it after all the bugs I was running into.

Network coding can be a bitch ;)

If anyone is actually reading this and would like to see something else added besides the functions I had listed in my previous worklog entry, don't hesitate to send me a mail at surreal9@.... I'm sure I'll be pleased enough that someone saw this that I might even try to work on your request!
Until next time..


----------------------
|--=»§û®®éå(_«=--|
Email: blitzplay@...
BlitzPlay - online gaming made easy! (forums now online!)

Network Functions Library v1.0(Posted 2001-12-30)
oi. Its so very annoying when you start writing something on a webpage and then IE crashes.. *sigh* anyhow.

So as I was saying, I'm continuing work on the networking library that I started on a week or so ago, and its coming along nicely. Basically I'm just trying to whip up a set of functions that will be useful for any sort of online/multiplayer game that you'd want to make. So far I have it possible to host a session, and have up to 254 people join. Every person is added to a Type list (nInfo.NetInfo) containing their IP, UDP Port, the TCP Stream handle (only for the host), their Name, and a net_id which is what can seperate people if they have similar names/ip's and so on.. They connect with a TCP stream as well as opening a UDP port for udp communications. You will have functions, specifically UDPMessage and TCPMessage which will send each type of message. Here is a list of the functions that are currently implemented:

Networking Functions and their Required Variables/Parameters
------------------------------------------------------------
Function HostSession (HostName$)
requires: My_UDP_Port, My_TCP_Port
returns: True/False on success
Function JoinSession (PName$)
requires: My_UDP_Port, My_TCP_Port, Host_UDP_Port, Host_TCP_Port, Host_IP
returns: True/False on success
Function EndSession ()
Function CheckForMessages ()
Function UDPMessage (msgTarget%, msgType%, msgData$, reliable%)
Function TCPMessage (msgTarget%, msgType%, msgData$)
Function IntToStr$(num%, strlen% = 4)
returns: string containing compressed integer, strlen bytes long
Function StrToInt%(st$)
returns: integer calculated from string
Function ConvertIp% (IP$)
returns: integer IP converted from the "x.x.x.x" format.
Function Find_ID.NetInfo (ID)
returns: nInfo.NetInfo that matches the ID

-CheckForMessages() handles messages a little differently than the recvmsg functions that are currently in place for UDP/TCP or Dplay messages. Basically I set up another Type list (with fields msgData$, msgType%, msgFrom%, msgTo%) and whenever a message is received its added to the type list, with all the data in the appropriate fields. Messages are pretty much handled the same as DP's method, with the msgType field since I thought that worked well.
-TCP and UDP broadcasts are handled the same, with a target of "0" meaning a broadcast.
-IntToStr and StrToInt are handy little functions for compressing integers to be sent..you can specify how many bytes you want to compress it down to so if your only using a # that will be between 0-255 then calling IntToStr (string$, 1) for example would save you from the extra 3 bytes of wasted space. The function defaults to 4 bytes for 32 bit integers but you can specify otherwise..

Right now I'm trying to work out this stupid bug which only seems to happen if you choose to use port 3333 for your UDP port.. its such a weird bug that I'm having a hard time figuring out why it'd screw up but ah well, I guess most bugs are like that ;)

I'm tentatively calling it BlitzPlay for now.. I'm hoping to have a fully working version ready within a few days.. I'll probably whip up a little webpage with this and maybe some other stuff I have.. I'll post a link to it on the forum if/when I do get that up. Ah well, cheers for now ;)


----------------------
|--=»§û®®éå(_«=--|
Email: blitzplay@...
BlitzPlay - online gaming made easy! (forums now online!)