3manchess: github.com/ArchieT/3manchess/server/mojsql Index | Files

package mojsql

import "github.com/ArchieT/3manchess/server/mojsql"

Index

Package Files

bits.go mojsql.go

type MojSQL Uses

type MojSQL struct {
    // contains filtered or unexported fields
}

MojSQL is an instance of sql binding

func (*MojSQL) AfterMDwPlayers Uses

func (m *MojSQL) AfterMDwPlayers(beforegp int64, players [3]*int64) (out []server.MoveFollow, err error)

AfterMDwPlayers takes the before GameplayID and W,G,B players and returns the after gameplays with the same players

func (*MojSQL) AfterMDwe Uses

func (m *MojSQL) AfterMDwe(beforegp int64) (out []server.MoveFollow, err error)

AfterMD lists moves after the selected gameplay

func (*MojSQL) Auth Uses

func (m *MojSQL) Auth(userid int64, authkey []byte) (bool, error)

Auth authenticates by UserID

func (*MojSQL) BAuth Uses

func (m *MojSQL) BAuth(botid int64, authkey []byte) (bool, error)

BAuth authenticates by BotID

func (*MojSQL) BeforeMD Uses

func (m *MojSQL) BeforeMD(aftergp int64) (out []server.MoveFollow, err error)

func (*MojSQL) BotInfo Uses

func (m *MojSQL) BotInfo(botid int64) (whoami []byte, owner int64, ownname string, player int64, settings []byte, err error)

BotInfo gets info about a bot from db

func (*MojSQL) BotKey Uses

func (m *MojSQL) BotKey(botid int64, userid int64, uauth []byte) (playerid int64, botauth []byte, err error)

BotKey : BOTID+USER(ID+AUTH) → BOT(PLAYERID+AUTH)

func (*MojSQL) BotOwnerLoginAndName Uses

func (m *MojSQL) BotOwnerLoginAndName(botid int64) (login string, name string, err error)

BotOwnerLoginAndName : BOTID → OWNER(LOGIN+NAME) //TO BE DEPRECATED

func (*MojSQL) GetAuth Uses

func (m *MojSQL) GetAuth(playerid int64) (authkey []byte, err error)

GetAuth : PLAYER(ID) → PLAYER(AUTH)

func (*MojSQL) Initialize Uses

func (m *MojSQL) Initialize(username string, password string, database string) error

Initialize initializes the sql binding

func (*MojSQL) Interface Uses

func (m *MojSQL) Interface() server.Server

Interface returns server.Server(m)

func (*MojSQL) ListGP Uses

func (m *MojSQL) ListGP(many uint) (h []server.GameplayFollow, err error)

ListGP selects {number} newest Gameplays in db

func (*MojSQL) LoadGP Uses

func (m *MojSQL) LoadGP(key int64, gpd *server.GameplayData) error

LoadGP gets GameplayData from db

func (*MojSQL) LoadMD Uses

func (m *MojSQL) LoadMD(key int64, md *server.MoveData) (err error)

LoadMD gets MoveData from db

func (*MojSQL) LoadSD Uses

func (m *MojSQL) LoadSD(key int64, sd *game.StateData) error

LoadSD gets StateData from db

func (*MojSQL) LogIn Uses

func (m *MojSQL) LogIn(login string, passwd string) (userid int64, authkey []byte, err error)

LogIn : USER(LOGIN + PASSWD) → USER(ID + AUTH)

func (*MojSQL) NewBot Uses

func (m *MojSQL) NewBot(whoami []byte, userid int64, uauth []byte, ownname string, settings []byte) (botid int64, playerid int64, botauth []byte, err error)

NewBot : NEW_BOT(WHOAMI+OWNNAME+SETTINGS) + USER(ID+AUTH) → BOT(ID + PLAYERID + AUTH)

func (*MojSQL) NewPlayer Uses

func (m *MojSQL) NewPlayer() (playerid int64, authkey []byte, err error)

NewPlayer creates a new player and gives PLAYER(ID + AUTH)

func (*MojSQL) OwnersBots Uses

func (m *MojSQL) OwnersBots(owner int64) (out []server.BotFollow, err error)

func (*MojSQL) PAuth Uses

func (m *MojSQL) PAuth(playerid int64, authkey []byte) (bool, error)

PAuth authenticates by PlayerID

func (*MojSQL) SaveGP Uses

func (m *MojSQL) SaveGP(gpd *server.GameplayData) (int64, error)

SaveGP inserts GameplayData into db

func (*MojSQL) SaveMD Uses

func (m *MojSQL) SaveMD(md *server.MoveData) (key int64, err error)

SaveMD inserts MoveData into db

func (*MojSQL) SaveSD Uses

func (m *MojSQL) SaveSD(sd *game.StateData) (key int64, err error)

SaveSD inserts StateData into db

func (*MojSQL) SignUp Uses

func (m *MojSQL) SignUp(login string, passwd string, name string) (userid int64, playerid int64, authkey []byte, err error)

SignUp : NEW_USER(LOGIN + PASSWD + NAME) → USER(ID + PLAYERID + AUTH)

func (*MojSQL) UserInfo Uses

func (m *MojSQL) UserInfo(userid int64) (login string, name string, playerid int64, err error)

UserInfo gets info about a user from db

func (*MojSQL) WhoIsIt Uses

func (m *MojSQL) WhoIsIt(playerid int64) (id int64, isitabot bool, err error)

WhoIsIt : PLAYERID → (BOT/USER)(ID) + ?[BOT/USER]¿ WhoIsIt takes a playerid, and returns userid or bot id, then true if it is a bot or false if it's a user

Package mojsql imports 8 packages (graph) and is imported by 1 packages. Updated 2016-07-20. Refresh now. Tools for package owners.