EclipseCommunity Posted April 10, 2011 Author Share Posted April 10, 2011 So i've been messing around with Robins networking system in Eclipse Origins 2.0, and decided I wanted to rip it out and use it as a base networking engine for any future projects. Since I'm trying to steer away from MS based engines and write something more original, I thought I could start here (Since I've only been able to write a crappy networking system like MS's, but EO's is faster and more optimised).So I've taken out as much as I can, and so far I've been able to get the server working nicely, and ping it from an external client.However, the issue I'm having at the moment is not being able to ping the server with the client I have setup using EO's socket system.I've set up a dummy login button to try and send a connection to the server. Naturally it won't function and may even error, but as long as the server recieves a connection from the client, that's a starting point.The code is messy and there's bits floating around which probably aren't even needed yet, but I'll tidy it all up later when I have it working properly.If anybody could have a gander over the code so far, just see if you can figure out what I'm missing from the client.Thanks.**Code:** http://www.draignet.com/hosted/DraigMUD.rar Link to comment Share on other sites More sharing options...
Aranshada Posted April 12, 2011 Share Posted April 12, 2011 A cursory glance at your client code flow reveals that you're calling TcpInit before you set your options in Main.Note: I'm at work right now, so I don't have VB6, and I'm just reading through the code with some syntax highlighting.Here is your main routine:```Public Sub Main() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call TcpInit Options.Game_Name = "Eclipse Origins" Options.IP = "localhost" Options.Port = 7001 frmMain.Show ' Error handler Exit Suberrorhandler: HandleError "Main", "modGeneral", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Here is your TcpInit routine:```Sub TcpInit() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set PlayerBuffer = New clsBuffer ' connect frmMain.sckSocket.RemoteHost = Options.IP frmMain.sckSocket.RemotePort = Options.Port ' Error handler Exit Suberrorhandler: HandleError "TcpInit", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Notice how TcpInit is called from Main BEFORE you set the IP and Port fields of your Options variable. This means that when the fields are set on the socket, you're using the default values for Options.IP and Options.Port. This means that later once you click your "Connect" button, it's most likely trying to connect to Host "" on Port 0.Move the call to TcpInit below where you set Options.Port = 7001. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 13, 2011 Author Share Posted April 13, 2011 I can't see how I missed that… What a retard :mad: Thanks.Your name is very familiar by the way. Link to comment Share on other sites More sharing options...
Aranshada Posted April 13, 2011 Share Posted April 13, 2011 I used to be very involved in the PW scene until everything started merging into one site and then gradually fading away. I also did some work with Elysium back in the day, but only released like 2-3 tutorials. I was mostly a debugger and general programming knowledge guy.Haven't really been around for at least 3 years… maybe longer. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 13, 2011 Author Share Posted April 13, 2011 Did you ever play Deloria? Read my above post also, problem is solved so thanks a lot lol. I feel such a moron right now. I have absolutely no excuse for putting that code AFTER the TCPInit call besides being a retard. Link to comment Share on other sites More sharing options...
Aranshada Posted April 13, 2011 Share Posted April 13, 2011 I never played on the official one, but I did play on the remake that I believe GSD and a few others made. Link to comment Share on other sites More sharing options...
Robin Posted April 13, 2011 Share Posted April 13, 2011 Nice one, Steve. Can't even rip a damn socket system properly. ;] Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 13, 2011 Author Share Posted April 13, 2011 LOL. Most of the time I'm not concentrating properly. Says Mr. Expert who makes the most simplest mistakes possible :POnly error I get now which I really can't figure out is on the server…."Object variable With Block variable not set"```TempPlayer(index).Buffer.WriteBytes Buffer()``` Link to comment Share on other sites More sharing options...
Robin Posted April 13, 2011 Share Posted April 13, 2011 Did you create the player's buffer object? Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 13, 2011 Author Share Posted April 13, 2011 This is the part in the ClearPlayer sub routine isn't it…```Set TempPlayer(index).Buffer = New clsBuffer```If so, I haven't got around to finishing that bit up yet because I want to put in character accounts :) Link to comment Share on other sites More sharing options...
Robin Posted April 13, 2011 Share Posted April 13, 2011 That has nothing to do with accounts. The 'TempPlayer' entity is simply a temporary storage space for data. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 13, 2011 Author Share Posted April 13, 2011 I know, but that's the part you were talking about for creating the player buffer though right? Link to comment Share on other sites More sharing options...
Robin Posted April 13, 2011 Share Posted April 13, 2011 Yes… You can tell because it's got a big fat equals sign in it. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted April 14, 2011 Author Share Posted April 14, 2011 lol. Yeah. I just haven't got around to adding all that bit in yet. Once I get accounts functioning and get to the part where I start getting the player login stuff to work i'll get that over.After that, it's done. I won't touch it for a year until I get bored and come back to it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now