Exemple #1
0
func SendGetUserInfoResult(errorCode int32, u *UserModel, session *link.Session) {
	if errorCode != 0 {
		SendErrorMsg(errorCode, session)
	} else {
		send_msg := MarshalProtoMsg(&GetUserInfoS2C{
			UserInfo: &Person{
				ID:        protos.Uint64(u.DBUser.ID),
				Name:      protos.String(u.DBUser.Name),
				Money:     protos.Int32(u.DBUser.Money),
				SessionID: protos.Uint64(session.Id()),
			},
		})
		Send(send_msg, session)
	}
}
Exemple #2
0
//发送通用错误消息
func SendErrorMsg(errID int32, session *link.Session) {
	send_msg := MarshalProtoMsg(&ErrorMsgS2C{
		ErrorID: protos.Int32(errID),
	})
	Send(send_msg, session)
}
//发送通用错误消息
func SendErrorMsg(session *link.Session, errID int32) {
	send_msg := protos.MarshalProtoMsg(&gameProto.ErrorMsgS2C{
		ErrorID: protos.Int32(errID),
	})
	protos.Send(session, send_msg)
}