Results 1 to 11 of 11

Thread: [RESOLVED] game using winsocks

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Resolved [RESOLVED] game using winsocks

    ok so im trying to make a game i made multiplayer using winsocks, i have a couple of problems firstly for some reason my game is crashing when you start and i have no idea why. it seems to be jumping to the multiplayer form and trying to send stuff before it connects to the server to start the game even though i have it set to start with the menu form. second i want to know if im doing something wrong with the way i use them (im new at working with networks). The game is the attached file.
    Attached Files Attached Files

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: game using winsocks

    Suggest you use .zip rather than .rar for the attachment. Not everyone has the ability to process rar files.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Re: game using winsocks

    thanks for the advise ive attached a .zip one to this post, for anyone who doesnt have one and needs one id suggest winrar (its free)
    Attached Files Attached Files
    Last edited by tdogg; Nov 23rd, 2011 at 07:14 PM.

  4. #4
    Addicted Member
    Join Date
    Nov 2007
    Posts
    134

    Re: game using winsocks

    When trying to load the game I get the following errors:

    Code:
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    
    Also, File not found for 
        Open App.Path & "\achievements.txt" For Input As Filenumber

  5. #5
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: game using winsocks

    One of your problems is that in Form frmWait you are referencing frmMultiPlayer which causes that form to be loaded and hence the Form_Load event will trigger. You could resolve that by moving the code from the Form_Load event into the Form_Activate event.

    There are also some typos in the Server routine, you have 2 winsocks on the form, sock and sock2 but you are referencing sock1 in the code. I recommend you put 'Option Explicit' in the Declarations Section of all your Forms so that any undefined variables are reported to you when you compile.

    I am also getting load errors when accessing some of the forms in the project.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Re: game using winsocks

    Quote Originally Posted by YEAYA View Post
    When trying to load the game I get the following errors:

    Code:
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    Line 12: Property Picture in frmMultiPlayer had an invalid file reference.
    Line 46: Property Picture in imgUnlocked had an invalid file reference.
    Line 141: Property Picture in imgP2right had an invalid file reference.
    Line 150: Property Picture in imgP2left had an invalid file reference.
    Line 159: Property Picture in imgP2up had an invalid file reference.
    Line 168: Property Picture in imgP2down had an invalid file reference.
    Line 217: Property Picture in imgMainRight had an invalid file reference.
    Line 226: Property Picture in imgmainup had an invalid file reference.
    Line 235: Property Picture in imgMainleft had an invalid file reference.
    Line 244: Property Picture in imgMain had an invalid file reference.
    Line 253: Property Picture in imgRobot had an invalid file reference.
    Line 261: Property Picture in imgRobot had an invalid file reference.
    Line 269: Property Picture in imgRobot had an invalid file reference.
    Line 277: Property Picture in imgRobot had an invalid file reference.
    Line 285: Property Picture in imgRobot had an invalid file reference.
    Line 293: Property Picture in imgRobot had an invalid file reference.
    Line 301: Property Picture in imgRobot had an invalid file reference.
    Line 309: Property Picture in imgRobot had an invalid file reference.
    Line 317: Property Picture in imgRobot had an invalid file reference.
    Line 325: Property Picture in imgRobot had an invalid file reference.
    Line 411: Property Picture in imghealthpack had an invalid file reference.
    
    Also, File not found for 
        Open App.Path & "\achievements.txt" For Input As Filenumber

    my bad i forgot to put all the pictures and text files in the compressed folder but thats not what the problem is, theyre all fine on my computer. thanks for the help guys but im still at a loss as to why it loads frmwait first

  7. #7
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: game using winsocks

    The very first (and only) thing you do in frmMenu's Load event is 'frmWait.Show'

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Re: game using winsocks

    Quote Originally Posted by Doogle View Post
    The very first (and only) thing you do in frmMenu's Load event is 'frmWait.Show'
    oh wow now i feel like an idiot, i cant believe i missed that. thanks guys for the help and everything's good code wise for multiplayer right? like the only problems now should be other things like firewalls and whatnot correct?

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Re: game using winsocks

    so im still (clearly) a noob around here, how do i resolve the thread?

  10. #10
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: game using winsocks

    At the top of the Thread is an item named 'Thread Tools' drop that down and select 'Mark Thread Resolved'

  11. #11

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    11

    Re: game using winsocks

    ok thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width