1 |
Attribute VB_Name = "Module_Network" |
2 |
Option Explicit |
3 |
|
4 |
Global Col_ucRemotePlayerConnections As New Collection |
5 |
' |
6 |
|
7 |
Public Sub AcceptRequest(lRequestID As Long) |
8 |
|
9 |
Dim ucPlayerSock As UserControl_RemotePlayerSock |
10 |
|
11 |
Set ucPlayerSock = Form_NetworkListen.UserControl_RemotePlayerSock |
12 |
|
13 |
ucPlayerSock.AcceptRequest lRequestID |
14 |
ucPlayerSock.lPlayerKey = clGame.AddPlayer(clGame.CreatePlayer(1, 0, 0, 0, "")) |
15 |
|
16 |
Col_ucRemotePlayerConnections.Add ucPlayerSock |
17 |
|
18 |
' Set ucPlayerSock = Nothing |
19 |
|
20 |
End Sub |
21 |
|
22 |
Public Sub SendPlayerData() |
23 |
|
24 |
Dim clPlayer As Class_Player |
25 |
|
26 |
Dim l As Long |
27 |
|
28 |
Dim ucConnection As UserControl_RemotePlayerSock |
29 |
|
30 |
For l = 1 To Col_ucRemotePlayerConnections.Count |
31 |
|
32 |
Set ucConnection = Col_ucRemotePlayerConnections(l) |
33 |
|
34 |
Set clPlayer = clGame.Col_clPlayers("p" & Col_ucRemotePlayerConnections(l).lPlayerKey) |
35 |
|
36 |
ucConnection.SendData "pr " & clPlayer.sgPosX & " " & clPlayer.sgPosY & " " & clPlayer.sgPosZ & " " & clPlayer.sgAngleY & vbCrLf |
37 |
|
38 |
Next l |
39 |
|
40 |
End Sub |