JoinNetGame.htm 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>JoinNetGame (gamename$,serverIP$)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. gamename$ = valid string containing game name to join <br />
  13. serverIP$ = IP address of computer hosting game
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Use this command to join a network game, bypassing the dialog box normally endured with the StartNetGame command. <br />
  22. This returns 0 if the command failed, or 1 if the game was joined successfully.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/JoinNetGame.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; JoinNetGame example <br />
  31. ; Note; run the HostNetGame example code on the other computer <br />
  32. ; you wish to join with <br />
  33. <br />
  34. gamename$="ShaneGame" <br />
  35. ; Change this to match the other computer's IP! <br />
  36. serverIP$="0.0.0.0" <br />
  37. <br />
  38. ; Make the join attempt <br />
  39. joinResults=JoinNetGame(gamename$,serverIP$) <br />
  40. <br />
  41. Select joinResults <br />
  42. Case 1 <br />
  43. Print "Joined the game successfully!" <br />
  44. Default <br />
  45. Print "Joining the game was unsuccessful." <br />
  46. End Select <br />
  47. WaitKey() <br />
  48. </td>
  49. </tr>
  50. </table>
  51. <br>
  52. <a target=_top href=../index.htm>Index</a><br>
  53. <br>
  54. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=JoinNetGame&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  55. </html>