File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package enet
3
3
import (
4
4
"bytes"
5
5
"encoding/binary"
6
+ "math/rand"
6
7
"net"
7
8
"os"
8
9
"os/signal"
@@ -39,13 +40,14 @@ func NewHost(addr string) (Host, error) {
39
40
ep , err := net .ResolveUDPAddr ("udp" , addr )
40
41
41
42
host := & enet_host {
42
- fail : 0 ,
43
- addr : ep ,
44
- incoming : make (chan * enet_host_incoming_command , 16 ),
45
- outgoing : make (chan * enet_host_outgoing_command , 16 ),
46
- tick : time .Tick (time .Millisecond * enet_default_tick_ms ),
47
- peers : make (map [string ]* enet_peer ),
48
- timers : new_enet_timer_queue (),
43
+ fail : 0 ,
44
+ addr : ep ,
45
+ incoming : make (chan * enet_host_incoming_command , 16 ),
46
+ outgoing : make (chan * enet_host_outgoing_command , 16 ),
47
+ tick : time .Tick (time .Millisecond * enet_default_tick_ms ),
48
+ peers : make (map [string ]* enet_peer ),
49
+ timers : new_enet_timer_queue (),
50
+ next_clientid : rand .Uint32 (),
49
51
}
50
52
if err == nil {
51
53
host .socket , err = net .ListenUDP ("udp" , ep )
You can’t perform that action at this time.
0 commit comments