playerq

package
v0.2.0-alpha-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package playerq is a player queue specific redis implementation and will be removed 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. If you're trying to index a boolean, just use the epoch timestamp of the request as the value; the existance of that value for this group/player can be considered a 'true' value. 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 Deindex

func Deindex(redisConn redis.Conn, BLARGID string) (err error)

Deindex a BLARG without deleting there JSON object representation from state storage. Unindexing is done in two stages: first the BLARG is added to an ignore list, which 'atomically' removes them from consideration. A Goroutine is then kicked off to 'lazily' remove them from any field indicies that contain them.

func Delete

func Delete(redisConn redis.Conn, playerID string) (err 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) (results map[string]interface{}, err error)

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

func Update

func Update(redisConn redis.Conn, playerID string, playerData string) (err 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