Networking Issue

Just starting out? Need help? Post your questions and find answers here.
CadeX
Enthusiast
Enthusiast
Posts: 124
Joined: Mon Oct 02, 2006 2:56 pm
Location: Australia
Contact:

Networking Issue

Post by CadeX »

Code: Select all

              For m=0 To PlayersMax
                If Client(m)\ClientID<>0 And Client(m)\ClientID<>Client(i)\ClientID
                  SendNetworkString(Client(m)\ClientID,"join|||"+Str(i)+"|||90|||90|||1")
                  Delay(1)
                EndIf
              Next     
              For m=0 To PlayersMax
                If Client(m)\ClientID<>0 And Client(m)\ClientID<>Client(i)\ClientID
                  SendNetworkString(Client(i)\ClientID,"join|||"+Str(m)+"|||"+Str(Client(m)\X)+"|||"+Str(Client(m)\Y)+"|||"+Str(Client(m)\ImageID))
                  Delay(1)
                EndIf
              Next

        For s=0 To PlayersMax
          If Client(s)\ClientID<>0 And Client(s)\ClientID<>Client(i)\ClientID
            SendNetworkString(Client(s)\ClientID,"Update|||"+Str(i)+"|||"+Str(Client(i)\X)+"|||"+Str(Client(i)\Y)+"|||"+Str(Client(i)\ImageID))
          EndIf
        Next
Yet the thing is i don't know how to stop it so the client doesn't receive one message and then the other.

Code: Select all

Debug:
join|||0|||0|||0|||0update|||0|||90|||90|||1

In one message. I would prefer:
MSG1:join|||0|||0|||0|||0
MSG2:update|||0|||90|||90|||1

Please excuse the giagantic loop.

I can rewrite my engine to break up the code but i wont enjoy it.
Pro-Gamer, Programmer, Pro-Grammer
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Post by citystate »

You could have the client acknowledge the first message, and once the server receives it, it can send the update message.

of course as usual, I could be talking out of my hat... :lol:
CadeX
Enthusiast
Enthusiast
Posts: 124
Joined: Mon Oct 02, 2006 2:56 pm
Location: Australia
Contact:

Post by CadeX »

Yeah, thanks for trying though. Trying to base mine on a MMO engine, so i'll probably have to go with my first idea, Work on a packet reader that reads up to endofpacket then goes onto the next. Thanks for trying.
Pro-Gamer, Programmer, Pro-Grammer
Post Reply