Server info preview started.

This commit is contained in:
2016-10-06 20:48:35 +05:00
parent 11e3e4edb7
commit 5ba0664964
2 changed files with 166 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
// URTator - Urban Terror server browser and game launcher, written in
// Go.
//
// Copyright (c) 2016, Stanslav N. a.k.a pztrn (or p0z1tr0n)
// All rights reserved.
//
// Licensed under Terms and Conditions of GNU General Public License
// version 3 or any higher.
// ToDo: put full text of license here.
package ioq3dataparser
import (
// stdlib
"fmt"
"strings"
)
func ParseInfoToMap(data string) map[string]string {
fmt.Println(data)
parsed_data := make(map[string]string)
srv_config := strings.Split(data, "\\")
srv_config = srv_config[1:]
// Parse server configuration into passed server's datamodel.
for i := 0; i < len(srv_config[1:]); i = i + 2 {
parsed_data[srv_config[i]] = srv_config[i + 1]
fmt.Println(srv_config[i] + " => " + srv_config[i + 1])
}
fmt.Println(parsed_data)
return parsed_data
}