VB Code:
Public Sub Ostats(ByVal Index As Integer) If frmServer.WStcpServer(Index).State <> sckClosed Then MsgSend = "~g" & "Welcome to Future Galaxy! There are ~w" & usersonline & "~g users connected and a total of ~w" & userstotal & "~g connections today." blnRetVal = WinsockSend(frmServer.WStcpServer(Index), MsgSend) End If End Sub 'Load character room for the first time Public Sub CharacterWelcome(ByVal Index As Integer) Dim i As Integer If Not rsuserdata.EOF Then rsuserdata.MoveFirst ' make sure your on the first one rsuserdata.FindFirst "Character='" & users(Index) & "'" 'Find the username userroom(Index) = roomidnumber(userroom(Index)) 'Room Number Call Ostats(Index) 'If joining the game say this For i = frmServer.WStcpServer.LBound + 1 To frmServer.WStcpServer.UBound If frmServer.WStcpServer(i).State <> sckClosed Then If userroom(i) = userroom(Index) Then 'In the room If Not users(i) = users(Index) Then 'User typed MsgSend = "~g" & users(Index) & " has just entered the game!" blnRetVal = WinsockSend(frmServer.WStcpServer(i), MsgSend) End If End If End If Next Call CheckRoom(Index) Call CharacterRoomA(Index) End Sub
Generally the CharacterWelcome goes first. It will call ostats though. Generally CaracaterRoomA is where it sends more data, it sends this after getting some quick data:
VB Code:
If firstchar = 1 Then If frmServer.WStcpServer(Index).State <> sckClosed Then MsgSend = "¿csdl¶" & Sidelist blnRetVal = WinsockSend(frmServer.WStcpServer(Index), MsgSend) MsgSend = "~w<~g" & roomtitle(userroom(Index)) & "~w> " & roomdescription(userroom(Index)) & " " & Charsinroom & " is here with you. There is a " & LCase(itemsinroom) & " here." blnRetVal = WinsockSend(frmServer.WStcpServer(Index), MsgSend) End If
What happens there is it sends the room data right after the Ostats to the player that joins.
Oh, and WinsockSend is how it sends it:
VB Code:
Public Function WinsockSend(pSock As Winsock, ByVal Data As String) As Boolean ' send the data on the passed winsock If pSock.State = sckConnected Then ' send the data and return true pSock.SendData Data & packetDelimiter DoEvents WinsockSend = True Else ' return false because we're not connected WinsockSend = False End If End Function
The packetdelim is 'packetDelimiter = Chr$(0)'
---
This is what it looks like in a text box (SAMPLE) on connect:
Welcome to Future Galaxy! There are 1 users connected and a total of 1 connections today.
<Dark Room> You are in a dark room. You can see faint light coming from a door to the south.
But sometimes it will do this, this is for any data, but this is a sample. Again this would be on connect.
<Dark Room> You are in a dark room. You can see faint light coming from a door to the south.
Welcome to Future Galaxy! There are 1 users connected and a total of 1 connections today.
As you see it will basicly jump around depending if it was sent to quickly. I don't lose any data, but it seems like its placing the last data recieved on first if two data are send together quickly.
P.S. Ignore the ~w, ~g, etc. Those are for color sending.




Reply With Quote