-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_run_test.go
More file actions
40 lines (35 loc) · 1005 Bytes
/
server_run_test.go
File metadata and controls
40 lines (35 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package dplay_test
import (
"fmt"
"log"
"testing"
dplay "github.com/utrack/dplay-go"
)
func TestRunServerFreelancer(t *testing.T) {
ServerID := "00000000-00000000-00000000-00000000"
Description := "desc"
Version := "16777227" // grep server_version of FOS
adata := dplay.NewDataPackage()
ispvp := 1
adata.AddString(fmt.Sprintf(`%v:1:%v:-1910309061:%v:`, ispvp, Version, ServerID))
adata.AddStringUnicodeTerm(Description)
opts := dplay.ServerOptions{
EnumResponseData: func() []byte { return adata.Bytes() },
Name: "OpenFL Server",
PlayerCount: func() uint { return 0 },
MaxPlayers: 5,
ApplicationGUID: []byte{
0x26, 0xf0, 0x90, 0xa6, 0xf0, 0x26, 0x57, 0x4e, 0xac, 0xa0, 0xec, 0xf8,
0x68, 0xe4, 0x8d, 0x21,
},
ApplicationInstanceGUID: []byte{
0xa8, 0xc6, 0x27, 0x1d, 0x41, 0x66, 0xd8, 0x49, 0x89, 0xeb, 0x1e,
0xbc, 0x42, 0x21, 0xca, 0xe9,
},
}
s, err := dplay.NewServer(":2302", opts)
if err != nil {
log.Fatal(err)
}
s.Listen()
}