Hey, Im having problems checking to see if there is a player that has joined, I think me and friend of mine have figured out the SocketAccept part, but now were trying to send data to double check this.. info
there is the code please help
Global HostSocket Global HostStream Global JoinSocket Global JoinStream Global RData:Byte Global SData:Byte Global planelist:TList = CreateList() Global p:netplane Const PLAYER_JOIN = 100 Const PLAYER_LEFT = 101 Function CreateHostGame:Int(Port:Int) HostSocket = CreateTCPSocket() BindSocket HostSocket,Port HostStream = CreateSocketStream(HostSocket) SocketListen HostSocket End Function Function HostData() Local NewSocket = SocketAccept(HostSocket) If NewSocket If ReadByte(HostStream)=PLAYER_JOIN Then DrawText "Player Joined...",8,32 EndIf End Function Function JoinData() DrawText DottedIP(SocketRemoteIP(JoinSocket))+":"+SocketRemotePort(JoinSocket),8,8 DrawText SocketReadAvail(JoinSocket),8,32 End Function Function ConnectGame(IP:String,Port:Int) JoinSocket = CreateTCPSocket() ConnectSocket JoinSocket,HostIp(IP),Port JoinStream = CreateSocketStream(JoinSocket) End Function
there is the code please help