Documentation
¶
Index ¶
- Constants
- func C(collection string) *mgo.Collection
- func GenRoomID() (uint64, error)
- func GenUserID() (string, error)
- func InitIDGen()
- type CarRecord
- type CreateRoomRecord
- type DataResChange
- type DataResChanges
- type DataUserActive
- type GameOverRecord
- type GameOverRecords
- type GameOverRoundRecord
- type GameOverUserRecord
- type GameRecordPrivate
- type GameRecordPrivateUser
- type RoomIDGen
- type ServerIDGen
- type Statistics
- type User
- func (this *User) ExistsPhone(phone string) bool
- func (this *User) Get() error
- func (this *User) GetByPhone() string
- func (this *User) GetByWechat(wechat string) error
- func (this *User) GetPhotoFromDB() (string, error)
- func (this *User) GetPhotoSexName() error
- func (this *User) PWDIsOK(pwd string) bool
- func (this *User) Save() error
- func (this *User) UpdateNickname() error
- func (this *User) UpdatePWD(pwd string) error
- func (this *User) UpdateParent() error
- func (this *User) UpdatePhoto() error
- func (this *User) UpdateResource(value map[string]int32) error
- func (this *User) UpdateSex() error
- func (this *User) VerifyPwdByPhone(pwd string) bool
Constants ¶
View Source
const ( LIMIT_MAX = 200 // 每页最大记录数量 LIMIT_MIN = 20 // 每页最小记录数量 )
View Source
const (
RESTYPE4 = 4 //私人局
)
Variables ¶
This section is empty.
Functions ¶
func C ¶
func C(collection string) *mgo.Collection
Types ¶
type CarRecord ¶
type CreateRoomRecord ¶
type CreateRoomRecord struct {
Userid string `bson:"Userid"` // 开房玩家id
Roomid uint32 `bson:"Roomid"` // 房间id
Round uint32 `bson:"Round"` // 房间局数
Invitecode string `bson:"Invitecode"` // 房间邀请码
Maizi bool `bson:"Maizi"` // 是否买子
Cost uint32 `bson:"Cost"` // 房间消耗
Ante uint32 `bson:"Ante"` // 底分
Expire time.Time `bson:"Expire"` // 房间过期时间
Date time.Time `bson:"Date"` // 时间创建时间戳
}
开房记录
func (*CreateRoomRecord) Save ¶
func (this *CreateRoomRecord) Save() error
type DataResChange ¶
type DataResChanges ¶
type DataResChanges []*DataResChange
func (*DataResChanges) Save ¶
func (this *DataResChanges) Save(userid string) error
type DataUserActive ¶
type GameOverRecord ¶
type GameOverRecord struct {
RoomId uint32 `bson:"_id"` //房间ID
Invitecode string `bson:"Invitecode"` //房间邀请码
TotalRound uint32 `bson:"TotalRound"` //牌局局数
Ante uint32 `bson:"Ante"` //底分
Userids []string `bson:"Userids"` //用户账号id
Ctime uint32 `bson:"Ctime"` //房间创建时间
Cid string `bson:"Create_userid"` //房间创建人
Expire uint32 `bson:"Expire"` //牌局设定的过期时间
Create uint32 `bson:"Create"` //记录创建时间
Update uint32 `bson:"Update"` //记录更新时间
Rounds []*GameOverRoundRecord `bson:"Rounds"`
}
牌局记录
func (*GameOverRecord) Add ¶
func (this *GameOverRecord) Add() error
func (*GameOverRecord) Get ¶
func (this *GameOverRecord) Get(userid string) error
type GameOverRoundRecord ¶
type GameOverRoundRecord struct {
Users []*GameOverUserRecord `bson:"Users"`
Round uint32 `bson:"Round"` //牌局局数
Zhuang uint32 `bson:"Zhuang"` //庄家的座位
Hutype uint32 `bson:"Hutype"` //1:自摸,2:炮胡,3:黄庄
}
func (*GameOverRoundRecord) Push ¶
func (this *GameOverRoundRecord) Push(roomId uint32) error
type GameOverUserRecord ¶
type GameRecordPrivate ¶
type GameRecordPrivate struct {
Id string `bson:"_id"` //房间ID
RoomId uint32 `bson:"RoomId"`
Rtype uint32 `bson:"Rtype"` //房间类型
Ante uint32 `bson:"Ante"` //底分
Userids []string `bson:"Userids"` //用户账号id
Users []*GameRecordPrivateUser `bson:"Users"`
Ji byte `bson:"Ji"` //
HeroJi uint32 `bson:"HeroJi"` // 0:无,1:英雄鸡,2:责任鸡,3:责任鸡碰方
HuCard byte `bson:"HuCard"`
Ctime uint32 `bson:"Ctime"`
Zhuang uint32 `bson:"Zhuang"`
Invitecode string `bson:"Invitecode"`
TotalRound uint32 `bson:"TotalRound"` //牌局局数
Payment uint32 `bson:"Payment"` //付费方式1=AA or 0=房主支付
Create_userid string `bson:"Create_userid"` //房间创建人
Expire uint32 `bson:"Expire"` //牌局设定的过期时间
Rname string `bson:"Rname"` //房间名字
Round uint32 `bson:"Round"` //牌局局数
}
func (*GameRecordPrivate) Save ¶
func (this *GameRecordPrivate) Save() error
type GameRecordPrivateUser ¶
type GameRecordPrivateUser struct {
Seat uint32 `bson:"Seat"` //用户位置
Coin int32 `bson:"Coin"` //输赢
Userid string `bson:"Userid"` //用户账号id
StartHandCards []byte `bson:"StartHandCards"`
EndHandCards []byte `bson:"EndHandCards"`
OutCards []byte `bson:"OutCards"`
Peng []uint32 `bson:"Peng"` //
Kong []uint32 `bson:"Kong"` //
HuValue uint32 `bson:"HuValue"` //胡牌状态
TingValue uint32 `bson:"TingValue"` //停牌状态
HuCard uint32 `bson:"HuCard"`
}
type ServerIDGen ¶
func (*ServerIDGen) Exists ¶
func (this *ServerIDGen) Exists() bool
func (*ServerIDGen) Get ¶
func (this *ServerIDGen) Get() (string, error)
func (*ServerIDGen) Insert ¶
func (this *ServerIDGen) Insert() error
type Statistics ¶
type Statistics struct {
Name string `bson:"Name"` // 统计在线的结构体名称
Date time.Time `bson:"Date"` // 时间戳
Total uint32 `bson:"Total"` // 当前在线的玩家的数据
}
func (*Statistics) Save ¶
func (this *Statistics) Save() error
type User ¶
type User struct {
Userid string `bson:"_id"` // 用户id
Nickname string `bson:"Nickname"` // 用户昵称
Sex uint32 `bson:"Sex"` // 用户性别,男1 女2 非男非女3
Email string `bson:"Email"` // 绑定的邮箱地址
Phone string `bson:"Phone"` // 绑定的手机号码
Auth string `bson:"Auth"` // 密码验证码
Pwd string `bson:"Pwd"` // MD5密码
Create_ip uint32 `bson:"Create_ip"` // 注册账户时的IP地址
Create_time uint32 `bson:"Create_time"` // 注册时间
Terminal string `bson:"Terminal"` // 终端类型名字
Status uint32 `bson:"Status"` // 正常1 锁定2 黑名单3
Address string `bson:"Address"` //物理地址
Photo string `bson:"Photo"` //头像
Qq_uid string `bson:"Qq_uid"` //
Wechat_uid string `bson:"Wechat_uid"`
Microblog_uid string `bson:"Microblog_uid"`
Platform uint32 `bson:"Platform"`
Robot bool `bson:"Robot"` //是否是机器人
RoomCard uint32 `bson:"RoomCard"` //房卡
Build string `bson:"Build"` //绑定id
Longitude string `bson:"Longitude"` // 经度
Latitude string `bson:"Latitude"` // 纬度
}
func (*User) ExistsPhone ¶
func (*User) GetByPhone ¶
func (*User) GetByWechat ¶
func (*User) GetPhotoFromDB ¶
func (*User) UpdateNickname ¶
func (*User) UpdateParent ¶
func (*User) UpdatePhoto ¶
func (*User) UpdateResource ¶
批量更改玩家的经济资源
func (*User) VerifyPwdByPhone ¶
Click to show internal directories.
Click to hide internal directories.