playerq

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package playerq does CRUD operations on the player pool in state storage. It is deprecated and will be folded into a more general internal Redis module in a future version.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(redisConn redis.Conn, playerID string, playerData string) error

Create adds a player's JSON representation to the current matchmaker state storage, and indexes all fields in that player's JSON object. All values in the JSON should be integers. Example:

player {
  "ping.us-east": 70,
  "ping.eu-central": 120,
  "map.sunsetvalley": "123456782", // TRUE flag key, epoch timestamp value
  "mode.ctf" // TRUE flag key, epoch timestamp value
}

func Delete

func Delete(redisConn redis.Conn, playerID string) error

Delete a player's JSON object representation from state storage, and attempt to remove the player's presence in any indexes.

func Retrieve

func Retrieve(redisConn redis.Conn, playerID string) (map[string]interface{}, error)

Retrieve a player's JSON object representation from state storage.

func Unindex

func Unindex(redisConn redis.Conn, playerID string) error

Unindex a player without deleting there JSON object representation from state storage.

func Update

func Update(redisConn redis.Conn, playerID string, playerData string) error

Update is an alias for Create() in this implementation

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL