Results 1 to 10 of 13

Thread: Best approach for simple network game

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Well, why don't you look through examples included in synapse library
    Examine these files: synapse40\source\demo\echo\echo.pas & main.pas
    echo.pas should give you idea about how to implement tcp client & tcp server

    To make your applications transfer data over TCP you do not need a web server. Just include code for both server and client parts in your application, then one of users will click "create game" in your app and tell the other one something like "go; I created! IP is 192.168.1.2", so the other one will click "connect" button of his instance of app, enter IP and hopefully it will work lawl. Sever or "Creator" accepts connection, client connects.

    In example source I mentioned above TTCPEchoDaemon class is a primitive server, while TTCPEchoThrd is a primitive client.

    I can give you link to my code, but I doubt it will help you much. I can post the code I already have, but I am too lazy to create a tutorial-example from ground, sry lawl
    https://bitbucket.org/hinst/paslog/s...pas?at=default
    https://bitbucket.org/hinst/paslog/s...pas?at=default
    https://bitbucket.org/hinst/paslog/s...pas?at=default
    These are files I use for my logging library, but not all of them, not sure if it will help.
    BTW I assume u use FreePascal

    u can test everything on one PC at first, use loopback IP address then: 127.0.0.1 or "localhost" to connect
    Last edited by dj_sharp; 20-05-2014 at 08:42 PM.

Bookmarks

Posting Permissions

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