Jump to content

Read Packet


Alienhead
 Share

Recommended Posts

I've got a simple server and client setup,  all is good.. the client connects to the server/client as it should.  I just cant get a chat or data packet from the connection.

Im using this method: message.stream:ReadString()  

All is I get is a nil value on stream..  The connection is established and the incoming packet was retrieved since it tried to read the stream socket to begin with I've been over the simple chat app Josh posted, thats were the base of this code came from.

To test I use this command from the server :  server:Broadcast(MESSAGE_CHAT, "testing")

But when the client receives this packet it crashes @ message.stream:ReadString()   due to stream being a nil value.

I'm only happy when I'm coding, I'm only coding when I'm happy.

Link to comment
Share on other sites

Did you check the message ID? There are other messages that occur besides just the ones you send.

FYI, ENet will not work for any serious multiplayer code unless you are going to build your own relay server. The Steam P2P networking system is better for this.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Aye, I'm building Echo-Server  routines directly into each client so it's as simple as toggling, host, client or solo at the start of the game  to begin a session..   It's just simple 1-4 player co-play, ENet is more than sufficient for these needs.  The problem seems to not be with the packet control as I originally thought,  I've traced it back to having multiple surfaces on the player mesh, I moved the character control to a pivot and just parented the character mesh  to the pivot and it worked fine.

Leadwerks is just awesome, where else could I had coded a complete co-op echo-server in LUA... in just 4 days... :)  

 

  • Haha 1

I'm only happy when I'm coding, I'm only coding when I'm happy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...