Alienhead Posted August 2, 2022 Share Posted August 2, 2022 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. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted August 3, 2022 Share Posted August 3, 2022 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. Quote 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 More sharing options...
Alienhead Posted August 3, 2022 Author Share Posted August 3, 2022 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... 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Recommended Posts
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.