db

package
v0.0.0-...-cd1bf01 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBFLAG_RW = "write"    //可读写
	DBFLAG_R  = "readonly" //只读
)
View Source
const AccountdbName = "plat_account_db"
View Source
const ConfigdbName = "plat_config_db"
View Source
const GamedbName = "game_data_db"
View Source
const LogdbName = "game_log_db"
View Source
const QttCoinTimes = 6
View Source
const QttH5CoinAddURL = "/x/open/coin/add"
View Source
const QttH5CoinSubURL = "/x/open/coin/sub"
View Source
const QttH5ServerURL = "https://newidea4-gamecenter-backend.1sapp.com"
View Source
const UserdbName = "game_user_db"

Variables

This section is empty.

Functions

func CheckPropEnoughForPay

func CheckPropEnoughForPay(userID int64, propList msg.UserPropChange) bool

func CorrectPropEnoughForPay

func CorrectPropEnoughForPay(userID int64, propList msg.UserPropChange)

修改数据

func DeleteOnline

func DeleteOnline(userid int64, srcGameID int32, srcRoomID string)

func FixTimePropDeadLine

func FixTimePropDeadLine(userID int64, propList []msg.UserPropChange)

func GernateTradeNo

func GernateTradeNo(userID int64) string

func GetDB

func GetDB(dbName string, userID int64, rwFlag string, bMaster bool) (*gorm.DB, error)

GetDB dbName:数据库名 rwFlag:write,readonly

func InsertOnline

func InsertOnline(UserID int64, GameID int32, ServerID string, AppID string, SiteID int32, ServerLevel int32, ChannelID int32, BranchID string)

func OpenDB

func OpenDB(dbinfo conf.DatabaseInfo) (dbconn *gorm.DB, err error)

func OpenDBGroup

func OpenDBGroup(dbinfo conf.DatabaseInfo) error

func SaveGameData

func SaveGameData(data msg.Accountwdatareq) error

func SaveGameRoundProperty

func SaveGameRoundProperty(data msg.Accountwdatareq)

SaveGameRoundProperty 游戏对局产生数据更新

func SaveQttCoin

func SaveQttCoin(thirdInfo model.AccountThirdpartInfo, coin int32, trade_no string, appKey string) error

func SaveSafeCtrl

func SaveSafeCtrl(safeCtrl msg.GameUserSafeCtrl)

func SaveSecurityInfo

func SaveSecurityInfo(asinfo model.AccountSecurityInfo)

func SaveThirdPartInfo

func SaveThirdPartInfo(atinfo model.AccountThirdpartInfo)

func SaveThirdPartyCurrency

func SaveThirdPartyCurrency(thirdInfo model.AccountThirdpartInfo, tradeNo string, appKey string, prop msg.UserPropChange) (bool, error)

func SaveUserAdInfo

func SaveUserAdInfo(userid int64, useradinfo model.GameUserAdInfo) error

func SaveUserDayTask

func SaveUserDayTask(userid int64, data msg.Accountwdatareq)

func SaveUserPropList

func SaveUserPropList(thirdInfo model.AccountThirdpartInfo, trade_no string, appKey string, propList []msg.UserPropChange) error

func SaveUserProperty

func SaveUserProperty(data msg.Accountwdatareq) error

SaveUserProperty 用户货币变化

func SelectAccSecurity

func SelectAccSecurity(userID int64) model.AccountSecurityInfo

func SelectAccount

func SelectAccount(datareq *msg.Accountrdatareq, account *msg.LoginRes) error

func SelectAccountSecurity

func SelectAccountSecurity(datareq *msg.Accountrdatareq, account *msg.LoginRes) error

func SelectClusterDetail

func SelectClusterDetail(clusterID string)

func SelectGameData

func SelectGameData(datareq *msg.Accountrdatareq, account *msg.LoginRes)

func SelectGameOnline

func SelectGameOnline()

func SelectSafeCtrl

func SelectSafeCtrl(userid int64) msg.GameUserSafeCtrl

func SelectServerInfo

func SelectServerInfo()

func SelectUserAdInfo

func SelectUserAdInfo(userid int64, useradinfo *model.GameUserAdInfo)

func SelectUserDayPorperty

func SelectUserDayPorperty(userid int64, property *model.GameUserDayProperty) bool

func SelectUserInfo

func SelectUserInfo(datareq *msg.Accountrdatareq, account *msg.LoginRes)

func StartDB

func StartDB() error

func UpdateATokenTTF

func UpdateATokenTTF(userID int64, token string)

func UpdateAcountAllTTF

func UpdateAcountAllTTF(key []string, userID int64, ttfs []time.Duration)

func UpdateUserDataTTF

func UpdateUserDataTTF(keys []string, userID int64, ttfs []time.Duration)

func WritePropList

func WritePropList(userid int64, data []model.GameUserBackpack)

func WriteServerInfo

func WriteServerInfo(roominfo conf.RoomInfoDef) interface{}

Types

type DBShareding

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

type ServerInfo

type ServerInfo struct {
	ClusterName       string `gorm:"primary_key:true;column:cluster_name;not null"  form:"cluster_name"`
	NodeName          string `gorm:"primary_key:true;"column:node_name;not null;"  form:"node_name"`
	NodeID            string `gorm:"primary_key:true;column:node_id;not null" form:"node_id"`
	GameID            int32  `gorm:column:game_id;not null"  form:"game_id"`
	ServerLevel       int32  `gorm:"column:server_level;not null;"  form:"server_level"`
	ServerStatus      int32  `gorm:"column:server_status;not null;"  form:"server_status"`
	GrayStatus        int8   `gorm:"column:gray_status;not null;"  form:"gray_status"`
	GameName          string `gorm:"column:game_name;not null;"  form:"game_name"`
	RouterName        string `gorm:"column:router_name;not null;"  form:"router_name"`
	ServerName        string `gorm:"column:server_name;not null;"  form:"server_name"`
	TCPAddr           string `gorm:"column:tcp_addr;not null;"  form:"tcp_addr"`
	RPCAddr           string `gorm:"column:rpc_addr;not null;"  form:"rpc_addr"`
	WSAddr            string `gorm:"column:ws_addr;not null;"  form:"ws_addr"`
	RoomCoinDownLimit int64  `gorm:"column:down_limit_coin"`
	RoomCoinUpLimit   int64  `gorm:"column:up_limit_coin"`
	CurOnlineNum      int32  `gorm:"column:online_num;not null;"  form:"online_num"`
	InfoPath          string `gorm:"column:info_path;not null;"  form:"info_path"`
	PID               int32  `gorm:"column:pid;not null;" form:"pid"`
	ProcessStatus     int8   `gorm:"column:process_status;not null;"  form:"process_status"`
	EnvType           int8
	ExtInfo           string    `gorm:"column:ext_info;not null;"  form:"ext_info"` //特殊信息
	CreateTime        time.Time `gorm:"column:create_time;not null;"  form:"create_time"`
	AIWinOrLoseMoney  int64     `gorm:"column:ai_winorlose_money"` //ai输赢钱
}

func (*ServerInfo) TableName

func (s *ServerInfo) TableName() string

Jump to

Keyboard shortcuts

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