Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Multisync sending wrong bytes

Author
Message
misifield
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location: ohio
Posted: 27th Nov 2012 12:22
Hello everyone, I have been working on a project and I am adding some networking now. My small scale tests worked by sending a byte to trigger a specific if statement and 2 strings for user name and password. I have recently added a new one to get the the network ID from the net message from and then send it back to the client. Now the username and password byte is 105 and sometimes 115. I was using NetSend(0) and I have tried NetSend(1) then 0. I do not know where I am going wrong with sending network messages because the first username and password sent correctly.
A change in my code is getting the network ID

This is the code I am having problems with, I send to the network and I get 115 as the byte or 105 sometimes.

This is the code in the client so far that receives messages from the main loop, if it gets a net message it sends it to this, but I cant get the server to accept the login message so there is nothing to send back.



Other than while loops, this is all of the networking my program does. It seems simple to send a net message and I think it is. I just dont know what I am doing wrong with it. I hope someone can help me out. I can post more code if needed, but this is the networking stuff. Below is the server and everything above is the client. Also, the first part to get network id seems to work correctly.


mfield
misifield
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location: ohio
Posted: 28th Nov 2012 20:58
Hello All,

I figured it out (no problems yet anyways). What I did was received the NetGetByte into a variable and use if statements with the variable. I think what was happening is the first if statement if (NetGetByte()==0) was actually taking the byte out of the message so the next thing to check was a string.

mfield

Login to post a reply

Server time is: 2024-04-16 11:12:32
Your offset time is: 2024-04-16 11:12:32