3 Replies Latest reply on Nov 8, 2007 7:02 PM by hellojoyce123123

    sendNetMessage question

    Level 7
      I have a p2p game using the MUS xtra. There is a server application that
      one player runs, and then all players connect to the server. After some
      trial and error I have discovered that if one client sends a message
      specifically to a connected user, the message is routed by the sever,
      but the message is not handled by the server. The message gets handled
      by the xtra instance on the recipients machine.

      In some cases I want the instance running on the server to handle the
      message, so the recipient of the message was 'system'. For some reason I
      thought that there was something special about 'system', but this turns
      not to be the case. If I send a message to "scoobydoo" (and scoobydoo is
      not a connected user) the message is handled by the server.

      Everything works as I need it too, but is this how I should be doing it?
      Is there way of correctly identifying that the message should be handled
      by the servers instance? Is it OK to rely on this 'default' behavior?
        • 1. Re: sendNetMessage question
          hellojoyce123123
          I had that same problem with a game, I wanted to handle the messages that were sent directly to other users online and I didn't actually have the game source. So I remade a whole new server in VB... It actually runs a bit faster too lmao. Ill give you the source if you want, I have it organized into modules so I can just send you the actual bare server and the functions i made handle all the messages and send it nicely to a function, incomingMessage(), where you can handle the messages and sendPck(to, subject, from) to send messages back =)
          • 2. Re: sendNetMessage question
            Level 7
            justinjkdr wrote:
            > I had that same problem with a game, I wanted to handle the messages that were
            > sent directly to other users online and I didn't actually have the game source.
            > So I remade a whole new server in VB... It actually runs a bit faster too lmao.
            > Ill give you the source if you want, I have it organized into modules so I can
            > just send you the actual bare server and the functions i made handle all the
            > messages and send it nicely to a function, incomingMessage(), where you can
            > handle the messages and sendPck(to, subject, from) to send messages back =)
            >

            Thanks for your generous offer, but I really haven't noticed any serious
            performance issues. The games is closer to a turn-based game rather than
            something like a real-time player on player action game.

            I'm really starting wonder why I need the server to process any
            messages, other than the ones involved in setting up the initial
            connections. I think I could move most of the code to the clients, and
            simply use the server as a message router only. I'll have to think about
            the pro's and cons, but any opinion about it are welcome.

            Thanks again.
            • 3. Re: sendNetMessage question
              hellojoyce123123 Level 1
              Well if you're doing it that way where you just use the server as a router you get security issues, most of the time when you make an online game you want the server to process ALL the information and have as little processing client side as possible. if you have all the messages sent from client to client there's no way you're going to be able to keep track of the players information without actually having the client send the information to the server which is BAD...

              I don't know how your game works but I'm thinking that if you're making them directly communicate with each other your calculating attack power in the client and sending it when you attack (Which can be editedwith a packet editor!!!) you should do ALL calculations on the server.

              Another example in my game when you attack a mob instead of you sending to the server 'I attacked this mob on this map at this xy' i just made it send an attack message and the server knows where the mobs are and the mobs HP, that way you can't get someone sending fake messages of them killing mobs and getting exp. and same with when you save their experience instead of the client saying 'this is how much experience i have' i made the server automatically add it when you kill stuff and then the server tells YOU how much experience YOU have.

              Anyways just something to think about, you can always use the #all encryption method to prevent some of that stuff, but even with that people can still copy the right packets and resend them.

              Also I suggest if you're distributing this to people to check all your windows when the client loads to make sure people haven't put in fake windows where they can send messages of their own. AND watch out for lingo.ini in the application directory, people can open the debugger with it and also save your movie source =P

              Add...

              On SaveMovie()
              quit
              End SaveMovie

              And...

              On startMovie()
              if the debugplaybackenabled = true then
              quit
              end if
              End startMovie

              And... You can check the MD5Hash on your windows in the beginning to make sure they're authentic.

              Those are just a few things that people can use to cheat, so watch it =P