mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:22:26 +08:00
init commit
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -13,3 +13,10 @@
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# GoLand
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
# Binaries file
|
||||
bin
|
||||
|
||||
195
air-api/client/discovery.go
Normal file
195
air-api/client/discovery.go
Normal file
@@ -0,0 +1,195 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
var httpClient http.Client
|
||||
var airAddr string
|
||||
var airPort int
|
||||
|
||||
func init() {
|
||||
httpClient = http.Client{
|
||||
Transport: &http.Transport{
|
||||
DisableKeepAlives: true,
|
||||
},
|
||||
Timeout: time.Second * 60,
|
||||
}
|
||||
}
|
||||
|
||||
// 设置注册发现中心地址
|
||||
func SetAirAddr(addr string, port int) {
|
||||
airAddr = addr
|
||||
airPort = port
|
||||
}
|
||||
|
||||
// 获取某个HTTP服务的所有实例
|
||||
func FetchHttpService(name string) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/http/fetch" +
|
||||
"?name=" + name
|
||||
return getAirServiceCore(url)
|
||||
}
|
||||
|
||||
// 获取全部HTTP服务的实例
|
||||
func FetchAllHttpService() (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/http/fetch/all"
|
||||
return getAirServiceCore(url)
|
||||
}
|
||||
|
||||
// 长轮询某个HTTP服务的实例状态变化
|
||||
func PollHttpService(name string) (*ResponseData, error) {
|
||||
lastTime := int64(0)
|
||||
for {
|
||||
nowTime := time.Now().UnixNano()
|
||||
if time.Duration(nowTime-lastTime) < time.Second {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
continue
|
||||
}
|
||||
lastTime = time.Now().UnixNano()
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/poll/http" +
|
||||
"?name=" + name
|
||||
responseData, err := getAirServiceCore(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if responseData.Code != 0 {
|
||||
return nil, errors.New("response code error")
|
||||
}
|
||||
if responseData.Instance == nil {
|
||||
continue
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
}
|
||||
|
||||
// 长轮询全部HTTP服务的实例状态变化
|
||||
func PollAllHttpService() (*ResponseData, error) {
|
||||
lastTime := int64(0)
|
||||
for {
|
||||
nowTime := time.Now().UnixNano()
|
||||
if time.Duration(nowTime-lastTime) < time.Second {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
continue
|
||||
}
|
||||
lastTime = time.Now().UnixNano()
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/poll/http/all"
|
||||
responseData, err := getAirServiceCore(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if responseData.Code != 0 {
|
||||
return nil, errors.New("response code error")
|
||||
}
|
||||
if responseData.Service == nil {
|
||||
continue
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
}
|
||||
|
||||
// 获取某个RPC服务的所有实例
|
||||
func FetchRpcService(name string) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/rpc/fetch" +
|
||||
"?name=" + name
|
||||
return getAirServiceCore(url)
|
||||
}
|
||||
|
||||
// 获取全部RPC服务的实例
|
||||
func FetchAllRpcService() (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/rpc/fetch/all"
|
||||
return getAirServiceCore(url)
|
||||
}
|
||||
|
||||
// 长轮询某个RPC服务的实例状态变化
|
||||
func PollRpcService(name string) (*ResponseData, error) {
|
||||
lastTime := int64(0)
|
||||
for {
|
||||
nowTime := time.Now().UnixNano()
|
||||
if time.Duration(nowTime-lastTime) < time.Second {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
continue
|
||||
}
|
||||
lastTime = time.Now().UnixNano()
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/poll/rpc" +
|
||||
"?name=" + name
|
||||
responseData, err := getAirServiceCore(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if responseData.Code != 0 {
|
||||
return nil, errors.New("response code error")
|
||||
}
|
||||
if responseData.Instance == nil {
|
||||
continue
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
}
|
||||
|
||||
// 长轮询全部RPC服务的实例状态变化
|
||||
func PollAllRpcService() (*ResponseData, error) {
|
||||
lastTime := int64(0)
|
||||
for {
|
||||
nowTime := time.Now().UnixNano()
|
||||
if time.Duration(nowTime-lastTime) < time.Second {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
continue
|
||||
}
|
||||
lastTime = time.Now().UnixNano()
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/poll/rpc/all"
|
||||
responseData, err := getAirServiceCore(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if responseData.Code != 0 {
|
||||
return nil, errors.New("response code error")
|
||||
}
|
||||
if responseData.Service == nil {
|
||||
continue
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
}
|
||||
|
||||
func getAirServiceCore(url string) (*ResponseData, error) {
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rsp, err := httpClient.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data, err := ioutil.ReadAll(rsp.Body)
|
||||
_ = rsp.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
responseData := new(ResponseData)
|
||||
err = json.Unmarshal(data, responseData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
84
air-api/client/register.go
Normal file
84
air-api/client/register.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// 注册HTTP服务
|
||||
func RegisterHttpService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/http/reg"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
// HTTP服务心跳保持
|
||||
func KeepaliveHttpService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/http/ka"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
// 取消注册HTTP服务
|
||||
func CancelHttpService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/http/cancel"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
// 注册RPC服务
|
||||
func RegisterRpcService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/rpc/reg"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
// RPC服务心跳保持
|
||||
func KeepaliveRpcService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/rpc/ka"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
// 取消注册RPC服务
|
||||
func CancelRpcService(inst Instance) (*ResponseData, error) {
|
||||
url := "http://" +
|
||||
airAddr + ":" + strconv.Itoa(airPort) +
|
||||
"/rpc/cancel"
|
||||
return postAirServiceCore(url, inst)
|
||||
}
|
||||
|
||||
func postAirServiceCore(url string, inst Instance) (*ResponseData, error) {
|
||||
reqData, err := json.Marshal(inst)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req, err := http.NewRequest("POST", url, bytes.NewBuffer(reqData))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
rsp, err := httpClient.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rspData, err := ioutil.ReadAll(rsp.Body)
|
||||
_ = rsp.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
responseData := new(ResponseData)
|
||||
err = json.Unmarshal(rspData, responseData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return responseData, nil
|
||||
}
|
||||
15
air-api/client/service.go
Normal file
15
air-api/client/service.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package client
|
||||
|
||||
// 服务实例
|
||||
type Instance struct {
|
||||
ServiceName string `json:"service_name"`
|
||||
InstanceName string `json:"instance_name"`
|
||||
InstanceAddr string `json:"instance_addr"`
|
||||
}
|
||||
|
||||
// 注册中心响应实体类
|
||||
type ResponseData struct {
|
||||
Code int `json:"code"`
|
||||
Service map[string][]Instance `json:"service"`
|
||||
Instance []Instance `json:"instance"`
|
||||
}
|
||||
3
air-api/go.mod
Normal file
3
air-api/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module air-api
|
||||
|
||||
go 1.19
|
||||
6
air/cmd/application.toml
Normal file
6
air/cmd/application.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
http_port = 8086
|
||||
|
||||
[logger]
|
||||
level = "DEBUG"
|
||||
method = "CONSOLE"
|
||||
track_line = true
|
||||
55
air/cmd/main.go
Normal file
55
air/cmd/main.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"air/controller"
|
||||
"air/service"
|
||||
"flswld.com/common/config"
|
||||
"flswld.com/logger"
|
||||
"github.com/arl/statsviz"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
filePath := "./application.toml"
|
||||
config.InitConfig(filePath)
|
||||
|
||||
logger.InitLogger()
|
||||
logger.LOG.Info("air start")
|
||||
|
||||
go func() {
|
||||
// 性能检测
|
||||
err := statsviz.RegisterDefault()
|
||||
if err != nil {
|
||||
logger.LOG.Error("statsviz init error: %v", err)
|
||||
}
|
||||
err = http.ListenAndServe("0.0.0.0:1234", nil)
|
||||
if err != nil {
|
||||
logger.LOG.Error("perf debug http start error: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
svc := service.NewService()
|
||||
|
||||
_ = controller.NewController(svc)
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
|
||||
for {
|
||||
s := <-c
|
||||
logger.LOG.Info("get a signal %s", s.String())
|
||||
switch s {
|
||||
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
|
||||
logger.LOG.Info("air exit")
|
||||
time.Sleep(time.Second)
|
||||
return
|
||||
case syscall.SIGHUP:
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
48
air/controller/controller.go
Normal file
48
air/controller/controller.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"air/service"
|
||||
"flswld.com/common/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
service *service.Service
|
||||
}
|
||||
|
||||
func NewController(service *service.Service) (r *Controller) {
|
||||
r = new(Controller)
|
||||
r.service = service
|
||||
go r.registerRouter()
|
||||
return r
|
||||
}
|
||||
|
||||
func (c *Controller) registerRouter() {
|
||||
if config.CONF.Logger.Level == "DEBUG" {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
} else {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
engine := gin.Default()
|
||||
// HTTP
|
||||
engine.GET("/http/fetch", c.fetchHttpService)
|
||||
engine.GET("/http/fetch/all", c.fetchAllHttpService)
|
||||
engine.POST("/http/reg", c.registerHttpService)
|
||||
engine.POST("/http/cancel", c.cancelHttpService)
|
||||
engine.POST("/http/ka", c.httpKeepalive)
|
||||
// RPC
|
||||
engine.GET("/rpc/fetch", c.fetchRpcService)
|
||||
engine.GET("/rpc/fetch/all", c.fetchAllRpcService)
|
||||
engine.POST("/rpc/reg", c.registerRpcService)
|
||||
engine.POST("/rpc/cancel", c.cancelRpcService)
|
||||
engine.POST("/rpc/ka", c.rpcKeepalive)
|
||||
// 长轮询
|
||||
engine.GET("/poll/http", c.pollHttpService)
|
||||
engine.GET("/poll/http/all", c.pollAllHttpService)
|
||||
engine.GET("/poll/rpc", c.pollRpcService)
|
||||
engine.GET("/poll/rpc/all", c.pollAllRpcService)
|
||||
port := strconv.FormatInt(int64(config.CONF.HttpPort), 10)
|
||||
portStr := ":" + port
|
||||
_ = engine.Run(portStr)
|
||||
}
|
||||
39
air/controller/fetch_controller.go
Normal file
39
air/controller/fetch_controller.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package controller
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
// 获取HTTP服务
|
||||
func (c *Controller) fetchHttpService(context *gin.Context) {
|
||||
inst := c.service.FetchHttpService(context.Query("name"))
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
"instance": inst,
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有HTTP服务
|
||||
func (c *Controller) fetchAllHttpService(context *gin.Context) {
|
||||
svc := c.service.FetchAllHttpService()
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
"service": svc,
|
||||
})
|
||||
}
|
||||
|
||||
// 获取RPC服务
|
||||
func (c *Controller) fetchRpcService(context *gin.Context) {
|
||||
inst := c.service.FetchRpcService(context.Query("name"))
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
"instance": inst,
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有RPC服务
|
||||
func (c *Controller) fetchAllRpcService(context *gin.Context) {
|
||||
svc := c.service.FetchAllRpcService()
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
"service": svc,
|
||||
})
|
||||
}
|
||||
35
air/controller/keepalive_controller.go
Normal file
35
air/controller/keepalive_controller.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/logger"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// HTTP心跳
|
||||
func (c *Controller) httpKeepalive(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.HttpKeepalive(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
|
||||
// RPC心跳
|
||||
func (c *Controller) rpcKeepalive(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.RpcKeepalive(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
85
air/controller/poll_controller.go
Normal file
85
air/controller/poll_controller.go
Normal file
@@ -0,0 +1,85 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (c *Controller) pollHttpService(context *gin.Context) {
|
||||
serviceName := context.Query("name")
|
||||
recvrNtfr := c.service.RegistryHttpNotifyReceiver(serviceName)
|
||||
timeout := time.NewTicker(time.Second * 30)
|
||||
select {
|
||||
case inst := <-recvrNtfr.NotifyChannel:
|
||||
c.service.CancelHttpNotifyReceiver(serviceName, recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"instance": inst,
|
||||
})
|
||||
case <-timeout.C:
|
||||
c.service.CancelHttpNotifyReceiver(serviceName, recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"instance": nil,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) pollAllHttpService(context *gin.Context) {
|
||||
recvrNtfr := c.service.RegistryAllHttpNotifyReceiver()
|
||||
timeout := time.NewTicker(time.Second * 30)
|
||||
select {
|
||||
case svc := <-recvrNtfr.NotifyChannel:
|
||||
c.service.CancelAllHttpNotifyReceiver(recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"service": svc,
|
||||
})
|
||||
case <-timeout.C:
|
||||
c.service.CancelAllHttpNotifyReceiver(recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"service": nil,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) pollRpcService(context *gin.Context) {
|
||||
serviceName := context.Query("name")
|
||||
recvrNtfr := c.service.RegistryRpcNotifyReceiver(serviceName)
|
||||
timeout := time.NewTicker(time.Second * 30)
|
||||
select {
|
||||
case inst := <-recvrNtfr.NotifyChannel:
|
||||
c.service.CancelRpcNotifyReceiver(serviceName, recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"instance": inst,
|
||||
})
|
||||
case <-timeout.C:
|
||||
c.service.CancelRpcNotifyReceiver(serviceName, recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"instance": nil,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Controller) pollAllRpcService(context *gin.Context) {
|
||||
recvrNtfr := c.service.RegistryAllRpcNotifyReceiver()
|
||||
timeout := time.NewTicker(time.Second * 30)
|
||||
select {
|
||||
case svc := <-recvrNtfr.NotifyChannel:
|
||||
c.service.CancelAllRpcNotifyReceiver(recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"service": svc,
|
||||
})
|
||||
case <-timeout.C:
|
||||
c.service.CancelAllRpcNotifyReceiver(recvrNtfr.Id)
|
||||
context.JSON(http.StatusOK, gin.H{
|
||||
"code": 0,
|
||||
"service": nil,
|
||||
})
|
||||
}
|
||||
}
|
||||
63
air/controller/registry_controller.go
Normal file
63
air/controller/registry_controller.go
Normal file
@@ -0,0 +1,63 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/logger"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 注册HTTP服务
|
||||
func (c *Controller) registerHttpService(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.RegisterHttpService(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
|
||||
// 取消注册HTTP服务
|
||||
func (c *Controller) cancelHttpService(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.CancelHttpService(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
|
||||
// 注册RPC服务
|
||||
func (c *Controller) registerRpcService(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.RegisterRpcService(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
|
||||
// 取消注册RPC服务
|
||||
func (c *Controller) cancelRpcService(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.CancelRpcService(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
8
air/entity/instance.go
Normal file
8
air/entity/instance.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package entity
|
||||
|
||||
// 服务实例实体类
|
||||
type Instance struct {
|
||||
ServiceName string `json:"service_name"`
|
||||
InstanceName string `json:"instance_name"`
|
||||
InstanceAddr string `json:"instance_addr"`
|
||||
}
|
||||
33
air/go.mod
Normal file
33
air/go.mod
Normal file
@@ -0,0 +1,33 @@
|
||||
module air
|
||||
|
||||
go 1.19
|
||||
|
||||
require flswld.com/common v0.0.0-incompatible
|
||||
|
||||
replace flswld.com/common => ../common
|
||||
|
||||
require flswld.com/logger v0.0.0-incompatible
|
||||
|
||||
replace flswld.com/logger => ../logger
|
||||
|
||||
require github.com/gin-gonic/gin v1.6.3
|
||||
|
||||
require github.com/arl/statsviz v0.5.1
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-playground/locales v0.13.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.17.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.2.0 // indirect
|
||||
github.com/golang/protobuf v1.3.3 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // indirect
|
||||
github.com/json-iterator/go v1.1.9 // indirect
|
||||
github.com/leodido/go-urn v1.2.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.12 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
|
||||
github.com/ugorji/go/codec v1.1.7 // indirect
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.8 // indirect
|
||||
)
|
||||
52
air/go.sum
Normal file
52
air/go.sum
Normal file
@@ -0,0 +1,52 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/arl/statsviz v0.5.1 h1:3HY0ZEB738JtguWsD1Tf1pFJZiCcWUmYRq/3OTYKaSI=
|
||||
github.com/arl/statsviz v0.5.1/go.mod h1:zDnjgRblGm1Dyd7J5YlbH7gM1/+HRC+SfkhZhQb5AnM=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
|
||||
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
||||
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
|
||||
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
|
||||
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
89
air/service/fetch_service.go
Normal file
89
air/service/fetch_service.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package service
|
||||
|
||||
import "air/entity"
|
||||
|
||||
// 获取HTTP服务
|
||||
func (s *Service) FetchHttpService(name string) (r []entity.Instance) {
|
||||
s.httpServiceMapLock.RLock()
|
||||
instanceMap := s.httpServiceMap[name]
|
||||
s.httpServiceMapLock.RUnlock()
|
||||
r = make([]entity.Instance, 0)
|
||||
if instanceMap == nil {
|
||||
return r
|
||||
}
|
||||
instanceMap.lock.RLock()
|
||||
for k, v := range instanceMap.Imap {
|
||||
instance := new(entity.Instance)
|
||||
instance.ServiceName = name
|
||||
instance.InstanceName = k
|
||||
instance.InstanceAddr = v.Address
|
||||
r = append(r, *instance)
|
||||
}
|
||||
instanceMap.lock.RUnlock()
|
||||
return r
|
||||
}
|
||||
|
||||
// 获取所有HTTP服务
|
||||
func (s *Service) FetchAllHttpService() (r map[string][]entity.Instance) {
|
||||
s.httpServiceMapLock.RLock()
|
||||
serviceMap := s.httpServiceMap
|
||||
s.httpServiceMapLock.RUnlock()
|
||||
r = make(map[string][]entity.Instance)
|
||||
for k, v := range serviceMap {
|
||||
instanceSlice := make([]entity.Instance, 0)
|
||||
v.lock.RLock()
|
||||
for kk, vv := range v.Imap {
|
||||
instance := new(entity.Instance)
|
||||
instance.ServiceName = k
|
||||
instance.InstanceName = kk
|
||||
instance.InstanceAddr = vv.Address
|
||||
instanceSlice = append(instanceSlice, *instance)
|
||||
}
|
||||
v.lock.RUnlock()
|
||||
r[k] = instanceSlice
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// 获取RPC服务
|
||||
func (s *Service) FetchRpcService(name string) (r []entity.Instance) {
|
||||
s.rpcServiceMapLock.RLock()
|
||||
instanceMap := s.rpcServiceMap[name]
|
||||
s.rpcServiceMapLock.RUnlock()
|
||||
r = make([]entity.Instance, 0)
|
||||
if instanceMap == nil {
|
||||
return r
|
||||
}
|
||||
instanceMap.lock.RLock()
|
||||
for k, v := range instanceMap.Imap {
|
||||
instance := new(entity.Instance)
|
||||
instance.ServiceName = name
|
||||
instance.InstanceName = k
|
||||
instance.InstanceAddr = v.Address
|
||||
r = append(r, *instance)
|
||||
}
|
||||
instanceMap.lock.RUnlock()
|
||||
return r
|
||||
}
|
||||
|
||||
// 获取所有RPC服务
|
||||
func (s *Service) FetchAllRpcService() (r map[string][]entity.Instance) {
|
||||
s.rpcServiceMapLock.RLock()
|
||||
serviceMap := s.rpcServiceMap
|
||||
s.rpcServiceMapLock.RUnlock()
|
||||
r = make(map[string][]entity.Instance)
|
||||
for k, v := range serviceMap {
|
||||
instanceSlice := make([]entity.Instance, 0)
|
||||
v.lock.RLock()
|
||||
for kk, vv := range v.Imap {
|
||||
instance := new(entity.Instance)
|
||||
instance.ServiceName = k
|
||||
instance.InstanceName = kk
|
||||
instance.InstanceAddr = vv.Address
|
||||
instanceSlice = append(instanceSlice, *instance)
|
||||
}
|
||||
v.lock.RUnlock()
|
||||
r[k] = instanceSlice
|
||||
}
|
||||
return r
|
||||
}
|
||||
136
air/service/keepalive_service.go
Normal file
136
air/service/keepalive_service.go
Normal file
@@ -0,0 +1,136 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
// HTTP心跳
|
||||
func (s *Service) HttpKeepalive(instance entity.Instance) {
|
||||
nowTime := time.Now().Unix()
|
||||
s.httpServiceMapLock.RLock()
|
||||
instanceMap := s.httpServiceMap[instance.ServiceName]
|
||||
s.httpServiceMapLock.RUnlock()
|
||||
if instanceMap != nil {
|
||||
instanceMap.lock.Lock()
|
||||
instanceData := instanceMap.Imap[instance.InstanceName]
|
||||
if instanceData != nil {
|
||||
instanceData.LastAliveTime = nowTime
|
||||
} else {
|
||||
logger.LOG.Error("recv not exist instance http keepalive, instance name: %v", instance.InstanceName)
|
||||
}
|
||||
instanceMap.lock.Unlock()
|
||||
} else {
|
||||
logger.LOG.Error("recv not exist service http keepalive, service name: %v", instance.ServiceName)
|
||||
}
|
||||
}
|
||||
|
||||
// RPC心跳
|
||||
func (s *Service) RpcKeepalive(instance entity.Instance) {
|
||||
nowTime := time.Now().Unix()
|
||||
s.rpcServiceMapLock.RLock()
|
||||
instanceMap := s.rpcServiceMap[instance.ServiceName]
|
||||
s.rpcServiceMapLock.RUnlock()
|
||||
if instanceMap != nil {
|
||||
instanceMap.lock.Lock()
|
||||
instanceData := instanceMap.Imap[instance.InstanceName]
|
||||
if instanceData != nil {
|
||||
instanceData.LastAliveTime = nowTime
|
||||
} else {
|
||||
logger.LOG.Error("recv not exist instance rpc keepalive, instance name: %v", instance.InstanceName)
|
||||
}
|
||||
instanceMap.lock.Unlock()
|
||||
} else {
|
||||
logger.LOG.Error("recv not exist service rpc keepalive, service name: %v", instance.ServiceName)
|
||||
}
|
||||
}
|
||||
|
||||
// 定时移除掉线服务
|
||||
func (s *Service) removeDeadService() {
|
||||
ticker := time.NewTicker(time.Second * 60)
|
||||
for {
|
||||
<-ticker.C
|
||||
nowTime := time.Now().Unix()
|
||||
|
||||
httpSvcChgFlagMap := make(map[string]bool)
|
||||
httpSvcChgMap := make(map[string]*InstanceMap)
|
||||
httpSvcDelMap := make(map[string]*InstanceMap)
|
||||
s.httpServiceMapLock.RLock()
|
||||
for svcName, svcInstMap := range s.httpServiceMap {
|
||||
svcInstMap.lock.Lock()
|
||||
for instName, instData := range svcInstMap.Imap {
|
||||
if nowTime-instData.LastAliveTime > 60 {
|
||||
httpSvcChgFlagMap[svcName] = true
|
||||
if httpSvcDelMap[svcName] == nil {
|
||||
httpSvcDelMap[svcName] = new(InstanceMap)
|
||||
httpSvcDelMap[svcName].Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
httpSvcDelMap[svcName].Imap[instName] = instData
|
||||
delete(svcInstMap.Imap, instName)
|
||||
} else {
|
||||
if httpSvcChgMap[svcName] == nil {
|
||||
httpSvcChgMap[svcName] = new(InstanceMap)
|
||||
httpSvcChgMap[svcName].Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
httpSvcChgMap[svcName].Imap[instName] = instData
|
||||
}
|
||||
}
|
||||
svcInstMap.lock.Unlock()
|
||||
}
|
||||
s.httpServiceMapLock.RUnlock()
|
||||
for svcName, instMap := range httpSvcDelMap {
|
||||
for instName, instData := range instMap.Imap {
|
||||
logger.LOG.Info("remove timeout http service, service name: %v, instance name: %v, instance data: %v", svcName, instName, instData)
|
||||
}
|
||||
}
|
||||
for svcName, _ := range httpSvcChgMap {
|
||||
if !httpSvcChgFlagMap[svcName] {
|
||||
delete(httpSvcChgMap, svcName)
|
||||
}
|
||||
}
|
||||
if len(httpSvcChgMap) != 0 {
|
||||
s.httpSvcChgNtfCh <- httpSvcChgMap
|
||||
}
|
||||
|
||||
rpcSvcChgFlagMap := make(map[string]bool)
|
||||
rpcSvcChgMap := make(map[string]*InstanceMap)
|
||||
rpcSvcDelMap := make(map[string]*InstanceMap)
|
||||
s.rpcServiceMapLock.RLock()
|
||||
for svcName, svcInstMap := range s.rpcServiceMap {
|
||||
svcInstMap.lock.Lock()
|
||||
for instName, instData := range svcInstMap.Imap {
|
||||
if nowTime-instData.LastAliveTime > 60 {
|
||||
rpcSvcChgFlagMap[svcName] = true
|
||||
if rpcSvcDelMap[svcName] == nil {
|
||||
rpcSvcDelMap[svcName] = new(InstanceMap)
|
||||
rpcSvcDelMap[svcName].Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
rpcSvcDelMap[svcName].Imap[instName] = instData
|
||||
delete(svcInstMap.Imap, instName)
|
||||
} else {
|
||||
if rpcSvcChgMap[svcName] == nil {
|
||||
rpcSvcChgMap[svcName] = new(InstanceMap)
|
||||
rpcSvcChgMap[svcName].Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
rpcSvcChgMap[svcName].Imap[instName] = instData
|
||||
}
|
||||
}
|
||||
svcInstMap.lock.Unlock()
|
||||
}
|
||||
s.rpcServiceMapLock.RUnlock()
|
||||
for svcName, instMap := range rpcSvcDelMap {
|
||||
for instName, instData := range instMap.Imap {
|
||||
logger.LOG.Info("remove timeout rpc service, service name: %v, instance name: %v, instance data: %v", svcName, instName, instData)
|
||||
}
|
||||
}
|
||||
for svcName, _ := range rpcSvcChgMap {
|
||||
if !rpcSvcChgFlagMap[svcName] {
|
||||
delete(rpcSvcChgMap, svcName)
|
||||
}
|
||||
}
|
||||
if len(rpcSvcChgMap) != 0 {
|
||||
s.rpcSvcChgNtfCh <- rpcSvcChgMap
|
||||
}
|
||||
}
|
||||
}
|
||||
190
air/service/poll_service.go
Normal file
190
air/service/poll_service.go
Normal file
@@ -0,0 +1,190 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/logger"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (s *Service) watchServiceChange() {
|
||||
s.watcher.receiverNotifierIdCounter = 0
|
||||
s.watcher.httpRecvrNtfrMap = make(map[string]map[uint64]*ReceiverNotifier)
|
||||
s.watcher.httpAllSvcRecvrNtfrMap = make(map[uint64]*AllServiceReceiverNotifier)
|
||||
s.watcher.rpcRecvrNtfrMap = make(map[string]map[uint64]*ReceiverNotifier)
|
||||
s.watcher.rpcAllSvcRecvrNtfrMap = make(map[uint64]*AllServiceReceiverNotifier)
|
||||
go func() {
|
||||
for {
|
||||
imap := <-s.httpSvcChgNtfCh
|
||||
for svcName, instMap := range imap {
|
||||
// 给某个服务的接收者通知器发送消息
|
||||
s.watcher.httpRecvrNtfrMapLock.RLock()
|
||||
recvrNtfrMap := s.watcher.httpRecvrNtfrMap[svcName]
|
||||
instList := make([]entity.Instance, 0)
|
||||
for instName, instData := range instMap.Imap {
|
||||
inst := new(entity.Instance)
|
||||
inst.ServiceName = svcName
|
||||
inst.InstanceName = instName
|
||||
inst.InstanceAddr = instData.Address
|
||||
instList = append(instList, *inst)
|
||||
}
|
||||
if recvrNtfrMap == nil || len(recvrNtfrMap) == 0 {
|
||||
s.watcher.httpRecvrNtfrMapLock.RUnlock()
|
||||
continue
|
||||
}
|
||||
for _, recvrNtfr := range recvrNtfrMap {
|
||||
if time.Now().UnixNano()-recvrNtfr.CreateTime < int64(time.Second*30) {
|
||||
logger.LOG.Debug("send http service change notify to receiver: %d", recvrNtfr.Id)
|
||||
recvrNtfr.NotifyChannel <- instList
|
||||
}
|
||||
close(recvrNtfr.NotifyChannel)
|
||||
}
|
||||
s.watcher.httpRecvrNtfrMapLock.RUnlock()
|
||||
}
|
||||
|
||||
// 给全体服务的接收者通知器发送消息
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.RLock()
|
||||
if len(s.watcher.httpAllSvcRecvrNtfrMap) == 0 {
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.RUnlock()
|
||||
continue
|
||||
}
|
||||
svcMap := s.FetchAllHttpService()
|
||||
for _, recvrNtfr := range s.watcher.httpAllSvcRecvrNtfrMap {
|
||||
if time.Now().UnixNano()-recvrNtfr.CreateTime < int64(time.Second*30) {
|
||||
logger.LOG.Debug("send all http service change notify to receiver: %d", recvrNtfr.Id)
|
||||
recvrNtfr.NotifyChannel <- svcMap
|
||||
}
|
||||
close(recvrNtfr.NotifyChannel)
|
||||
}
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.RUnlock()
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
for {
|
||||
imap := <-s.rpcSvcChgNtfCh
|
||||
for svcName, instMap := range imap {
|
||||
// 给某个服务的接收者通知器发送消息
|
||||
s.watcher.rpcRecvrNtfrMapLock.RLock()
|
||||
recvrNtfrMap := s.watcher.rpcRecvrNtfrMap[svcName]
|
||||
instList := make([]entity.Instance, 0)
|
||||
for instName, instData := range instMap.Imap {
|
||||
inst := new(entity.Instance)
|
||||
inst.ServiceName = svcName
|
||||
inst.InstanceName = instName
|
||||
inst.InstanceAddr = instData.Address
|
||||
instList = append(instList, *inst)
|
||||
}
|
||||
if recvrNtfrMap == nil || len(recvrNtfrMap) == 0 {
|
||||
s.watcher.rpcRecvrNtfrMapLock.RUnlock()
|
||||
continue
|
||||
}
|
||||
for _, recvrNtfr := range recvrNtfrMap {
|
||||
if time.Now().UnixNano()-recvrNtfr.CreateTime < int64(time.Second*30) {
|
||||
logger.LOG.Debug("send rpc service change notify to receiver: %d", recvrNtfr.Id)
|
||||
recvrNtfr.NotifyChannel <- instList
|
||||
}
|
||||
close(recvrNtfr.NotifyChannel)
|
||||
}
|
||||
s.watcher.rpcRecvrNtfrMapLock.RUnlock()
|
||||
}
|
||||
|
||||
// 给全体服务的接收者通知器发送消息
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.RLock()
|
||||
if len(s.watcher.rpcAllSvcRecvrNtfrMap) == 0 {
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.RUnlock()
|
||||
continue
|
||||
}
|
||||
svcMap := s.FetchAllRpcService()
|
||||
for _, recvrNtfr := range s.watcher.rpcAllSvcRecvrNtfrMap {
|
||||
if time.Now().UnixNano()-recvrNtfr.CreateTime < int64(time.Second*30) {
|
||||
logger.LOG.Debug("send all rpc service change notify to receiver: %d", recvrNtfr.Id)
|
||||
recvrNtfr.NotifyChannel <- svcMap
|
||||
}
|
||||
close(recvrNtfr.NotifyChannel)
|
||||
}
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.RUnlock()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// 注册HTTP服务变化通知接收者
|
||||
func (s *Service) RegistryHttpNotifyReceiver(serviceName string) *ReceiverNotifier {
|
||||
recvrNtfr := new(ReceiverNotifier)
|
||||
recvrNtfr.Id = atomic.AddUint64(&s.watcher.receiverNotifierIdCounter, 1)
|
||||
recvrNtfr.CreateTime = time.Now().UnixNano()
|
||||
recvrNtfr.NotifyChannel = make(chan []entity.Instance, 0)
|
||||
s.watcher.httpRecvrNtfrMapLock.Lock()
|
||||
if s.watcher.httpRecvrNtfrMap[serviceName] == nil {
|
||||
s.watcher.httpRecvrNtfrMap[serviceName] = make(map[uint64]*ReceiverNotifier)
|
||||
}
|
||||
s.watcher.httpRecvrNtfrMap[serviceName][recvrNtfr.Id] = recvrNtfr
|
||||
s.watcher.httpRecvrNtfrMapLock.Unlock()
|
||||
return recvrNtfr
|
||||
}
|
||||
|
||||
// 取消HTTP服务变化通知接收者
|
||||
func (s *Service) CancelHttpNotifyReceiver(serviceName string, id uint64) {
|
||||
s.watcher.httpRecvrNtfrMapLock.Lock()
|
||||
delete(s.watcher.httpRecvrNtfrMap[serviceName], id)
|
||||
s.watcher.httpRecvrNtfrMapLock.Unlock()
|
||||
}
|
||||
|
||||
// 注册全体HTTP服务变化通知接收者
|
||||
func (s *Service) RegistryAllHttpNotifyReceiver() *AllServiceReceiverNotifier {
|
||||
recvrNtfr := new(AllServiceReceiverNotifier)
|
||||
recvrNtfr.Id = atomic.AddUint64(&s.watcher.receiverNotifierIdCounter, 1)
|
||||
recvrNtfr.CreateTime = time.Now().UnixNano()
|
||||
recvrNtfr.NotifyChannel = make(chan map[string][]entity.Instance, 0)
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.Lock()
|
||||
s.watcher.httpAllSvcRecvrNtfrMap[recvrNtfr.Id] = recvrNtfr
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.Unlock()
|
||||
return recvrNtfr
|
||||
}
|
||||
|
||||
// 取消全体HTTP服务变化通知接收者
|
||||
func (s *Service) CancelAllHttpNotifyReceiver(id uint64) {
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.Lock()
|
||||
delete(s.watcher.httpAllSvcRecvrNtfrMap, id)
|
||||
s.watcher.httpAllSvcRecvrNtfrMapLock.Unlock()
|
||||
}
|
||||
|
||||
// 注册RPC服务变化通知接收者
|
||||
func (s *Service) RegistryRpcNotifyReceiver(serviceName string) *ReceiverNotifier {
|
||||
recvrNtfr := new(ReceiverNotifier)
|
||||
recvrNtfr.Id = atomic.AddUint64(&s.watcher.receiverNotifierIdCounter, 1)
|
||||
recvrNtfr.CreateTime = time.Now().UnixNano()
|
||||
recvrNtfr.NotifyChannel = make(chan []entity.Instance, 0)
|
||||
s.watcher.rpcRecvrNtfrMapLock.Lock()
|
||||
if s.watcher.rpcRecvrNtfrMap[serviceName] == nil {
|
||||
s.watcher.rpcRecvrNtfrMap[serviceName] = make(map[uint64]*ReceiverNotifier)
|
||||
}
|
||||
s.watcher.rpcRecvrNtfrMap[serviceName][recvrNtfr.Id] = recvrNtfr
|
||||
s.watcher.rpcRecvrNtfrMapLock.Unlock()
|
||||
return recvrNtfr
|
||||
}
|
||||
|
||||
// 取消RPC服务变化通知接收者
|
||||
func (s *Service) CancelRpcNotifyReceiver(serviceName string, id uint64) {
|
||||
s.watcher.rpcRecvrNtfrMapLock.Lock()
|
||||
delete(s.watcher.rpcRecvrNtfrMap[serviceName], id)
|
||||
s.watcher.rpcRecvrNtfrMapLock.Unlock()
|
||||
}
|
||||
|
||||
// 注册全体RPC服务变化通知接收者
|
||||
func (s *Service) RegistryAllRpcNotifyReceiver() *AllServiceReceiverNotifier {
|
||||
recvrNtfr := new(AllServiceReceiverNotifier)
|
||||
recvrNtfr.Id = atomic.AddUint64(&s.watcher.receiverNotifierIdCounter, 1)
|
||||
recvrNtfr.CreateTime = time.Now().UnixNano()
|
||||
recvrNtfr.NotifyChannel = make(chan map[string][]entity.Instance, 0)
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.Lock()
|
||||
s.watcher.rpcAllSvcRecvrNtfrMap[recvrNtfr.Id] = recvrNtfr
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.Unlock()
|
||||
return recvrNtfr
|
||||
}
|
||||
|
||||
// 取消全体RPC服务变化通知接收者
|
||||
func (s *Service) CancelAllRpcNotifyReceiver(id uint64) {
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.Lock()
|
||||
delete(s.watcher.rpcAllSvcRecvrNtfrMap, id)
|
||||
s.watcher.rpcAllSvcRecvrNtfrMapLock.Unlock()
|
||||
}
|
||||
103
air/service/registry_service.go
Normal file
103
air/service/registry_service.go
Normal file
@@ -0,0 +1,103 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/common/utils/object"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 注册HTTP服务
|
||||
func (s *Service) RegisterHttpService(instance entity.Instance) bool {
|
||||
nowTime := time.Now().Unix()
|
||||
s.httpServiceMapLock.Lock()
|
||||
instanceMap := s.httpServiceMap[instance.ServiceName]
|
||||
if instanceMap == nil {
|
||||
instanceMap = new(InstanceMap)
|
||||
instanceMap.Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
instanceMap.lock.Lock()
|
||||
instanceData := instanceMap.Imap[instance.InstanceName]
|
||||
if instanceData == nil {
|
||||
instanceData = new(InstanceData)
|
||||
}
|
||||
instanceData.Address = instance.InstanceAddr
|
||||
instanceData.LastAliveTime = nowTime
|
||||
instanceMap.Imap[instance.InstanceName] = instanceData
|
||||
s.httpServiceMap[instance.ServiceName] = instanceMap
|
||||
instanceMap.lock.Unlock()
|
||||
s.httpServiceMapLock.Unlock()
|
||||
changeInst := make(map[string]*InstanceMap)
|
||||
instanceMapCopy := new(InstanceMap)
|
||||
instanceMap.lock.RLock()
|
||||
_ = object.ObjectDeepCopy(instanceMap, instanceMapCopy)
|
||||
instanceMap.lock.RUnlock()
|
||||
changeInst[instance.ServiceName] = instanceMapCopy
|
||||
s.httpSvcChgNtfCh <- changeInst
|
||||
return true
|
||||
}
|
||||
|
||||
// 取消注册HTTP服务
|
||||
func (s *Service) CancelHttpService(instance entity.Instance) bool {
|
||||
s.httpServiceMapLock.RLock()
|
||||
instanceMap := s.httpServiceMap[instance.ServiceName]
|
||||
s.httpServiceMapLock.RUnlock()
|
||||
instanceMap.lock.Lock()
|
||||
delete(instanceMap.Imap, instance.InstanceName)
|
||||
instanceMap.lock.Unlock()
|
||||
changeInst := make(map[string]*InstanceMap)
|
||||
instanceMapCopy := new(InstanceMap)
|
||||
instanceMap.lock.RLock()
|
||||
_ = object.ObjectDeepCopy(instanceMap, instanceMapCopy)
|
||||
instanceMap.lock.RUnlock()
|
||||
changeInst[instance.ServiceName] = instanceMapCopy
|
||||
s.httpSvcChgNtfCh <- changeInst
|
||||
return true
|
||||
}
|
||||
|
||||
// 注册RPC服务
|
||||
func (s *Service) RegisterRpcService(instance entity.Instance) bool {
|
||||
nowTime := time.Now().Unix()
|
||||
s.rpcServiceMapLock.Lock()
|
||||
instanceMap := s.rpcServiceMap[instance.ServiceName]
|
||||
if instanceMap == nil {
|
||||
instanceMap = new(InstanceMap)
|
||||
instanceMap.Imap = make(map[string]*InstanceData)
|
||||
}
|
||||
instanceMap.lock.Lock()
|
||||
instanceData := instanceMap.Imap[instance.InstanceName]
|
||||
if instanceData == nil {
|
||||
instanceData = new(InstanceData)
|
||||
}
|
||||
instanceData.Address = instance.InstanceAddr
|
||||
instanceData.LastAliveTime = nowTime
|
||||
instanceMap.Imap[instance.InstanceName] = instanceData
|
||||
s.rpcServiceMap[instance.ServiceName] = instanceMap
|
||||
instanceMap.lock.Unlock()
|
||||
s.rpcServiceMapLock.Unlock()
|
||||
changeInst := make(map[string]*InstanceMap)
|
||||
instanceMapCopy := new(InstanceMap)
|
||||
instanceMap.lock.RLock()
|
||||
_ = object.ObjectDeepCopy(instanceMap, instanceMapCopy)
|
||||
instanceMap.lock.RUnlock()
|
||||
changeInst[instance.ServiceName] = instanceMapCopy
|
||||
s.rpcSvcChgNtfCh <- changeInst
|
||||
return true
|
||||
}
|
||||
|
||||
// 取消注册RPC服务
|
||||
func (s *Service) CancelRpcService(instance entity.Instance) bool {
|
||||
s.rpcServiceMapLock.RLock()
|
||||
instanceMap := s.rpcServiceMap[instance.ServiceName]
|
||||
s.rpcServiceMapLock.RUnlock()
|
||||
instanceMap.lock.Lock()
|
||||
delete(instanceMap.Imap, instance.InstanceName)
|
||||
instanceMap.lock.Unlock()
|
||||
changeInst := make(map[string]*InstanceMap)
|
||||
instanceMapCopy := new(InstanceMap)
|
||||
instanceMap.lock.RLock()
|
||||
_ = object.ObjectDeepCopy(instanceMap, instanceMapCopy)
|
||||
instanceMap.lock.RUnlock()
|
||||
changeInst[instance.ServiceName] = instanceMapCopy
|
||||
s.rpcSvcChgNtfCh <- changeInst
|
||||
return true
|
||||
}
|
||||
75
air/service/service.go
Normal file
75
air/service/service.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// 实例数据
|
||||
type InstanceData struct {
|
||||
// 实例地址
|
||||
Address string
|
||||
// 最后心跳时间
|
||||
LastAliveTime int64
|
||||
}
|
||||
|
||||
// 服务实例集合
|
||||
type InstanceMap struct {
|
||||
// key:实例名 value:实例数据
|
||||
Imap map[string]*InstanceData
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
type ReceiverNotifier struct {
|
||||
Id uint64
|
||||
CreateTime int64
|
||||
NotifyChannel chan []entity.Instance
|
||||
}
|
||||
|
||||
type AllServiceReceiverNotifier struct {
|
||||
Id uint64
|
||||
CreateTime int64
|
||||
NotifyChannel chan map[string][]entity.Instance
|
||||
}
|
||||
|
||||
type Watcher struct {
|
||||
receiverNotifierIdCounter uint64
|
||||
// key1:服务名 key2:接收者通知器id value:接收者通知器
|
||||
httpRecvrNtfrMap map[string]map[uint64]*ReceiverNotifier
|
||||
httpRecvrNtfrMapLock sync.RWMutex
|
||||
// key:接收者通知器id value:接收者通知器
|
||||
httpAllSvcRecvrNtfrMap map[uint64]*AllServiceReceiverNotifier
|
||||
httpAllSvcRecvrNtfrMapLock sync.RWMutex
|
||||
// key1:服务名 key2:接收者通知器id value:接收者通知器
|
||||
rpcRecvrNtfrMap map[string]map[uint64]*ReceiverNotifier
|
||||
rpcRecvrNtfrMapLock sync.RWMutex
|
||||
// key:接收者通知器id value:接收者通知器
|
||||
rpcAllSvcRecvrNtfrMap map[uint64]*AllServiceReceiverNotifier
|
||||
rpcAllSvcRecvrNtfrMapLock sync.RWMutex
|
||||
}
|
||||
|
||||
// 注册服务
|
||||
type Service struct {
|
||||
// key:服务名 value:服务实例集合
|
||||
httpServiceMap map[string]*InstanceMap
|
||||
httpServiceMapLock sync.RWMutex
|
||||
httpSvcChgNtfCh chan map[string]*InstanceMap
|
||||
// key:服务名 value:服务实例集合
|
||||
rpcServiceMap map[string]*InstanceMap
|
||||
rpcServiceMapLock sync.RWMutex
|
||||
rpcSvcChgNtfCh chan map[string]*InstanceMap
|
||||
watcher *Watcher
|
||||
}
|
||||
|
||||
// 构造函数
|
||||
func NewService() (r *Service) {
|
||||
r = new(Service)
|
||||
r.httpServiceMap = make(map[string]*InstanceMap)
|
||||
r.rpcServiceMap = make(map[string]*InstanceMap)
|
||||
r.httpSvcChgNtfCh = make(chan map[string]*InstanceMap, 0)
|
||||
r.rpcSvcChgNtfCh = make(chan map[string]*InstanceMap, 0)
|
||||
r.watcher = new(Watcher)
|
||||
go r.removeDeadService()
|
||||
go r.watchServiceChange()
|
||||
return r
|
||||
}
|
||||
98
common/config/config.go
Normal file
98
common/config/config.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
var CONF *Config = nil
|
||||
|
||||
// 配置
|
||||
type Config struct {
|
||||
HttpPort int `toml:"http_port"`
|
||||
KcpPort int `toml:"kcp_port"`
|
||||
Logger Logger `toml:"logger"`
|
||||
Air Air `toml:"air"`
|
||||
Database Database `toml:"database"`
|
||||
Light Light `toml:"light"`
|
||||
Routes []Routes `toml:"routes"`
|
||||
Wxmp Wxmp `toml:"wxmp"`
|
||||
Hk4e Hk4e `toml:"hk4e"`
|
||||
MQ MQ `toml:"mq"`
|
||||
}
|
||||
|
||||
// 日志配置
|
||||
type Logger struct {
|
||||
Level string `toml:"level"`
|
||||
Method string `toml:"method"`
|
||||
TrackLine bool `toml:"track_line"`
|
||||
}
|
||||
|
||||
// 注册中心配置
|
||||
type Air struct {
|
||||
Addr string `toml:"addr"`
|
||||
Port int `toml:"port"`
|
||||
ServiceName string `toml:"service_name"`
|
||||
}
|
||||
|
||||
// 数据库配置
|
||||
type Database struct {
|
||||
Url string `toml:"url"`
|
||||
}
|
||||
|
||||
// RPC框架配置
|
||||
type Light struct {
|
||||
Port int `toml:"port"`
|
||||
}
|
||||
|
||||
// 路由配置
|
||||
type Routes struct {
|
||||
ServiceName string `toml:"service_name"`
|
||||
ServicePredicates string `toml:"service_predicates"`
|
||||
StripPrefix int `toml:"strip_prefix"`
|
||||
}
|
||||
|
||||
// FWDN服务
|
||||
type Fwdn struct {
|
||||
FwdnCron string `toml:"fwdn_cron"`
|
||||
TestCron string `toml:"test_cron"`
|
||||
QQMailAddr string `toml:"qq_mail_addr"`
|
||||
QQMailName string `toml:"qq_mail_name"`
|
||||
QQMailToken string `toml:"qq_mail_token"`
|
||||
FwMailAddr string `toml:"fw_mail_addr"`
|
||||
}
|
||||
|
||||
// 微信公众号
|
||||
type Wxmp struct {
|
||||
AppId string `toml:"app_id"`
|
||||
RawId string `toml:"raw_id"`
|
||||
Token string `toml:"token"`
|
||||
EncodingAesKey string `toml:"encoding_aes_key"`
|
||||
Fwdn Fwdn `toml:"fwdn"`
|
||||
}
|
||||
|
||||
// 原神相关
|
||||
type Hk4e struct {
|
||||
KcpPort int `toml:"kcp_port"`
|
||||
KcpAddr string `toml:"kcp_addr"`
|
||||
ResourcePath string `toml:"resource_path"`
|
||||
GachaHistoryServer string `toml:"gacha_history_server"`
|
||||
}
|
||||
|
||||
// 消息队列
|
||||
type MQ struct {
|
||||
NatsUrl string `toml:"nats_url"`
|
||||
}
|
||||
|
||||
func InitConfig(filePath string) {
|
||||
CONF = new(Config)
|
||||
CONF.loadConfigFile(filePath)
|
||||
}
|
||||
|
||||
// 加载配置文件
|
||||
func (c *Config) loadConfigFile(filePath string) {
|
||||
_, err := toml.DecodeFile(filePath, &c)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("application.toml load fail ! err: %v", err))
|
||||
}
|
||||
}
|
||||
15
common/entity/dto/response_result_entity.go
Normal file
15
common/entity/dto/response_result_entity.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package dto
|
||||
|
||||
type ResponseResult struct {
|
||||
Code int32 `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data any `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func NewResponseResult(code int32, msg string, data any) (r *ResponseResult) {
|
||||
r = new(ResponseResult)
|
||||
r.Code = code
|
||||
r.Msg = msg
|
||||
r.Data = data
|
||||
return r
|
||||
}
|
||||
5
common/go.mod
Normal file
5
common/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module common
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/BurntSushi/toml v0.3.1
|
||||
2
common/go.sum
Normal file
2
common/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
196
common/utils/alg/bfs_pathfinding.go
Normal file
196
common/utils/alg/bfs_pathfinding.go
Normal file
@@ -0,0 +1,196 @@
|
||||
package alg
|
||||
|
||||
const (
|
||||
NODE_NONE = iota
|
||||
NODE_START
|
||||
NODE_END
|
||||
NODE_BLOCK
|
||||
)
|
||||
|
||||
type PathNode struct {
|
||||
x int16
|
||||
y int16
|
||||
z int16
|
||||
visit bool
|
||||
state int
|
||||
parent *PathNode
|
||||
}
|
||||
|
||||
type BFS struct {
|
||||
gMap map[int16]map[int16]map[int16]*PathNode
|
||||
startPathNode *PathNode
|
||||
endPathNode *PathNode
|
||||
}
|
||||
|
||||
func NewBFS() (r *BFS) {
|
||||
r = new(BFS)
|
||||
return r
|
||||
}
|
||||
|
||||
func (b *BFS) InitMap(terrain map[MeshMapPos]bool, start MeshMapPos, end MeshMapPos, extR int16) {
|
||||
xLen := end.X - start.X
|
||||
yLen := end.Y - start.Y
|
||||
zLen := end.Z - start.Z
|
||||
dx := int16(1)
|
||||
dy := int16(1)
|
||||
dz := int16(1)
|
||||
if xLen < 0 {
|
||||
dx = -1
|
||||
xLen *= -1
|
||||
}
|
||||
if yLen < 0 {
|
||||
dy = -1
|
||||
yLen *= -1
|
||||
}
|
||||
if zLen < 0 {
|
||||
dz = -1
|
||||
zLen *= -1
|
||||
}
|
||||
b.gMap = make(map[int16]map[int16]map[int16]*PathNode)
|
||||
for x := start.X - extR*dx; x != end.X+extR*dx; x += dx {
|
||||
b.gMap[x] = make(map[int16]map[int16]*PathNode)
|
||||
for y := start.Y - extR*dy; y != end.Y+extR*dy; y += dy {
|
||||
b.gMap[x][y] = make(map[int16]*PathNode)
|
||||
for z := start.Z - extR*dz; z != end.Z+extR*dz; z += dz {
|
||||
state := -1
|
||||
if x == start.X && y == start.Y && z == start.Z {
|
||||
state = NODE_START
|
||||
} else if x == end.X && y == end.Y && z == end.Z {
|
||||
state = NODE_END
|
||||
} else {
|
||||
_, exist := terrain[MeshMapPos{
|
||||
X: x,
|
||||
Y: y,
|
||||
Z: z,
|
||||
}]
|
||||
if exist {
|
||||
state = NODE_NONE
|
||||
} else {
|
||||
state = NODE_BLOCK
|
||||
}
|
||||
}
|
||||
node := &PathNode{
|
||||
x: x,
|
||||
y: y,
|
||||
z: z,
|
||||
visit: false,
|
||||
state: state,
|
||||
parent: nil,
|
||||
}
|
||||
b.gMap[x][y][z] = node
|
||||
if node.state == NODE_START {
|
||||
b.startPathNode = node
|
||||
} else if node.state == NODE_END {
|
||||
b.endPathNode = node
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BFS) GetNeighbor(node *PathNode) []*PathNode {
|
||||
neighborList := make([]*PathNode, 0)
|
||||
dir := [][3]int16{
|
||||
//
|
||||
{1, 0, 0},
|
||||
{-1, 0, 0},
|
||||
{0, 1, 0},
|
||||
{0, -1, 0},
|
||||
{0, 0, 1},
|
||||
{0, 0, -1},
|
||||
//
|
||||
{1, 1, 0},
|
||||
{-1, 1, 0},
|
||||
{-1, -1, 0},
|
||||
{1, -1, 0},
|
||||
//
|
||||
{1, 0, 1},
|
||||
{-1, 0, 1},
|
||||
{-1, 0, -1},
|
||||
{1, 0, -1},
|
||||
//
|
||||
{0, 1, 1},
|
||||
{0, -1, 1},
|
||||
{0, -1, -1},
|
||||
{0, 1, -1},
|
||||
//
|
||||
{1, 1, 1},
|
||||
{1, 1, -1},
|
||||
{1, -1, 1},
|
||||
{1, -1, -1},
|
||||
{-1, 1, 1},
|
||||
{-1, 1, -1},
|
||||
{-1, -1, 1},
|
||||
{-1, -1, -1},
|
||||
}
|
||||
for _, v := range dir {
|
||||
x := node.x + v[0]
|
||||
y := node.y + v[1]
|
||||
z := node.z + v[2]
|
||||
if _, exist := b.gMap[x]; !exist {
|
||||
continue
|
||||
}
|
||||
if _, exist := b.gMap[x][y]; !exist {
|
||||
continue
|
||||
}
|
||||
if _, exist := b.gMap[x][y][z]; !exist {
|
||||
continue
|
||||
}
|
||||
neighborNode := b.gMap[x][y][z]
|
||||
neighborList = append(neighborList, neighborNode)
|
||||
}
|
||||
return neighborList
|
||||
}
|
||||
|
||||
func (b *BFS) GetPath() []*PathNode {
|
||||
path := make([]*PathNode, 0)
|
||||
if b.endPathNode.parent == nil {
|
||||
return nil
|
||||
}
|
||||
node := b.endPathNode
|
||||
for {
|
||||
if node == nil {
|
||||
break
|
||||
}
|
||||
path = append(path, node)
|
||||
node = node.parent
|
||||
}
|
||||
if len(path) == 0 {
|
||||
return nil
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
func (b *BFS) Pathfinding() []MeshMapPos {
|
||||
queue := NewALQueue[*PathNode]()
|
||||
b.startPathNode.visit = true
|
||||
queue.EnQueue(b.startPathNode)
|
||||
for queue.Len() > 0 {
|
||||
head := queue.DeQueue()
|
||||
neighborList := b.GetNeighbor(head)
|
||||
for _, neighbor := range neighborList {
|
||||
if !neighbor.visit && neighbor.state != NODE_BLOCK {
|
||||
neighbor.visit = true
|
||||
neighbor.parent = head
|
||||
queue.EnQueue(neighbor)
|
||||
if neighbor.state == NODE_END {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
path := b.GetPath()
|
||||
if path == nil {
|
||||
return nil
|
||||
}
|
||||
pathVectorList := make([]MeshMapPos, 0)
|
||||
for i := len(path) - 1; i >= 0; i-- {
|
||||
node := path[i]
|
||||
pathVectorList = append(pathVectorList, MeshMapPos{
|
||||
X: node.x,
|
||||
Y: node.y,
|
||||
Z: node.z,
|
||||
})
|
||||
}
|
||||
return pathVectorList
|
||||
}
|
||||
7
common/utils/alg/common_pathfinding.go
Normal file
7
common/utils/alg/common_pathfinding.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package alg
|
||||
|
||||
type MeshMapPos struct {
|
||||
X int16
|
||||
Y int16
|
||||
Z int16
|
||||
}
|
||||
127
common/utils/alg/queue.go
Normal file
127
common/utils/alg/queue.go
Normal file
@@ -0,0 +1,127 @@
|
||||
package alg
|
||||
|
||||
type LinkList struct {
|
||||
value any
|
||||
frontNode *LinkList
|
||||
nextNode *LinkList
|
||||
}
|
||||
|
||||
// LinkListQueue 无界队列 每个元素可存储不同数据结构
|
||||
type LLQueue struct {
|
||||
headPtr *LinkList
|
||||
tailPtr *LinkList
|
||||
len uint64
|
||||
}
|
||||
|
||||
func NewLLQueue() *LLQueue {
|
||||
return &LLQueue{
|
||||
headPtr: nil,
|
||||
tailPtr: nil,
|
||||
len: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func (q *LLQueue) Len() uint64 {
|
||||
return q.len
|
||||
}
|
||||
|
||||
func (q *LLQueue) EnQueue(value any) {
|
||||
if q.headPtr == nil || q.tailPtr == nil {
|
||||
q.headPtr = new(LinkList)
|
||||
q.tailPtr = q.headPtr
|
||||
} else {
|
||||
q.tailPtr.nextNode = new(LinkList)
|
||||
q.tailPtr.nextNode.frontNode = q.tailPtr
|
||||
q.tailPtr = q.tailPtr.nextNode
|
||||
}
|
||||
q.tailPtr.value = value
|
||||
q.len++
|
||||
}
|
||||
|
||||
func (q *LLQueue) DeQueue() any {
|
||||
if q.Len() == 0 || q.headPtr == nil {
|
||||
return nil
|
||||
}
|
||||
ret := q.headPtr.value
|
||||
q.len--
|
||||
q.headPtr = q.headPtr.nextNode
|
||||
return ret
|
||||
}
|
||||
|
||||
// ArrayListQueue 无界队列 泛型
|
||||
type ALQueue[T any] struct {
|
||||
array []T
|
||||
}
|
||||
|
||||
func NewALQueue[T any]() *ALQueue[T] {
|
||||
return &ALQueue[T]{
|
||||
array: make([]T, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (q *ALQueue[T]) Len() uint64 {
|
||||
return uint64(len(q.array))
|
||||
}
|
||||
|
||||
func (q *ALQueue[T]) EnQueue(value T) {
|
||||
q.array = append(q.array, value)
|
||||
}
|
||||
|
||||
func (q *ALQueue[T]) DeQueue() T {
|
||||
if q.Len() == 0 {
|
||||
var null T
|
||||
return null
|
||||
}
|
||||
ret := q.array[0]
|
||||
q.array = q.array[1:]
|
||||
return ret
|
||||
}
|
||||
|
||||
// RingArrayQueue 有界队列 性能最好
|
||||
type RAQueue[T any] struct {
|
||||
ringArray []T
|
||||
ringArrayLen uint64
|
||||
headPtr uint64
|
||||
tailPtr uint64
|
||||
len uint64
|
||||
}
|
||||
|
||||
func NewRAQueue[T any](size uint64) *RAQueue[T] {
|
||||
return &RAQueue[T]{
|
||||
ringArray: make([]T, size),
|
||||
ringArrayLen: size,
|
||||
headPtr: 0,
|
||||
tailPtr: 0,
|
||||
len: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func (q *RAQueue[T]) Len() uint64 {
|
||||
return q.len
|
||||
}
|
||||
|
||||
func (q *RAQueue[T]) EnQueue(value T) {
|
||||
if q.len >= q.ringArrayLen {
|
||||
return
|
||||
}
|
||||
q.ringArray[q.tailPtr] = value
|
||||
q.tailPtr++
|
||||
if q.tailPtr >= q.ringArrayLen {
|
||||
q.tailPtr = 0
|
||||
}
|
||||
q.len++
|
||||
}
|
||||
|
||||
func (q *RAQueue[T]) DeQueue() T {
|
||||
if q.Len() == 0 {
|
||||
var null T
|
||||
return null
|
||||
}
|
||||
ret := q.ringArray[q.headPtr]
|
||||
q.headPtr++
|
||||
if q.headPtr >= q.ringArrayLen {
|
||||
q.headPtr = 0
|
||||
}
|
||||
q.len--
|
||||
return ret
|
||||
}
|
||||
92
common/utils/alg/queue_test.go
Normal file
92
common/utils/alg/queue_test.go
Normal file
@@ -0,0 +1,92 @@
|
||||
package alg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLLQueue(t *testing.T) {
|
||||
queue := NewLLQueue()
|
||||
queue.EnQueue(float32(100.123))
|
||||
queue.EnQueue(uint8(66))
|
||||
queue.EnQueue("aaa")
|
||||
queue.EnQueue(int64(-123456789))
|
||||
queue.EnQueue(true)
|
||||
queue.EnQueue(5)
|
||||
for queue.Len() > 0 {
|
||||
value := queue.DeQueue()
|
||||
fmt.Println(value)
|
||||
}
|
||||
}
|
||||
|
||||
func TestALQueue(t *testing.T) {
|
||||
queue := NewALQueue[uint8]()
|
||||
queue.EnQueue(1)
|
||||
queue.EnQueue(2)
|
||||
queue.EnQueue(8)
|
||||
queue.EnQueue(9)
|
||||
for queue.Len() > 0 {
|
||||
value := queue.DeQueue()
|
||||
fmt.Println(value)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRAQueue(t *testing.T) {
|
||||
queue := NewRAQueue[uint8](1000)
|
||||
queue.EnQueue(1)
|
||||
queue.EnQueue(2)
|
||||
queue.EnQueue(8)
|
||||
queue.EnQueue(9)
|
||||
for queue.Len() > 0 {
|
||||
value := queue.DeQueue()
|
||||
fmt.Println(value)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLLQueue(b *testing.B) {
|
||||
data := ""
|
||||
for i := 0; i < 1024; i++ {
|
||||
data += "X"
|
||||
}
|
||||
queue := NewLLQueue()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.EnQueue(&data)
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.DeQueue()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkALQueue(b *testing.B) {
|
||||
data := ""
|
||||
for i := 0; i < 1024; i++ {
|
||||
data += "X"
|
||||
}
|
||||
queue := NewALQueue[*string]()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.EnQueue(&data)
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.DeQueue()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRAQueue(b *testing.B) {
|
||||
data := ""
|
||||
for i := 0; i < 1024; i++ {
|
||||
data += "X"
|
||||
}
|
||||
queue := NewRAQueue[*string](1000)
|
||||
for i := 0; i < b.N; i++ {
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.EnQueue(&data)
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
queue.DeQueue()
|
||||
}
|
||||
}
|
||||
}
|
||||
89
common/utils/alg/snowflake.go
Normal file
89
common/utils/alg/snowflake.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package alg
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 雪花算法的基本实现
|
||||
|
||||
// snowflake ID 是一个64位的int数据 由四部分组成
|
||||
// A-B-C-D
|
||||
// A 1位 最高位不使用
|
||||
// B 41位 时间戳
|
||||
// C 10位 节点ID
|
||||
// D 12位 毫秒内序列号
|
||||
// 时间戳 节点ID 毫秒内序列号 位数可按需调整
|
||||
|
||||
const (
|
||||
workerBits uint8 = 10 // 节点ID位数 2^10=1024
|
||||
numberBits uint8 = 12 // 毫秒内序列号位数 2^12=4096
|
||||
workerMax int64 = -1 ^ (-1 << workerBits) // 节点ID最大值
|
||||
numberMax int64 = -1 ^ (-1 << numberBits) // 毫秒内序列号最大值
|
||||
timeShift = workerBits + numberBits // 时间戳向左偏移量
|
||||
workerShift = numberBits // 节点ID向左偏移量
|
||||
/*
|
||||
* 原始算法使用41位字节作为时间戳数值
|
||||
* 大约68年也就是2038年就会用完
|
||||
* 这里做个偏移以增加可用时间
|
||||
* !!!这个一旦定义且开始生成ID后千万不要改了!!!
|
||||
* 不然可能会生成相同的ID
|
||||
*/
|
||||
epoch int64 = 1657148827000 // 2022-07-07 07:07:07
|
||||
)
|
||||
|
||||
type SnowflakeWorker struct {
|
||||
lock sync.Mutex // 互斥锁
|
||||
timestamp int64 // 记录时间戳
|
||||
workerId int64 // 节点ID
|
||||
number int64 // 当前毫秒内已经生成的ID序列号 从0开始累加
|
||||
}
|
||||
|
||||
func NewSnowflakeWorker(workerId int64) *SnowflakeWorker {
|
||||
if workerId < 0 || workerId > workerMax {
|
||||
// worker id error
|
||||
return nil
|
||||
}
|
||||
worker := &SnowflakeWorker{
|
||||
timestamp: 0,
|
||||
workerId: workerId,
|
||||
number: 0,
|
||||
}
|
||||
return worker
|
||||
}
|
||||
|
||||
func (s *SnowflakeWorker) GenId() int64 {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
// 当前毫秒时间戳
|
||||
now := time.Now().UnixNano() / 1e6
|
||||
if s.timestamp > now {
|
||||
// 发生了时钟回拨
|
||||
if s.timestamp-now > 1000 {
|
||||
// 时钟回拨太严重
|
||||
return -1
|
||||
}
|
||||
for now <= s.timestamp {
|
||||
// 自旋等待当前时间超过上一次ID生成的时间
|
||||
now = time.Now().UnixNano() / 1e6
|
||||
}
|
||||
}
|
||||
if s.timestamp == now {
|
||||
s.number++
|
||||
if s.number > numberMax {
|
||||
// 当前毫秒内生成ID数量超过限制
|
||||
for now <= s.timestamp {
|
||||
// 自旋等待
|
||||
now = time.Now().UnixNano() / 1e6
|
||||
}
|
||||
}
|
||||
}
|
||||
if s.timestamp < now {
|
||||
// 新的毫秒到来重置序列号和时间戳
|
||||
s.number = 0
|
||||
s.timestamp = now
|
||||
}
|
||||
// 生成ID
|
||||
id := (now-epoch)<<timeShift | (s.workerId << workerShift) | (s.number)
|
||||
return id
|
||||
}
|
||||
50
common/utils/alg/snowflake_test.go
Normal file
50
common/utils/alg/snowflake_test.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package alg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type UniqueID interface {
|
||||
~int64 | ~string
|
||||
}
|
||||
|
||||
func idDupCheck[T UniqueID](genIdFunc func() T) {
|
||||
var wg sync.WaitGroup
|
||||
totalIdList := make(map[int]*[]T)
|
||||
for i := 0; i < 1000; i++ {
|
||||
wg.Add(1)
|
||||
_idList := make([]T, 0)
|
||||
_idListPtr := &_idList
|
||||
totalIdList[i] = _idListPtr
|
||||
go func(idListPtr *[]T) {
|
||||
defer wg.Done()
|
||||
for ii := 0; ii < 10000; ii++ {
|
||||
id := genIdFunc()
|
||||
*idListPtr = append(*idListPtr, id)
|
||||
}
|
||||
}(_idListPtr)
|
||||
}
|
||||
wg.Wait()
|
||||
dupCheck := make(map[T]bool)
|
||||
for gid, idListPtr := range totalIdList {
|
||||
for _, id := range *idListPtr {
|
||||
value, exist := dupCheck[id]
|
||||
if exist && value == true {
|
||||
fmt.Printf("find dup id, gid: %v, id: %v\n", gid, id)
|
||||
} else {
|
||||
dupCheck[id] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Printf("check finish\n")
|
||||
}
|
||||
|
||||
func TestSnowflakeGenId(t *testing.T) {
|
||||
snowflake := NewSnowflakeWorker(1)
|
||||
if snowflake == nil {
|
||||
panic("create snowflake worker error")
|
||||
}
|
||||
idDupCheck(snowflake.GenId)
|
||||
}
|
||||
809
common/utils/email/email.go
Normal file
809
common/utils/email/email.go
Normal file
@@ -0,0 +1,809 @@
|
||||
// Package email is designed to provide an "email interface for humans."
|
||||
// Designed to be robust and flexible, the email package aims to make sending email easy without getting in the way.
|
||||
package email
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/tls"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"math/big"
|
||||
"mime"
|
||||
"mime/multipart"
|
||||
"mime/quotedprintable"
|
||||
"net/mail"
|
||||
"net/smtp"
|
||||
"net/textproto"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
const (
|
||||
MaxLineLength = 76 // MaxLineLength is the maximum line length per RFC 2045
|
||||
defaultContentType = "text/plain; charset=us-ascii" // defaultContentType is the default Content-Type according to RFC 2045, section 5.2
|
||||
)
|
||||
|
||||
// ErrMissingBoundary is returned when there is no boundary given for a multipart entity
|
||||
var ErrMissingBoundary = errors.New("No boundary found for multipart entity")
|
||||
|
||||
// ErrMissingContentType is returned when there is no "Content-Type" header for a MIME entity
|
||||
var ErrMissingContentType = errors.New("No Content-Type found for MIME entity")
|
||||
|
||||
// Email is the type used for email messages
|
||||
type Email struct {
|
||||
ReplyTo []string
|
||||
From string
|
||||
To []string
|
||||
Bcc []string
|
||||
Cc []string
|
||||
Subject string
|
||||
Text []byte // Plaintext message (optional)
|
||||
HTML []byte // Html message (optional)
|
||||
Sender string // override From as SMTP envelope sender (optional)
|
||||
Headers textproto.MIMEHeader
|
||||
Attachments []*Attachment
|
||||
ReadReceipt []string
|
||||
}
|
||||
|
||||
// part is a copyable representation of a multipart.Part
|
||||
type part struct {
|
||||
header textproto.MIMEHeader
|
||||
body []byte
|
||||
}
|
||||
|
||||
// NewEmail creates an Email, and returns the pointer to it.
|
||||
func NewEmail() *Email {
|
||||
return &Email{Headers: textproto.MIMEHeader{}}
|
||||
}
|
||||
|
||||
// trimReader is a custom io.Reader that will trim any leading
|
||||
// whitespace, as this can cause email imports to fail.
|
||||
type trimReader struct {
|
||||
rd io.Reader
|
||||
trimmed bool
|
||||
}
|
||||
|
||||
// Read trims off any unicode whitespace from the originating reader
|
||||
func (tr *trimReader) Read(buf []byte) (int, error) {
|
||||
n, err := tr.rd.Read(buf)
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
if !tr.trimmed {
|
||||
t := bytes.TrimLeftFunc(buf[:n], unicode.IsSpace)
|
||||
tr.trimmed = true
|
||||
n = copy(buf, t)
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
func handleAddressList(v []string) []string {
|
||||
res := []string{}
|
||||
for _, a := range v {
|
||||
w := strings.Split(a, ",")
|
||||
for _, addr := range w {
|
||||
decodedAddr, err := (&mime.WordDecoder{}).DecodeHeader(strings.TrimSpace(addr))
|
||||
if err == nil {
|
||||
res = append(res, decodedAddr)
|
||||
} else {
|
||||
res = append(res, addr)
|
||||
}
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// NewEmailFromReader reads a stream of bytes from an io.Reader, r,
|
||||
// and returns an email struct containing the parsed data.
|
||||
// This function expects the data in RFC 5322 format.
|
||||
func NewEmailFromReader(r io.Reader) (*Email, error) {
|
||||
e := NewEmail()
|
||||
s := &trimReader{rd: r}
|
||||
tp := textproto.NewReader(bufio.NewReader(s))
|
||||
// Parse the main headers
|
||||
hdrs, err := tp.ReadMIMEHeader()
|
||||
if err != nil {
|
||||
return e, err
|
||||
}
|
||||
// Set the subject, to, cc, bcc, and from
|
||||
for h, v := range hdrs {
|
||||
switch h {
|
||||
case "Subject":
|
||||
e.Subject = v[0]
|
||||
subj, err := (&mime.WordDecoder{}).DecodeHeader(e.Subject)
|
||||
if err == nil && len(subj) > 0 {
|
||||
e.Subject = subj
|
||||
}
|
||||
delete(hdrs, h)
|
||||
case "To":
|
||||
e.To = handleAddressList(v)
|
||||
delete(hdrs, h)
|
||||
case "Cc":
|
||||
e.Cc = handleAddressList(v)
|
||||
delete(hdrs, h)
|
||||
case "Bcc":
|
||||
e.Bcc = handleAddressList(v)
|
||||
delete(hdrs, h)
|
||||
case "Reply-To":
|
||||
e.ReplyTo = handleAddressList(v)
|
||||
delete(hdrs, h)
|
||||
case "From":
|
||||
e.From = v[0]
|
||||
fr, err := (&mime.WordDecoder{}).DecodeHeader(e.From)
|
||||
if err == nil && len(fr) > 0 {
|
||||
e.From = fr
|
||||
}
|
||||
delete(hdrs, h)
|
||||
}
|
||||
}
|
||||
e.Headers = hdrs
|
||||
body := tp.R
|
||||
// Recursively parse the MIME parts
|
||||
ps, err := parseMIMEParts(e.Headers, body)
|
||||
if err != nil {
|
||||
return e, err
|
||||
}
|
||||
for _, p := range ps {
|
||||
if ct := p.header.Get("Content-Type"); ct == "" {
|
||||
return e, ErrMissingContentType
|
||||
}
|
||||
ct, _, err := mime.ParseMediaType(p.header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return e, err
|
||||
}
|
||||
// Check if part is an attachment based on the existence of the Content-Disposition header with a value of "attachment".
|
||||
if cd := p.header.Get("Content-Disposition"); cd != "" {
|
||||
cd, params, err := mime.ParseMediaType(p.header.Get("Content-Disposition"))
|
||||
if err != nil {
|
||||
return e, err
|
||||
}
|
||||
filename, filenameDefined := params["filename"]
|
||||
if cd == "attachment" || (cd == "inline" && filenameDefined) {
|
||||
_, err = e.Attach(bytes.NewReader(p.body), filename, ct)
|
||||
if err != nil {
|
||||
return e, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case ct == "text/plain":
|
||||
e.Text = p.body
|
||||
case ct == "text/html":
|
||||
e.HTML = p.body
|
||||
}
|
||||
}
|
||||
return e, nil
|
||||
}
|
||||
|
||||
// parseMIMEParts will recursively walk a MIME entity and return a []mime.Part containing
|
||||
// each (flattened) mime.Part found.
|
||||
// It is important to note that there are no limits to the number of recursions, so be
|
||||
// careful when parsing unknown MIME structures!
|
||||
func parseMIMEParts(hs textproto.MIMEHeader, b io.Reader) ([]*part, error) {
|
||||
var ps []*part
|
||||
// If no content type is given, set it to the default
|
||||
if _, ok := hs["Content-Type"]; !ok {
|
||||
hs.Set("Content-Type", defaultContentType)
|
||||
}
|
||||
ct, params, err := mime.ParseMediaType(hs.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return ps, err
|
||||
}
|
||||
// If it's a multipart email, recursively parse the parts
|
||||
if strings.HasPrefix(ct, "multipart/") {
|
||||
if _, ok := params["boundary"]; !ok {
|
||||
return ps, ErrMissingBoundary
|
||||
}
|
||||
mr := multipart.NewReader(b, params["boundary"])
|
||||
for {
|
||||
var buf bytes.Buffer
|
||||
p, err := mr.NextPart()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return ps, err
|
||||
}
|
||||
if _, ok := p.Header["Content-Type"]; !ok {
|
||||
p.Header.Set("Content-Type", defaultContentType)
|
||||
}
|
||||
subct, _, err := mime.ParseMediaType(p.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return ps, err
|
||||
}
|
||||
if strings.HasPrefix(subct, "multipart/") {
|
||||
sps, err := parseMIMEParts(p.Header, p)
|
||||
if err != nil {
|
||||
return ps, err
|
||||
}
|
||||
ps = append(ps, sps...)
|
||||
} else {
|
||||
var reader io.Reader
|
||||
reader = p
|
||||
const cte = "Content-Transfer-Encoding"
|
||||
if p.Header.Get(cte) == "base64" {
|
||||
reader = base64.NewDecoder(base64.StdEncoding, reader)
|
||||
}
|
||||
// Otherwise, just append the part to the list
|
||||
// Copy the part data into the buffer
|
||||
if _, err := io.Copy(&buf, reader); err != nil {
|
||||
return ps, err
|
||||
}
|
||||
ps = append(ps, &part{body: buf.Bytes(), header: p.Header})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If it is not a multipart email, parse the body content as a single "part"
|
||||
switch hs.Get("Content-Transfer-Encoding") {
|
||||
case "quoted-printable":
|
||||
b = quotedprintable.NewReader(b)
|
||||
case "base64":
|
||||
b = base64.NewDecoder(base64.StdEncoding, b)
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
if _, err := io.Copy(&buf, b); err != nil {
|
||||
return ps, err
|
||||
}
|
||||
ps = append(ps, &part{body: buf.Bytes(), header: hs})
|
||||
}
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
// Attach is used to attach content from an io.Reader to the email.
|
||||
// Required parameters include an io.Reader, the desired filename for the attachment, and the Content-Type
|
||||
// The function will return the created Attachment for reference, as well as nil for the error, if successful.
|
||||
func (e *Email) Attach(r io.Reader, filename string, c string) (a *Attachment, err error) {
|
||||
var buffer bytes.Buffer
|
||||
if _, err = io.Copy(&buffer, r); err != nil {
|
||||
return
|
||||
}
|
||||
at := &Attachment{
|
||||
Filename: filename,
|
||||
ContentType: c,
|
||||
Header: textproto.MIMEHeader{},
|
||||
Content: buffer.Bytes(),
|
||||
}
|
||||
e.Attachments = append(e.Attachments, at)
|
||||
return at, nil
|
||||
}
|
||||
|
||||
// AttachFile is used to attach content to the email.
|
||||
// It attempts to open the file referenced by filename and, if successful, creates an Attachment.
|
||||
// This Attachment is then appended to the slice of Email.Attachments.
|
||||
// The function will then return the Attachment for reference, as well as nil for the error, if successful.
|
||||
func (e *Email) AttachFile(filename string) (a *Attachment, err error) {
|
||||
f, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
ct := mime.TypeByExtension(filepath.Ext(filename))
|
||||
basename := filepath.Base(filename)
|
||||
return e.Attach(f, basename, ct)
|
||||
}
|
||||
|
||||
// msgHeaders merges the Email's various fields and custom headers together in a
|
||||
// standards compliant way to create a MIMEHeader to be used in the resulting
|
||||
// message. It does not alter e.Headers.
|
||||
//
|
||||
// "e"'s fields To, Cc, From, Subject will be used unless they are present in
|
||||
// e.Headers. Unless set in e.Headers, "Date" will filled with the current time.
|
||||
func (e *Email) msgHeaders() (textproto.MIMEHeader, error) {
|
||||
res := make(textproto.MIMEHeader, len(e.Headers)+6)
|
||||
if e.Headers != nil {
|
||||
for _, h := range []string{"Reply-To", "To", "Cc", "From", "Subject", "Date", "Message-Id", "MIME-Version"} {
|
||||
if v, ok := e.Headers[h]; ok {
|
||||
res[h] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
// Set headers if there are values.
|
||||
if _, ok := res["Reply-To"]; !ok && len(e.ReplyTo) > 0 {
|
||||
res.Set("Reply-To", strings.Join(e.ReplyTo, ", "))
|
||||
}
|
||||
if _, ok := res["To"]; !ok && len(e.To) > 0 {
|
||||
res.Set("To", strings.Join(e.To, ", "))
|
||||
}
|
||||
if _, ok := res["Cc"]; !ok && len(e.Cc) > 0 {
|
||||
res.Set("Cc", strings.Join(e.Cc, ", "))
|
||||
}
|
||||
if _, ok := res["Subject"]; !ok && e.Subject != "" {
|
||||
res.Set("Subject", e.Subject)
|
||||
}
|
||||
if _, ok := res["Message-Id"]; !ok {
|
||||
id, err := generateMessageID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res.Set("Message-Id", id)
|
||||
}
|
||||
// Date and From are required headers.
|
||||
if _, ok := res["From"]; !ok {
|
||||
res.Set("From", e.From)
|
||||
}
|
||||
if _, ok := res["Date"]; !ok {
|
||||
res.Set("Date", time.Now().Format(time.RFC1123Z))
|
||||
}
|
||||
if _, ok := res["MIME-Version"]; !ok {
|
||||
res.Set("MIME-Version", "1.0")
|
||||
}
|
||||
for field, vals := range e.Headers {
|
||||
if _, ok := res[field]; !ok {
|
||||
res[field] = vals
|
||||
}
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func writeMessage(buff io.Writer, msg []byte, multipart bool, mediaType string, w *multipart.Writer) error {
|
||||
if multipart {
|
||||
header := textproto.MIMEHeader{
|
||||
"Content-Type": {mediaType + "; charset=UTF-8"},
|
||||
"Content-Transfer-Encoding": {"quoted-printable"},
|
||||
}
|
||||
if _, err := w.CreatePart(header); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
qp := quotedprintable.NewWriter(buff)
|
||||
// Write the text
|
||||
if _, err := qp.Write(msg); err != nil {
|
||||
return err
|
||||
}
|
||||
return qp.Close()
|
||||
}
|
||||
|
||||
func (e *Email) categorizeAttachments() (htmlRelated, others []*Attachment) {
|
||||
for _, a := range e.Attachments {
|
||||
if a.HTMLRelated {
|
||||
htmlRelated = append(htmlRelated, a)
|
||||
} else {
|
||||
others = append(others, a)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Bytes converts the Email object to a []byte representation, including all needed MIMEHeaders, boundaries, etc.
|
||||
func (e *Email) Bytes() ([]byte, error) {
|
||||
// TODO: better guess buffer size
|
||||
buff := bytes.NewBuffer(make([]byte, 0, 4096))
|
||||
|
||||
headers, err := e.msgHeaders()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
htmlAttachments, otherAttachments := e.categorizeAttachments()
|
||||
if len(e.HTML) == 0 && len(htmlAttachments) > 0 {
|
||||
return nil, errors.New("there are HTML attachments, but no HTML body")
|
||||
}
|
||||
|
||||
var (
|
||||
isMixed = len(otherAttachments) > 0
|
||||
isAlternative = len(e.Text) > 0 && len(e.HTML) > 0
|
||||
isRelated = len(e.HTML) > 0 && len(htmlAttachments) > 0
|
||||
)
|
||||
|
||||
var w *multipart.Writer
|
||||
if isMixed || isAlternative || isRelated {
|
||||
w = multipart.NewWriter(buff)
|
||||
}
|
||||
switch {
|
||||
case isMixed:
|
||||
headers.Set("Content-Type", "multipart/mixed;\r\n boundary="+w.Boundary())
|
||||
case isAlternative:
|
||||
headers.Set("Content-Type", "multipart/alternative;\r\n boundary="+w.Boundary())
|
||||
case isRelated:
|
||||
headers.Set("Content-Type", "multipart/related;\r\n boundary="+w.Boundary())
|
||||
case len(e.HTML) > 0:
|
||||
headers.Set("Content-Type", "text/html; charset=UTF-8")
|
||||
headers.Set("Content-Transfer-Encoding", "quoted-printable")
|
||||
default:
|
||||
headers.Set("Content-Type", "text/plain; charset=UTF-8")
|
||||
headers.Set("Content-Transfer-Encoding", "quoted-printable")
|
||||
}
|
||||
headerToBytes(buff, headers)
|
||||
_, err = io.WriteString(buff, "\r\n")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Check to see if there is a Text or HTML field
|
||||
if len(e.Text) > 0 || len(e.HTML) > 0 {
|
||||
var subWriter *multipart.Writer
|
||||
|
||||
if isMixed && isAlternative {
|
||||
// Create the multipart alternative part
|
||||
subWriter = multipart.NewWriter(buff)
|
||||
header := textproto.MIMEHeader{
|
||||
"Content-Type": {"multipart/alternative;\r\n boundary=" + subWriter.Boundary()},
|
||||
}
|
||||
if _, err := w.CreatePart(header); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
subWriter = w
|
||||
}
|
||||
// Create the body sections
|
||||
if len(e.Text) > 0 {
|
||||
// Write the text
|
||||
if err := writeMessage(buff, e.Text, isMixed || isAlternative, "text/plain", subWriter); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if len(e.HTML) > 0 {
|
||||
messageWriter := subWriter
|
||||
var relatedWriter *multipart.Writer
|
||||
if (isMixed || isAlternative) && len(htmlAttachments) > 0 {
|
||||
relatedWriter = multipart.NewWriter(buff)
|
||||
header := textproto.MIMEHeader{
|
||||
"Content-Type": {"multipart/related;\r\n boundary=" + relatedWriter.Boundary()},
|
||||
}
|
||||
if _, err := subWriter.CreatePart(header); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
messageWriter = relatedWriter
|
||||
} else if isRelated && len(htmlAttachments) > 0 {
|
||||
relatedWriter = w
|
||||
messageWriter = w
|
||||
}
|
||||
// Write the HTML
|
||||
if err := writeMessage(buff, e.HTML, isMixed || isAlternative || isRelated, "text/html", messageWriter); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(htmlAttachments) > 0 {
|
||||
for _, a := range htmlAttachments {
|
||||
a.setDefaultHeaders()
|
||||
ap, err := relatedWriter.CreatePart(a.Header)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Write the base64Wrapped content to the part
|
||||
base64Wrap(ap, a.Content)
|
||||
}
|
||||
|
||||
if isMixed || isAlternative {
|
||||
relatedWriter.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
if isMixed && isAlternative {
|
||||
if err := subWriter.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create attachment part, if necessary
|
||||
for _, a := range otherAttachments {
|
||||
a.setDefaultHeaders()
|
||||
ap, err := w.CreatePart(a.Header)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Write the base64Wrapped content to the part
|
||||
base64Wrap(ap, a.Content)
|
||||
}
|
||||
if isMixed || isAlternative || isRelated {
|
||||
if err := w.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return buff.Bytes(), nil
|
||||
}
|
||||
|
||||
// Send an email using the given host and SMTP auth (optional), returns any error thrown by smtp.SendMail
|
||||
// This function merges the To, Cc, and Bcc fields and calls the smtp.SendMail function using the Email.Bytes() output as the message
|
||||
func (e *Email) Send(addr string, a smtp.Auth) error {
|
||||
// Merge the To, Cc, and Bcc fields
|
||||
to := make([]string, 0, len(e.To)+len(e.Cc)+len(e.Bcc))
|
||||
to = append(append(append(to, e.To...), e.Cc...), e.Bcc...)
|
||||
for i := 0; i < len(to); i++ {
|
||||
addr, err := mail.ParseAddress(to[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
to[i] = addr.Address
|
||||
}
|
||||
// Check to make sure there is at least one recipient and one "From" address
|
||||
if e.From == "" || len(to) == 0 {
|
||||
return errors.New("Must specify at least one From address and one To address")
|
||||
}
|
||||
sender, err := e.parseSender()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
raw, err := e.Bytes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return smtp.SendMail(addr, a, sender, to, raw)
|
||||
}
|
||||
|
||||
// Select and parse an SMTP envelope sender address. Choose Email.Sender if set, or fallback to Email.From.
|
||||
func (e *Email) parseSender() (string, error) {
|
||||
if e.Sender != "" {
|
||||
sender, err := mail.ParseAddress(e.Sender)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return sender.Address, nil
|
||||
} else {
|
||||
from, err := mail.ParseAddress(e.From)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return from.Address, nil
|
||||
}
|
||||
}
|
||||
|
||||
// SendWithTLS sends an email over tls with an optional TLS config.
|
||||
//
|
||||
// The TLS Config is helpful if you need to connect to a host that is used an untrusted
|
||||
// certificate.
|
||||
func (e *Email) SendWithTLS(addr string, a smtp.Auth, t *tls.Config) error {
|
||||
// Merge the To, Cc, and Bcc fields
|
||||
to := make([]string, 0, len(e.To)+len(e.Cc)+len(e.Bcc))
|
||||
to = append(append(append(to, e.To...), e.Cc...), e.Bcc...)
|
||||
for i := 0; i < len(to); i++ {
|
||||
addr, err := mail.ParseAddress(to[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
to[i] = addr.Address
|
||||
}
|
||||
// Check to make sure there is at least one recipient and one "From" address
|
||||
if e.From == "" || len(to) == 0 {
|
||||
return errors.New("Must specify at least one From address and one To address")
|
||||
}
|
||||
sender, err := e.parseSender()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
raw, err := e.Bytes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
conn, err := tls.Dial("tcp", addr, t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := smtp.NewClient(conn, t.ServerName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer c.Close()
|
||||
if err = c.Hello("localhost"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if a != nil {
|
||||
if ok, _ := c.Extension("AUTH"); ok {
|
||||
if err = c.Auth(a); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if err = c.Mail(sender); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, addr := range to {
|
||||
if err = c.Rcpt(addr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
w, err := c.Data()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = w.Write(raw)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.Quit()
|
||||
}
|
||||
|
||||
// SendWithStartTLS sends an email over TLS using STARTTLS with an optional TLS config.
|
||||
//
|
||||
// The TLS Config is helpful if you need to connect to a host that is used an untrusted
|
||||
// certificate.
|
||||
func (e *Email) SendWithStartTLS(addr string, a smtp.Auth, t *tls.Config) error {
|
||||
// Merge the To, Cc, and Bcc fields
|
||||
to := make([]string, 0, len(e.To)+len(e.Cc)+len(e.Bcc))
|
||||
to = append(append(append(to, e.To...), e.Cc...), e.Bcc...)
|
||||
for i := 0; i < len(to); i++ {
|
||||
addr, err := mail.ParseAddress(to[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
to[i] = addr.Address
|
||||
}
|
||||
// Check to make sure there is at least one recipient and one "From" address
|
||||
if e.From == "" || len(to) == 0 {
|
||||
return errors.New("Must specify at least one From address and one To address")
|
||||
}
|
||||
sender, err := e.parseSender()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
raw, err := e.Bytes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Taken from the standard library
|
||||
// https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L328
|
||||
c, err := smtp.Dial(addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer c.Close()
|
||||
if err = c.Hello("localhost"); err != nil {
|
||||
return err
|
||||
}
|
||||
// Use TLS if available
|
||||
if ok, _ := c.Extension("STARTTLS"); ok {
|
||||
if err = c.StartTLS(t); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if a != nil {
|
||||
if ok, _ := c.Extension("AUTH"); ok {
|
||||
if err = c.Auth(a); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if err = c.Mail(sender); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, addr := range to {
|
||||
if err = c.Rcpt(addr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
w, err := c.Data()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = w.Write(raw)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.Quit()
|
||||
}
|
||||
|
||||
// Attachment is a struct representing an email attachment.
|
||||
// Based on the mime/multipart.FileHeader struct, Attachment contains the name, MIMEHeader, and content of the attachment in question
|
||||
type Attachment struct {
|
||||
Filename string
|
||||
ContentType string
|
||||
Header textproto.MIMEHeader
|
||||
Content []byte
|
||||
HTMLRelated bool
|
||||
}
|
||||
|
||||
func (at *Attachment) setDefaultHeaders() {
|
||||
contentType := "application/octet-stream"
|
||||
if len(at.ContentType) > 0 {
|
||||
contentType = at.ContentType
|
||||
}
|
||||
at.Header.Set("Content-Type", contentType)
|
||||
|
||||
if len(at.Header.Get("Content-Disposition")) == 0 {
|
||||
disposition := "attachment"
|
||||
if at.HTMLRelated {
|
||||
disposition = "inline"
|
||||
}
|
||||
at.Header.Set("Content-Disposition", fmt.Sprintf("%s;\r\n filename=\"%s\"", disposition, at.Filename))
|
||||
}
|
||||
if len(at.Header.Get("Content-ID")) == 0 {
|
||||
at.Header.Set("Content-ID", fmt.Sprintf("<%s>", at.Filename))
|
||||
}
|
||||
if len(at.Header.Get("Content-Transfer-Encoding")) == 0 {
|
||||
at.Header.Set("Content-Transfer-Encoding", "base64")
|
||||
}
|
||||
}
|
||||
|
||||
// base64Wrap encodes the attachment content, and wraps it according to RFC 2045 standards (every 76 chars)
|
||||
// The output is then written to the specified io.Writer
|
||||
func base64Wrap(w io.Writer, b []byte) {
|
||||
// 57 raw bytes per 76-byte base64 line.
|
||||
const maxRaw = 57
|
||||
// Buffer for each line, including trailing CRLF.
|
||||
buffer := make([]byte, MaxLineLength+len("\r\n"))
|
||||
copy(buffer[MaxLineLength:], "\r\n")
|
||||
// Process raw chunks until there's no longer enough to fill a line.
|
||||
for len(b) >= maxRaw {
|
||||
base64.StdEncoding.Encode(buffer, b[:maxRaw])
|
||||
w.Write(buffer)
|
||||
b = b[maxRaw:]
|
||||
}
|
||||
// Handle the last chunk of bytes.
|
||||
if len(b) > 0 {
|
||||
out := buffer[:base64.StdEncoding.EncodedLen(len(b))]
|
||||
base64.StdEncoding.Encode(out, b)
|
||||
out = append(out, "\r\n"...)
|
||||
w.Write(out)
|
||||
}
|
||||
}
|
||||
|
||||
// headerToBytes renders "header" to "buff". If there are multiple values for a
|
||||
// field, multiple "Field: value\r\n" lines will be emitted.
|
||||
func headerToBytes(buff io.Writer, header textproto.MIMEHeader) {
|
||||
for field, vals := range header {
|
||||
for _, subval := range vals {
|
||||
// bytes.Buffer.Write() never returns an error.
|
||||
io.WriteString(buff, field)
|
||||
io.WriteString(buff, ": ")
|
||||
// Write the encoded header if needed
|
||||
switch {
|
||||
case field == "Content-Type" || field == "Content-Disposition":
|
||||
buff.Write([]byte(subval))
|
||||
case field == "From" || field == "To" || field == "Cc" || field == "Bcc":
|
||||
participants := strings.Split(subval, ",")
|
||||
for i, v := range participants {
|
||||
addr, err := mail.ParseAddress(v)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
participants[i] = addr.String()
|
||||
}
|
||||
buff.Write([]byte(strings.Join(participants, ", ")))
|
||||
default:
|
||||
buff.Write([]byte(mime.QEncoding.Encode("UTF-8", subval)))
|
||||
}
|
||||
io.WriteString(buff, "\r\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var maxBigInt = big.NewInt(math.MaxInt64)
|
||||
|
||||
// generateMessageID generates and returns a string suitable for an RFC 2822
|
||||
// compliant Message-ID, e.g.:
|
||||
// <1444789264909237300.3464.1819418242800517193@DESKTOP01>
|
||||
//
|
||||
// The following parameters are used to generate a Message-ID:
|
||||
// - The nanoseconds since Epoch
|
||||
// - The calling PID
|
||||
// - A cryptographically random int64
|
||||
// - The sending hostname
|
||||
func generateMessageID() (string, error) {
|
||||
t := time.Now().UnixNano()
|
||||
pid := os.Getpid()
|
||||
rint, err := rand.Int(rand.Reader, maxBigInt)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
h, err := os.Hostname()
|
||||
// If we can't get the hostname, we'll use localhost
|
||||
if err != nil {
|
||||
h = "localhost.localdomain"
|
||||
}
|
||||
msgid := fmt.Sprintf("<%d.%d.%d@%s>", t, pid, rint, h)
|
||||
return msgid, nil
|
||||
}
|
||||
933
common/utils/email/email_test.go
Normal file
933
common/utils/email/email_test.go
Normal file
@@ -0,0 +1,933 @@
|
||||
package email
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"bufio"
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"mime/multipart"
|
||||
"mime/quotedprintable"
|
||||
"net/mail"
|
||||
"net/smtp"
|
||||
"net/textproto"
|
||||
)
|
||||
|
||||
func prepareEmail() *Email {
|
||||
e := NewEmail()
|
||||
e.From = "Jordan Wright <test@example.com>"
|
||||
e.To = []string{"test@example.com"}
|
||||
e.Bcc = []string{"test_bcc@example.com"}
|
||||
e.Cc = []string{"test_cc@example.com"}
|
||||
e.Subject = "Awesome Subject"
|
||||
return e
|
||||
}
|
||||
|
||||
func basicTests(t *testing.T, e *Email) *mail.Message {
|
||||
raw, err := e.Bytes()
|
||||
if err != nil {
|
||||
t.Fatal("Failed to render message: ", e)
|
||||
}
|
||||
|
||||
msg, err := mail.ReadMessage(bytes.NewBuffer(raw))
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse rendered message: ", err)
|
||||
}
|
||||
|
||||
expectedHeaders := map[string]string{
|
||||
"To": "<test@example.com>",
|
||||
"From": "\"Jordan Wright\" <test@example.com>",
|
||||
"Cc": "<test_cc@example.com>",
|
||||
"Subject": "Awesome Subject",
|
||||
}
|
||||
|
||||
for header, expected := range expectedHeaders {
|
||||
if val := msg.Header.Get(header); val != expected {
|
||||
t.Errorf("Wrong value for message header %s: %v != %v", header, expected, val)
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
func TestEmailText(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
e.Text = []byte("Text Body is, of course, supported!\n")
|
||||
|
||||
msg := basicTests(t, e)
|
||||
|
||||
// Were the right headers set?
|
||||
ct := msg.Header.Get("Content-type")
|
||||
mt, _, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
t.Fatal("Content-type header is invalid: ", ct)
|
||||
} else if mt != "text/plain" {
|
||||
t.Fatalf("Content-type expected \"text/plain\", not %v", mt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailWithHTMLAttachments(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
|
||||
// Set plain text to exercise "mime/alternative"
|
||||
e.Text = []byte("Text Body is, of course, supported!\n")
|
||||
|
||||
e.HTML = []byte("<html><body>This is a text.</body></html>")
|
||||
|
||||
// Set HTML attachment to exercise "mime/related".
|
||||
attachment, err := e.Attach(bytes.NewBufferString("Rad attachment"), "rad.txt", "image/png; charset=utf-8")
|
||||
if err != nil {
|
||||
t.Fatal("Could not add an attachment to the message: ", err)
|
||||
}
|
||||
attachment.HTMLRelated = true
|
||||
|
||||
b, err := e.Bytes()
|
||||
if err != nil {
|
||||
t.Fatal("Could not serialize e-mail:", err)
|
||||
}
|
||||
|
||||
// Print the bytes for ocular validation and make sure no errors.
|
||||
//fmt.Println(string(b))
|
||||
|
||||
// TODO: Verify the attachments.
|
||||
s := &trimReader{rd: bytes.NewBuffer(b)}
|
||||
tp := textproto.NewReader(bufio.NewReader(s))
|
||||
// Parse the main headers
|
||||
hdrs, err := tp.ReadMIMEHeader()
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse the headers:", err)
|
||||
}
|
||||
// Recursively parse the MIME parts
|
||||
ps, err := parseMIMEParts(hdrs, tp.R)
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse the MIME parts recursively:", err)
|
||||
}
|
||||
|
||||
plainTextFound := false
|
||||
htmlFound := false
|
||||
imageFound := false
|
||||
if expected, actual := 3, len(ps); actual != expected {
|
||||
t.Error("Unexpected number of parts. Expected:", expected, "Was:", actual)
|
||||
}
|
||||
for _, part := range ps {
|
||||
// part has "header" and "body []byte"
|
||||
cd := part.header.Get("Content-Disposition")
|
||||
ct := part.header.Get("Content-Type")
|
||||
if strings.Contains(ct, "image/png") && strings.HasPrefix(cd, "inline") {
|
||||
imageFound = true
|
||||
}
|
||||
if strings.Contains(ct, "text/html") {
|
||||
htmlFound = true
|
||||
}
|
||||
if strings.Contains(ct, "text/plain") {
|
||||
plainTextFound = true
|
||||
}
|
||||
}
|
||||
|
||||
if !plainTextFound {
|
||||
t.Error("Did not find plain text part.")
|
||||
}
|
||||
if !htmlFound {
|
||||
t.Error("Did not find HTML part.")
|
||||
}
|
||||
if !imageFound {
|
||||
t.Error("Did not find image part.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailWithHTMLAttachmentsHTMLOnly(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
|
||||
e.HTML = []byte("<html><body>This is a text.</body></html>")
|
||||
|
||||
// Set HTML attachment to exercise "mime/related".
|
||||
attachment, err := e.Attach(bytes.NewBufferString("Rad attachment"), "rad.txt", "image/png; charset=utf-8")
|
||||
if err != nil {
|
||||
t.Fatal("Could not add an attachment to the message: ", err)
|
||||
}
|
||||
attachment.HTMLRelated = true
|
||||
|
||||
b, err := e.Bytes()
|
||||
if err != nil {
|
||||
t.Fatal("Could not serialize e-mail:", err)
|
||||
}
|
||||
|
||||
// Print the bytes for ocular validation and make sure no errors.
|
||||
//fmt.Println(string(b))
|
||||
|
||||
// TODO: Verify the attachments.
|
||||
s := &trimReader{rd: bytes.NewBuffer(b)}
|
||||
tp := textproto.NewReader(bufio.NewReader(s))
|
||||
// Parse the main headers
|
||||
hdrs, err := tp.ReadMIMEHeader()
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse the headers:", err)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(hdrs.Get("Content-Type"), "multipart/related") {
|
||||
t.Error("Envelope Content-Type is not multipart/related: ", hdrs["Content-Type"])
|
||||
}
|
||||
|
||||
// Recursively parse the MIME parts
|
||||
ps, err := parseMIMEParts(hdrs, tp.R)
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse the MIME parts recursively:", err)
|
||||
}
|
||||
|
||||
htmlFound := false
|
||||
imageFound := false
|
||||
if expected, actual := 2, len(ps); actual != expected {
|
||||
t.Error("Unexpected number of parts. Expected:", expected, "Was:", actual)
|
||||
}
|
||||
for _, part := range ps {
|
||||
// part has "header" and "body []byte"
|
||||
ct := part.header.Get("Content-Type")
|
||||
if strings.Contains(ct, "image/png") {
|
||||
imageFound = true
|
||||
}
|
||||
if strings.Contains(ct, "text/html") {
|
||||
htmlFound = true
|
||||
}
|
||||
}
|
||||
|
||||
if !htmlFound {
|
||||
t.Error("Did not find HTML part.")
|
||||
}
|
||||
if !imageFound {
|
||||
t.Error("Did not find image part.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailHTML(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
e.HTML = []byte("<h1>Fancy Html is supported, too!</h1>\n")
|
||||
|
||||
msg := basicTests(t, e)
|
||||
|
||||
// Were the right headers set?
|
||||
ct := msg.Header.Get("Content-type")
|
||||
mt, _, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
t.Fatalf("Content-type header is invalid: %#v", ct)
|
||||
} else if mt != "text/html" {
|
||||
t.Fatalf("Content-type expected \"text/html\", not %v", mt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailTextAttachment(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
e.Text = []byte("Text Body is, of course, supported!\n")
|
||||
_, err := e.Attach(bytes.NewBufferString("Rad attachment"), "rad.txt", "text/plain; charset=utf-8")
|
||||
if err != nil {
|
||||
t.Fatal("Could not add an attachment to the message: ", err)
|
||||
}
|
||||
|
||||
msg := basicTests(t, e)
|
||||
|
||||
// Were the right headers set?
|
||||
ct := msg.Header.Get("Content-type")
|
||||
mt, params, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
t.Fatal("Content-type header is invalid: ", ct)
|
||||
} else if mt != "multipart/mixed" {
|
||||
t.Fatalf("Content-type expected \"multipart/mixed\", not %v", mt)
|
||||
}
|
||||
b := params["boundary"]
|
||||
if b == "" {
|
||||
t.Fatalf("Invalid or missing boundary parameter: %#v", b)
|
||||
}
|
||||
if len(params) != 1 {
|
||||
t.Fatal("Unexpected content-type parameters")
|
||||
}
|
||||
|
||||
// Is the generated message parsable?
|
||||
mixed := multipart.NewReader(msg.Body, params["boundary"])
|
||||
|
||||
text, err := mixed.NextPart()
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find text component of email: %s", err)
|
||||
}
|
||||
|
||||
// Does the text portion match what we expect?
|
||||
mt, _, err = mime.ParseMediaType(text.Header.Get("Content-type"))
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse message's Content-Type")
|
||||
} else if mt != "text/plain" {
|
||||
t.Fatal("Message missing text/plain")
|
||||
}
|
||||
plainText, err := ioutil.ReadAll(text)
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
if !bytes.Equal(plainText, []byte("Text Body is, of course, supported!\r\n")) {
|
||||
t.Fatalf("Plain text is broken: %#q", plainText)
|
||||
}
|
||||
|
||||
// Check attachments.
|
||||
_, err = mixed.NextPart()
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find attachment component of email: %s", err)
|
||||
}
|
||||
|
||||
if _, err = mixed.NextPart(); err != io.EOF {
|
||||
t.Error("Expected only text and one attachment!")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailTextHtmlAttachment(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
e.Text = []byte("Text Body is, of course, supported!\n")
|
||||
e.HTML = []byte("<h1>Fancy Html is supported, too!</h1>\n")
|
||||
_, err := e.Attach(bytes.NewBufferString("Rad attachment"), "rad.txt", "text/plain; charset=utf-8")
|
||||
if err != nil {
|
||||
t.Fatal("Could not add an attachment to the message: ", err)
|
||||
}
|
||||
|
||||
msg := basicTests(t, e)
|
||||
|
||||
// Were the right headers set?
|
||||
ct := msg.Header.Get("Content-type")
|
||||
mt, params, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
t.Fatal("Content-type header is invalid: ", ct)
|
||||
} else if mt != "multipart/mixed" {
|
||||
t.Fatalf("Content-type expected \"multipart/mixed\", not %v", mt)
|
||||
}
|
||||
b := params["boundary"]
|
||||
if b == "" {
|
||||
t.Fatal("Unexpected empty boundary parameter")
|
||||
}
|
||||
if len(params) != 1 {
|
||||
t.Fatal("Unexpected content-type parameters")
|
||||
}
|
||||
|
||||
// Is the generated message parsable?
|
||||
mixed := multipart.NewReader(msg.Body, params["boundary"])
|
||||
|
||||
text, err := mixed.NextPart()
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find text component of email: %s", err)
|
||||
}
|
||||
|
||||
// Does the text portion match what we expect?
|
||||
mt, params, err = mime.ParseMediaType(text.Header.Get("Content-type"))
|
||||
if err != nil {
|
||||
t.Fatal("Could not parse message's Content-Type")
|
||||
} else if mt != "multipart/alternative" {
|
||||
t.Fatal("Message missing multipart/alternative")
|
||||
}
|
||||
mpReader := multipart.NewReader(text, params["boundary"])
|
||||
part, err := mpReader.NextPart()
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
plainText, err := ioutil.ReadAll(part)
|
||||
if err != nil {
|
||||
t.Fatal("Could not read plain text component of message: ", err)
|
||||
}
|
||||
if !bytes.Equal(plainText, []byte("Text Body is, of course, supported!\r\n")) {
|
||||
t.Fatalf("Plain text is broken: %#q", plainText)
|
||||
}
|
||||
|
||||
// Check attachments.
|
||||
_, err = mixed.NextPart()
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find attachment component of email: %s", err)
|
||||
}
|
||||
|
||||
if _, err = mixed.NextPart(); err != io.EOF {
|
||||
t.Error("Expected only text and one attachment!")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailAttachment(t *testing.T) {
|
||||
e := prepareEmail()
|
||||
_, err := e.Attach(bytes.NewBufferString("Rad attachment"), "rad.txt", "text/plain; charset=utf-8")
|
||||
if err != nil {
|
||||
t.Fatal("Could not add an attachment to the message: ", err)
|
||||
}
|
||||
msg := basicTests(t, e)
|
||||
|
||||
// Were the right headers set?
|
||||
ct := msg.Header.Get("Content-type")
|
||||
mt, params, err := mime.ParseMediaType(ct)
|
||||
if err != nil {
|
||||
t.Fatal("Content-type header is invalid: ", ct)
|
||||
} else if mt != "multipart/mixed" {
|
||||
t.Fatalf("Content-type expected \"multipart/mixed\", not %v", mt)
|
||||
}
|
||||
b := params["boundary"]
|
||||
if b == "" {
|
||||
t.Fatal("Unexpected empty boundary parameter")
|
||||
}
|
||||
if len(params) != 1 {
|
||||
t.Fatal("Unexpected content-type parameters")
|
||||
}
|
||||
|
||||
// Is the generated message parsable?
|
||||
mixed := multipart.NewReader(msg.Body, params["boundary"])
|
||||
|
||||
// Check attachments.
|
||||
a, err := mixed.NextPart()
|
||||
if err != nil {
|
||||
t.Fatalf("Could not find attachment component of email: %s", err)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(a.Header.Get("Content-Disposition"), "attachment") {
|
||||
t.Fatalf("Content disposition is not attachment: %s", a.Header.Get("Content-Disposition"))
|
||||
}
|
||||
|
||||
if _, err = mixed.NextPart(); err != io.EOF {
|
||||
t.Error("Expected only one attachment!")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHeaderEncoding(t *testing.T) {
|
||||
cases := []struct {
|
||||
field string
|
||||
have string
|
||||
want string
|
||||
}{
|
||||
{
|
||||
field: "From",
|
||||
have: "Needs Encóding <encoding@example.com>, Only ASCII <foo@example.com>",
|
||||
want: "=?utf-8?q?Needs_Enc=C3=B3ding?= <encoding@example.com>, \"Only ASCII\" <foo@example.com>\r\n",
|
||||
},
|
||||
{
|
||||
field: "To",
|
||||
have: "Keith Moore <moore@cs.utk.edu>, Keld Jørn Simonsen <keld@dkuug.dk>",
|
||||
want: "\"Keith Moore\" <moore@cs.utk.edu>, =?utf-8?q?Keld_J=C3=B8rn_Simonsen?= <keld@dkuug.dk>\r\n",
|
||||
},
|
||||
{
|
||||
field: "Cc",
|
||||
have: "Needs Encóding <encoding@example.com>, \"Test :)\" <test@localhost>",
|
||||
want: "=?utf-8?q?Needs_Enc=C3=B3ding?= <encoding@example.com>, \"Test :)\" <test@localhost>\r\n",
|
||||
},
|
||||
{
|
||||
field: "Subject",
|
||||
have: "Subject with a 🐟",
|
||||
want: "=?UTF-8?q?Subject_with_a_=F0=9F=90=9F?=\r\n",
|
||||
},
|
||||
{
|
||||
field: "Subject",
|
||||
have: "Subject with only ASCII",
|
||||
want: "Subject with only ASCII\r\n",
|
||||
},
|
||||
}
|
||||
buff := &bytes.Buffer{}
|
||||
for _, c := range cases {
|
||||
header := make(textproto.MIMEHeader)
|
||||
header.Add(c.field, c.have)
|
||||
buff.Reset()
|
||||
headerToBytes(buff, header)
|
||||
want := fmt.Sprintf("%s: %s", c.field, c.want)
|
||||
got := buff.String()
|
||||
if got != want {
|
||||
t.Errorf("invalid utf-8 header encoding. \nwant:%#v\ngot: %#v", want, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmailFromReader(t *testing.T) {
|
||||
ex := &Email{
|
||||
Subject: "Test Subject",
|
||||
To: []string{"Jordan Wright <jmwright798@gmail.com>", "also@example.com"},
|
||||
From: "Jordan Wright <jmwright798@gmail.com>",
|
||||
ReplyTo: []string{"Jordan Wright <jmwright798@gmail.com>"},
|
||||
Cc: []string{"one@example.com", "Two <two@example.com>"},
|
||||
Bcc: []string{"three@example.com", "Four <four@example.com>"},
|
||||
Text: []byte("This is a test email with HTML Formatting. It also has very long lines so\nthat the content must be wrapped if using quoted-printable decoding.\n"),
|
||||
HTML: []byte("<div dir=\"ltr\">This is a test email with <b>HTML Formatting.</b>\u00a0It also has very long lines so that the content must be wrapped if using quoted-printable decoding.</div>\n"),
|
||||
}
|
||||
raw := []byte(`
|
||||
MIME-Version: 1.0
|
||||
Subject: Test Subject
|
||||
From: Jordan Wright <jmwright798@gmail.com>
|
||||
Reply-To: Jordan Wright <jmwright798@gmail.com>
|
||||
To: Jordan Wright <jmwright798@gmail.com>, also@example.com
|
||||
Cc: one@example.com, Two <two@example.com>
|
||||
Bcc: three@example.com, Four <four@example.com>
|
||||
Content-Type: multipart/alternative; boundary=001a114fb3fc42fd6b051f834280
|
||||
|
||||
--001a114fb3fc42fd6b051f834280
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
|
||||
This is a test email with HTML Formatting. It also has very long lines so
|
||||
that the content must be wrapped if using quoted-printable decoding.
|
||||
|
||||
--001a114fb3fc42fd6b051f834280
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<div dir=3D"ltr">This is a test email with <b>HTML Formatting.</b>=C2=A0It =
|
||||
also has very long lines so that the content must be wrapped if using quote=
|
||||
d-printable decoding.</div>
|
||||
|
||||
--001a114fb3fc42fd6b051f834280--`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating email %s", err.Error())
|
||||
}
|
||||
if e.Subject != ex.Subject {
|
||||
t.Fatalf("Incorrect subject. %#q != %#q", e.Subject, ex.Subject)
|
||||
}
|
||||
if !bytes.Equal(e.Text, ex.Text) {
|
||||
t.Fatalf("Incorrect text: %#q != %#q", e.Text, ex.Text)
|
||||
}
|
||||
if !bytes.Equal(e.HTML, ex.HTML) {
|
||||
t.Fatalf("Incorrect HTML: %#q != %#q", e.HTML, ex.HTML)
|
||||
}
|
||||
if e.From != ex.From {
|
||||
t.Fatalf("Incorrect \"From\": %#q != %#q", e.From, ex.From)
|
||||
}
|
||||
if len(e.To) != len(ex.To) {
|
||||
t.Fatalf("Incorrect number of \"To\" addresses: %v != %v", len(e.To), len(ex.To))
|
||||
}
|
||||
if e.To[0] != ex.To[0] {
|
||||
t.Fatalf("Incorrect \"To[0]\": %#q != %#q", e.To[0], ex.To[0])
|
||||
}
|
||||
if e.To[1] != ex.To[1] {
|
||||
t.Fatalf("Incorrect \"To[1]\": %#q != %#q", e.To[1], ex.To[1])
|
||||
}
|
||||
if len(e.Cc) != len(ex.Cc) {
|
||||
t.Fatalf("Incorrect number of \"Cc\" addresses: %v != %v", len(e.Cc), len(ex.Cc))
|
||||
}
|
||||
if e.Cc[0] != ex.Cc[0] {
|
||||
t.Fatalf("Incorrect \"Cc[0]\": %#q != %#q", e.Cc[0], ex.Cc[0])
|
||||
}
|
||||
if e.Cc[1] != ex.Cc[1] {
|
||||
t.Fatalf("Incorrect \"Cc[1]\": %#q != %#q", e.Cc[1], ex.Cc[1])
|
||||
}
|
||||
if len(e.Bcc) != len(ex.Bcc) {
|
||||
t.Fatalf("Incorrect number of \"Bcc\" addresses: %v != %v", len(e.Bcc), len(ex.Bcc))
|
||||
}
|
||||
if e.Bcc[0] != ex.Bcc[0] {
|
||||
t.Fatalf("Incorrect \"Bcc[0]\": %#q != %#q", e.Cc[0], ex.Cc[0])
|
||||
}
|
||||
if e.Bcc[1] != ex.Bcc[1] {
|
||||
t.Fatalf("Incorrect \"Bcc[1]\": %#q != %#q", e.Bcc[1], ex.Bcc[1])
|
||||
}
|
||||
if len(e.ReplyTo) != len(ex.ReplyTo) {
|
||||
t.Fatalf("Incorrect number of \"Reply-To\" addresses: %v != %v", len(e.ReplyTo), len(ex.ReplyTo))
|
||||
}
|
||||
if e.ReplyTo[0] != ex.ReplyTo[0] {
|
||||
t.Fatalf("Incorrect \"ReplyTo\": %#q != %#q", e.ReplyTo[0], ex.ReplyTo[0])
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonAsciiEmailFromReader(t *testing.T) {
|
||||
ex := &Email{
|
||||
Subject: "Test Subject",
|
||||
To: []string{"Anaïs <anais@example.org>"},
|
||||
Cc: []string{"Patrik Fältström <paf@example.com>"},
|
||||
From: "Mrs Valérie Dupont <valerie.dupont@example.com>",
|
||||
Text: []byte("This is a test message!"),
|
||||
}
|
||||
raw := []byte(`
|
||||
MIME-Version: 1.0
|
||||
Subject: =?UTF-8?Q?Test Subject?=
|
||||
From: Mrs =?ISO-8859-1?Q?Val=C3=A9rie=20Dupont?= <valerie.dupont@example.com>
|
||||
To: =?utf-8?q?Ana=C3=AFs?= <anais@example.org>
|
||||
Cc: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@example.com>
|
||||
Content-type: text/plain; charset=ISO-8859-1
|
||||
|
||||
This is a test message!`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating email %s", err.Error())
|
||||
}
|
||||
if e.Subject != ex.Subject {
|
||||
t.Fatalf("Incorrect subject. %#q != %#q", e.Subject, ex.Subject)
|
||||
}
|
||||
if e.From != ex.From {
|
||||
t.Fatalf("Incorrect \"From\": %#q != %#q", e.From, ex.From)
|
||||
}
|
||||
if e.To[0] != ex.To[0] {
|
||||
t.Fatalf("Incorrect \"To\": %#q != %#q", e.To, ex.To)
|
||||
}
|
||||
if e.Cc[0] != ex.Cc[0] {
|
||||
t.Fatalf("Incorrect \"Cc\": %#q != %#q", e.Cc, ex.Cc)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonMultipartEmailFromReader(t *testing.T) {
|
||||
ex := &Email{
|
||||
Text: []byte("This is a test message!"),
|
||||
Subject: "Example Subject (no MIME Type)",
|
||||
Headers: textproto.MIMEHeader{},
|
||||
}
|
||||
ex.Headers.Add("Content-Type", "text/plain; charset=us-ascii")
|
||||
ex.Headers.Add("Message-ID", "<foobar@example.com>")
|
||||
raw := []byte(`From: "Foo Bar" <foobar@example.com>
|
||||
Content-Type: text/plain
|
||||
To: foobar@example.com
|
||||
Subject: Example Subject (no MIME Type)
|
||||
Message-ID: <foobar@example.com>
|
||||
|
||||
This is a test message!`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating email %s", err.Error())
|
||||
}
|
||||
if ex.Subject != e.Subject {
|
||||
t.Errorf("Incorrect subject. %#q != %#q\n", ex.Subject, e.Subject)
|
||||
}
|
||||
if !bytes.Equal(ex.Text, e.Text) {
|
||||
t.Errorf("Incorrect body. %#q != %#q\n", ex.Text, e.Text)
|
||||
}
|
||||
if ex.Headers.Get("Message-ID") != e.Headers.Get("Message-ID") {
|
||||
t.Errorf("Incorrect message ID. %#q != %#q\n", ex.Headers.Get("Message-ID"), e.Headers.Get("Message-ID"))
|
||||
}
|
||||
}
|
||||
|
||||
func TestBase64EmailFromReader(t *testing.T) {
|
||||
ex := &Email{
|
||||
Subject: "Test Subject",
|
||||
To: []string{"Jordan Wright <jmwright798@gmail.com>"},
|
||||
From: "Jordan Wright <jmwright798@gmail.com>",
|
||||
Text: []byte("This is a test email with HTML Formatting. It also has very long lines so that the content must be wrapped if using quoted-printable decoding."),
|
||||
HTML: []byte("<div dir=\"ltr\">This is a test email with <b>HTML Formatting.</b>\u00a0It also has very long lines so that the content must be wrapped if using quoted-printable decoding.</div>\n"),
|
||||
}
|
||||
raw := []byte(`
|
||||
MIME-Version: 1.0
|
||||
Subject: Test Subject
|
||||
From: Jordan Wright <jmwright798@gmail.com>
|
||||
To: Jordan Wright <jmwright798@gmail.com>
|
||||
Content-Type: multipart/alternative; boundary=001a114fb3fc42fd6b051f834280
|
||||
|
||||
--001a114fb3fc42fd6b051f834280
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: base64
|
||||
|
||||
VGhpcyBpcyBhIHRlc3QgZW1haWwgd2l0aCBIVE1MIEZvcm1hdHRpbmcuIEl0IGFsc28gaGFzIHZl
|
||||
cnkgbG9uZyBsaW5lcyBzbyB0aGF0IHRoZSBjb250ZW50IG11c3QgYmUgd3JhcHBlZCBpZiB1c2lu
|
||||
ZyBxdW90ZWQtcHJpbnRhYmxlIGRlY29kaW5nLg==
|
||||
|
||||
--001a114fb3fc42fd6b051f834280
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<div dir=3D"ltr">This is a test email with <b>HTML Formatting.</b>=C2=A0It =
|
||||
also has very long lines so that the content must be wrapped if using quote=
|
||||
d-printable decoding.</div>
|
||||
|
||||
--001a114fb3fc42fd6b051f834280--`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating email %s", err.Error())
|
||||
}
|
||||
if e.Subject != ex.Subject {
|
||||
t.Fatalf("Incorrect subject. %#q != %#q", e.Subject, ex.Subject)
|
||||
}
|
||||
if !bytes.Equal(e.Text, ex.Text) {
|
||||
t.Fatalf("Incorrect text: %#q != %#q", e.Text, ex.Text)
|
||||
}
|
||||
if !bytes.Equal(e.HTML, ex.HTML) {
|
||||
t.Fatalf("Incorrect HTML: %#q != %#q", e.HTML, ex.HTML)
|
||||
}
|
||||
if e.From != ex.From {
|
||||
t.Fatalf("Incorrect \"From\": %#q != %#q", e.From, ex.From)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAttachmentEmailFromReader(t *testing.T) {
|
||||
ex := &Email{
|
||||
Subject: "Test Subject",
|
||||
To: []string{"Jordan Wright <jmwright798@gmail.com>"},
|
||||
From: "Jordan Wright <jmwright798@gmail.com>",
|
||||
Text: []byte("Simple text body"),
|
||||
HTML: []byte("<div dir=\"ltr\">Simple HTML body</div>\n"),
|
||||
}
|
||||
a, err := ex.Attach(bytes.NewReader([]byte("Let's just pretend this is raw JPEG data.")), "cat.jpeg", "image/jpeg")
|
||||
if err != nil {
|
||||
t.Fatalf("Error attaching image %s", err.Error())
|
||||
}
|
||||
b, err := ex.Attach(bytes.NewReader([]byte("Let's just pretend this is raw JPEG data.")), "cat-inline.jpeg", "image/jpeg")
|
||||
if err != nil {
|
||||
t.Fatalf("Error attaching inline image %s", err.Error())
|
||||
}
|
||||
raw := []byte(`
|
||||
From: Jordan Wright <jmwright798@gmail.com>
|
||||
Date: Thu, 17 Oct 2019 08:55:37 +0100
|
||||
Mime-Version: 1.0
|
||||
Content-Type: multipart/mixed;
|
||||
boundary=35d10c2224bd787fe700c2c6f4769ddc936eb8a0b58e9c8717e406c5abb7
|
||||
To: Jordan Wright <jmwright798@gmail.com>
|
||||
Subject: Test Subject
|
||||
|
||||
--35d10c2224bd787fe700c2c6f4769ddc936eb8a0b58e9c8717e406c5abb7
|
||||
Content-Type: multipart/alternative;
|
||||
boundary=b10ca5b1072908cceb667e8968d3af04503b7ab07d61c9f579c15b416d7c
|
||||
|
||||
--b10ca5b1072908cceb667e8968d3af04503b7ab07d61c9f579c15b416d7c
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
|
||||
Simple text body
|
||||
--b10ca5b1072908cceb667e8968d3af04503b7ab07d61c9f579c15b416d7c
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
Content-Type: text/html; charset=UTF-8
|
||||
|
||||
<div dir=3D"ltr">Simple HTML body</div>
|
||||
|
||||
--b10ca5b1072908cceb667e8968d3af04503b7ab07d61c9f579c15b416d7c--
|
||||
|
||||
--35d10c2224bd787fe700c2c6f4769ddc936eb8a0b58e9c8717e406c5abb7
|
||||
Content-Disposition: attachment;
|
||||
filename="cat.jpeg"
|
||||
Content-Id: <cat.jpeg>
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Type: image/jpeg
|
||||
|
||||
TGV0J3MganVzdCBwcmV0ZW5kIHRoaXMgaXMgcmF3IEpQRUcgZGF0YS4=
|
||||
|
||||
--35d10c2224bd787fe700c2c6f4769ddc936eb8a0b58e9c8717e406c5abb7
|
||||
Content-Disposition: inline;
|
||||
filename="cat-inline.jpeg"
|
||||
Content-Id: <cat-inline.jpeg>
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Type: image/jpeg
|
||||
|
||||
TGV0J3MganVzdCBwcmV0ZW5kIHRoaXMgaXMgcmF3IEpQRUcgZGF0YS4=
|
||||
|
||||
--35d10c2224bd787fe700c2c6f4769ddc936eb8a0b58e9c8717e406c5abb7--`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating email %s", err.Error())
|
||||
}
|
||||
if e.Subject != ex.Subject {
|
||||
t.Fatalf("Incorrect subject. %#q != %#q", e.Subject, ex.Subject)
|
||||
}
|
||||
if !bytes.Equal(e.Text, ex.Text) {
|
||||
t.Fatalf("Incorrect text: %#q != %#q", e.Text, ex.Text)
|
||||
}
|
||||
if !bytes.Equal(e.HTML, ex.HTML) {
|
||||
t.Fatalf("Incorrect HTML: %#q != %#q", e.HTML, ex.HTML)
|
||||
}
|
||||
if e.From != ex.From {
|
||||
t.Fatalf("Incorrect \"From\": %#q != %#q", e.From, ex.From)
|
||||
}
|
||||
if len(e.Attachments) != 2 {
|
||||
t.Fatalf("Incorrect number of attachments %d != %d", len(e.Attachments), 1)
|
||||
}
|
||||
if e.Attachments[0].Filename != a.Filename {
|
||||
t.Fatalf("Incorrect attachment filename %s != %s", e.Attachments[0].Filename, a.Filename)
|
||||
}
|
||||
if !bytes.Equal(e.Attachments[0].Content, a.Content) {
|
||||
t.Fatalf("Incorrect attachment content %#q != %#q", e.Attachments[0].Content, a.Content)
|
||||
}
|
||||
if e.Attachments[1].Filename != b.Filename {
|
||||
t.Fatalf("Incorrect attachment filename %s != %s", e.Attachments[1].Filename, b.Filename)
|
||||
}
|
||||
if !bytes.Equal(e.Attachments[1].Content, b.Content) {
|
||||
t.Fatalf("Incorrect attachment content %#q != %#q", e.Attachments[1].Content, b.Content)
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleGmail() {
|
||||
e := NewEmail()
|
||||
e.From = "Jordan Wright <test@gmail.com>"
|
||||
e.To = []string{"test@example.com"}
|
||||
e.Bcc = []string{"test_bcc@example.com"}
|
||||
e.Cc = []string{"test_cc@example.com"}
|
||||
e.Subject = "Awesome Subject"
|
||||
e.Text = []byte("Text Body is, of course, supported!\n")
|
||||
e.HTML = []byte("<h1>Fancy Html is supported, too!</h1>\n")
|
||||
e.Send("smtp.gmail.com:587", smtp.PlainAuth("", e.From, "password123", "smtp.gmail.com"))
|
||||
}
|
||||
|
||||
func ExampleAttach() {
|
||||
e := NewEmail()
|
||||
e.AttachFile("test.txt")
|
||||
}
|
||||
|
||||
func Test_base64Wrap(t *testing.T) {
|
||||
file := "I'm a file long enough to force the function to wrap a\n" +
|
||||
"couple of lines, but I stop short of the end of one line and\n" +
|
||||
"have some padding dangling at the end."
|
||||
encoded := "SSdtIGEgZmlsZSBsb25nIGVub3VnaCB0byBmb3JjZSB0aGUgZnVuY3Rpb24gdG8gd3JhcCBhCmNv\r\n" +
|
||||
"dXBsZSBvZiBsaW5lcywgYnV0IEkgc3RvcCBzaG9ydCBvZiB0aGUgZW5kIG9mIG9uZSBsaW5lIGFu\r\n" +
|
||||
"ZApoYXZlIHNvbWUgcGFkZGluZyBkYW5nbGluZyBhdCB0aGUgZW5kLg==\r\n"
|
||||
|
||||
var buf bytes.Buffer
|
||||
base64Wrap(&buf, []byte(file))
|
||||
if !bytes.Equal(buf.Bytes(), []byte(encoded)) {
|
||||
t.Fatalf("Encoded file does not match expected: %#q != %#q", string(buf.Bytes()), encoded)
|
||||
}
|
||||
}
|
||||
|
||||
// *Since the mime library in use by ```email``` is now in the stdlib, this test is deprecated
|
||||
func Test_quotedPrintEncode(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
text := []byte("Dear reader!\n\n" +
|
||||
"This is a test email to try and capture some of the corner cases that exist within\n" +
|
||||
"the quoted-printable encoding.\n" +
|
||||
"There are some wacky parts like =, and this input assumes UNIX line breaks so\r\n" +
|
||||
"it can come out a little weird. Also, we need to support unicode so here's a fish: 🐟\n")
|
||||
expected := []byte("Dear reader!\r\n\r\n" +
|
||||
"This is a test email to try and capture some of the corner cases that exist=\r\n" +
|
||||
" within\r\n" +
|
||||
"the quoted-printable encoding.\r\n" +
|
||||
"There are some wacky parts like =3D, and this input assumes UNIX line break=\r\n" +
|
||||
"s so\r\n" +
|
||||
"it can come out a little weird. Also, we need to support unicode so here's=\r\n" +
|
||||
" a fish: =F0=9F=90=9F\r\n")
|
||||
qp := quotedprintable.NewWriter(&buf)
|
||||
if _, err := qp.Write(text); err != nil {
|
||||
t.Fatal("quotePrintEncode: ", err)
|
||||
}
|
||||
if err := qp.Close(); err != nil {
|
||||
t.Fatal("Error closing writer", err)
|
||||
}
|
||||
if b := buf.Bytes(); !bytes.Equal(b, expected) {
|
||||
t.Errorf("quotedPrintEncode generated incorrect results: %#q != %#q", b, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMultipartNoContentType(t *testing.T) {
|
||||
raw := []byte(`From: Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||
To: notmuch@notmuchmail.org
|
||||
References: <20091117190054.GU3165@dottiness.seas.harvard.edu>
|
||||
Date: Wed, 18 Nov 2009 01:02:38 +0600
|
||||
Message-ID: <87iqd9rn3l.fsf@vertex.dottedmag>
|
||||
MIME-Version: 1.0
|
||||
Subject: Re: [notmuch] Working with Maildir storage?
|
||||
Content-Type: multipart/mixed; boundary="===============1958295626=="
|
||||
|
||||
--===============1958295626==
|
||||
Content-Type: multipart/signed; boundary="=-=-=";
|
||||
micalg=pgp-sha1; protocol="application/pgp-signature"
|
||||
|
||||
--=-=-=
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did g=
|
||||
yre and gimble:
|
||||
|
||||
--=-=-=
|
||||
Content-Type: application/pgp-signature
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.9 (GNU/Linux)
|
||||
|
||||
iQIcBAEBAgAGBQJLAvNOAAoJEJ0g9lA+M4iIjLYQAKp0PXEgl3JMOEBisH52AsIK
|
||||
=/ksP
|
||||
-----END PGP SIGNATURE-----
|
||||
--=-=-=--
|
||||
|
||||
--===============1958295626==
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Content-Disposition: inline
|
||||
|
||||
Testing!
|
||||
--===============1958295626==--
|
||||
`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error when parsing email %s", err.Error())
|
||||
}
|
||||
if !bytes.Equal(e.Text, []byte("Testing!")) {
|
||||
t.Fatalf("Error incorrect text: %#q != %#q\n", e.Text, "Testing!")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoMultipartHTMLContentTypeBase64Encoding(t *testing.T) {
|
||||
raw := []byte(`MIME-Version: 1.0
|
||||
From: no-reply@example.com
|
||||
To: tester@example.org
|
||||
Date: 7 Jan 2021 03:07:44 -0800
|
||||
Subject: Hello
|
||||
Content-Type: text/html; charset=utf-8
|
||||
Content-Transfer-Encoding: base64
|
||||
Message-Id: <20210107110744.547DD70532@example.com>
|
||||
|
||||
PGh0bWw+PGhlYWQ+PHRpdGxlPnRlc3Q8L3RpdGxlPjwvaGVhZD48Ym9keT5IZWxsbyB3
|
||||
b3JsZCE8L2JvZHk+PC9odG1sPg==
|
||||
`)
|
||||
e, err := NewEmailFromReader(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
t.Fatalf("Error when parsing email %s", err.Error())
|
||||
}
|
||||
if !bytes.Equal(e.HTML, []byte("<html><head><title>test</title></head><body>Hello world!</body></html>")) {
|
||||
t.Fatalf("Error incorrect text: %#q != %#q\n", e.Text, "<html>...</html>")
|
||||
}
|
||||
}
|
||||
|
||||
// *Since the mime library in use by ```email``` is now in the stdlib, this test is deprecated
|
||||
func Test_quotedPrintDecode(t *testing.T) {
|
||||
text := []byte("Dear reader!\r\n\r\n" +
|
||||
"This is a test email to try and capture some of the corner cases that exist=\r\n" +
|
||||
" within\r\n" +
|
||||
"the quoted-printable encoding.\r\n" +
|
||||
"There are some wacky parts like =3D, and this input assumes UNIX line break=\r\n" +
|
||||
"s so\r\n" +
|
||||
"it can come out a little weird. Also, we need to support unicode so here's=\r\n" +
|
||||
" a fish: =F0=9F=90=9F\r\n")
|
||||
expected := []byte("Dear reader!\r\n\r\n" +
|
||||
"This is a test email to try and capture some of the corner cases that exist within\r\n" +
|
||||
"the quoted-printable encoding.\r\n" +
|
||||
"There are some wacky parts like =, and this input assumes UNIX line breaks so\r\n" +
|
||||
"it can come out a little weird. Also, we need to support unicode so here's a fish: 🐟\r\n")
|
||||
qp := quotedprintable.NewReader(bytes.NewReader(text))
|
||||
got, err := ioutil.ReadAll(qp)
|
||||
if err != nil {
|
||||
t.Fatal("quotePrintDecode: ", err)
|
||||
}
|
||||
|
||||
if !bytes.Equal(got, expected) {
|
||||
t.Errorf("quotedPrintDecode generated incorrect results: %#q != %#q", got, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func Benchmark_base64Wrap(b *testing.B) {
|
||||
// Reasonable base case; 128K random bytes
|
||||
file := make([]byte, 128*1024)
|
||||
if _, err := rand.Read(file); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for i := 0; i <= b.N; i++ {
|
||||
base64Wrap(ioutil.Discard, file)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseSender(t *testing.T) {
|
||||
var cases = []struct {
|
||||
e Email
|
||||
want string
|
||||
haserr bool
|
||||
}{
|
||||
{
|
||||
Email{From: "from@test.com"},
|
||||
"from@test.com",
|
||||
false,
|
||||
},
|
||||
{
|
||||
Email{Sender: "sender@test.com", From: "from@test.com"},
|
||||
"sender@test.com",
|
||||
false,
|
||||
},
|
||||
{
|
||||
Email{Sender: "bad_address_sender"},
|
||||
"",
|
||||
true,
|
||||
},
|
||||
{
|
||||
Email{Sender: "good@sender.com", From: "bad_address_from"},
|
||||
"good@sender.com",
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for i, testcase := range cases {
|
||||
got, err := testcase.e.parseSender()
|
||||
if got != testcase.want || (err != nil) != testcase.haserr {
|
||||
t.Errorf(`%d: got %s != want %s or error "%t" != "%t"`, i+1, got, testcase.want, err != nil, testcase.haserr)
|
||||
}
|
||||
}
|
||||
}
|
||||
367
common/utils/email/pool.go
Normal file
367
common/utils/email/pool.go
Normal file
@@ -0,0 +1,367 @@
|
||||
package email
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/smtp"
|
||||
"net/textproto"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Pool struct {
|
||||
addr string
|
||||
auth smtp.Auth
|
||||
max int
|
||||
created int
|
||||
clients chan *client
|
||||
rebuild chan struct{}
|
||||
mut *sync.Mutex
|
||||
lastBuildErr *timestampedErr
|
||||
closing chan struct{}
|
||||
tlsConfig *tls.Config
|
||||
helloHostname string
|
||||
}
|
||||
|
||||
type client struct {
|
||||
*smtp.Client
|
||||
failCount int
|
||||
}
|
||||
|
||||
type timestampedErr struct {
|
||||
err error
|
||||
ts time.Time
|
||||
}
|
||||
|
||||
const maxFails = 4
|
||||
|
||||
var (
|
||||
ErrClosed = errors.New("pool closed")
|
||||
ErrTimeout = errors.New("timed out")
|
||||
)
|
||||
|
||||
func NewPool(address string, count int, auth smtp.Auth, opt_tlsConfig ...*tls.Config) (pool *Pool, err error) {
|
||||
pool = &Pool{
|
||||
addr: address,
|
||||
auth: auth,
|
||||
max: count,
|
||||
clients: make(chan *client, count),
|
||||
rebuild: make(chan struct{}),
|
||||
closing: make(chan struct{}),
|
||||
mut: &sync.Mutex{},
|
||||
}
|
||||
if len(opt_tlsConfig) == 1 {
|
||||
pool.tlsConfig = opt_tlsConfig[0]
|
||||
} else if host, _, e := net.SplitHostPort(address); e != nil {
|
||||
return nil, e
|
||||
} else {
|
||||
pool.tlsConfig = &tls.Config{ServerName: host}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// go1.1 didn't have this method
|
||||
func (c *client) Close() error {
|
||||
return c.Text.Close()
|
||||
}
|
||||
|
||||
// SetHelloHostname optionally sets the hostname that the Go smtp.Client will
|
||||
// use when doing a HELLO with the upstream SMTP server. By default, Go uses
|
||||
// "localhost" which may not be accepted by certain SMTP servers that demand
|
||||
// an FQDN.
|
||||
func (p *Pool) SetHelloHostname(h string) {
|
||||
p.helloHostname = h
|
||||
}
|
||||
|
||||
func (p *Pool) get(timeout time.Duration) *client {
|
||||
select {
|
||||
case c := <-p.clients:
|
||||
return c
|
||||
default:
|
||||
}
|
||||
|
||||
if p.created < p.max {
|
||||
p.makeOne()
|
||||
}
|
||||
|
||||
var deadline <-chan time.Time
|
||||
if timeout >= 0 {
|
||||
deadline = time.After(timeout)
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case c := <-p.clients:
|
||||
return c
|
||||
case <-p.rebuild:
|
||||
p.makeOne()
|
||||
case <-deadline:
|
||||
return nil
|
||||
case <-p.closing:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func shouldReuse(err error) bool {
|
||||
// certainly not perfect, but might be close:
|
||||
// - EOF: clearly, the connection went down
|
||||
// - textproto.Errors were valid SMTP over a valid connection,
|
||||
// but resulted from an SMTP error response
|
||||
// - textproto.ProtocolErrors result from connections going down,
|
||||
// invalid SMTP, that sort of thing
|
||||
// - syscall.Errno is probably down connection/bad pipe, but
|
||||
// passed straight through by textproto instead of becoming a
|
||||
// ProtocolError
|
||||
// - if we don't recognize the error, don't reuse the connection
|
||||
// A false positive will probably fail on the Reset(), and even if
|
||||
// not will eventually hit maxFails.
|
||||
// A false negative will knock over (and trigger replacement of) a
|
||||
// conn that might have still worked.
|
||||
if err == io.EOF {
|
||||
return false
|
||||
}
|
||||
switch err.(type) {
|
||||
case *textproto.Error:
|
||||
return true
|
||||
case *textproto.ProtocolError, textproto.ProtocolError:
|
||||
return false
|
||||
case syscall.Errno:
|
||||
return false
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Pool) replace(c *client) {
|
||||
p.clients <- c
|
||||
}
|
||||
|
||||
func (p *Pool) inc() bool {
|
||||
if p.created >= p.max {
|
||||
return false
|
||||
}
|
||||
|
||||
p.mut.Lock()
|
||||
defer p.mut.Unlock()
|
||||
|
||||
if p.created >= p.max {
|
||||
return false
|
||||
}
|
||||
p.created++
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *Pool) dec() {
|
||||
p.mut.Lock()
|
||||
p.created--
|
||||
p.mut.Unlock()
|
||||
|
||||
select {
|
||||
case p.rebuild <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Pool) makeOne() {
|
||||
go func() {
|
||||
if p.inc() {
|
||||
if c, err := p.build(); err == nil {
|
||||
p.clients <- c
|
||||
} else {
|
||||
p.lastBuildErr = ×tampedErr{err, time.Now()}
|
||||
p.dec()
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func startTLS(c *client, t *tls.Config) (bool, error) {
|
||||
if ok, _ := c.Extension("STARTTLS"); !ok {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if err := c.StartTLS(t); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func addAuth(c *client, auth smtp.Auth) (bool, error) {
|
||||
if ok, _ := c.Extension("AUTH"); !ok {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if err := c.Auth(auth); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (p *Pool) build() (*client, error) {
|
||||
cl, err := smtp.Dial(p.addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Is there a custom hostname for doing a HELLO with the SMTP server?
|
||||
if p.helloHostname != "" {
|
||||
cl.Hello(p.helloHostname)
|
||||
}
|
||||
|
||||
c := &client{cl, 0}
|
||||
|
||||
if _, err := startTLS(c, p.tlsConfig); err != nil {
|
||||
c.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if p.auth != nil {
|
||||
if _, err := addAuth(c, p.auth); err != nil {
|
||||
c.Close()
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (p *Pool) maybeReplace(err error, c *client) {
|
||||
if err == nil {
|
||||
c.failCount = 0
|
||||
p.replace(c)
|
||||
return
|
||||
}
|
||||
|
||||
c.failCount++
|
||||
if c.failCount >= maxFails {
|
||||
goto shutdown
|
||||
}
|
||||
|
||||
if !shouldReuse(err) {
|
||||
goto shutdown
|
||||
}
|
||||
|
||||
if err := c.Reset(); err != nil {
|
||||
goto shutdown
|
||||
}
|
||||
|
||||
p.replace(c)
|
||||
return
|
||||
|
||||
shutdown:
|
||||
p.dec()
|
||||
c.Close()
|
||||
}
|
||||
|
||||
func (p *Pool) failedToGet(startTime time.Time) error {
|
||||
select {
|
||||
case <-p.closing:
|
||||
return ErrClosed
|
||||
default:
|
||||
}
|
||||
|
||||
if p.lastBuildErr != nil && startTime.Before(p.lastBuildErr.ts) {
|
||||
return p.lastBuildErr.err
|
||||
}
|
||||
|
||||
return ErrTimeout
|
||||
}
|
||||
|
||||
// Send sends an email via a connection pulled from the Pool. The timeout may
|
||||
// be <0 to indicate no timeout. Otherwise reaching the timeout will produce
|
||||
// and error building a connection that occurred while we were waiting, or
|
||||
// otherwise ErrTimeout.
|
||||
func (p *Pool) Send(e *Email, timeout time.Duration) (err error) {
|
||||
start := time.Now()
|
||||
c := p.get(timeout)
|
||||
if c == nil {
|
||||
return p.failedToGet(start)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
p.maybeReplace(err, c)
|
||||
}()
|
||||
|
||||
recipients, err := addressLists(e.To, e.Cc, e.Bcc)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
msg, err := e.Bytes()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
from, err := emailOnly(e.From)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if err = c.Mail(from); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, recip := range recipients {
|
||||
if err = c.Rcpt(recip); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
w, err := c.Data()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if _, err = w.Write(msg); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = w.Close()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func emailOnly(full string) (string, error) {
|
||||
addr, err := mail.ParseAddress(full)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return addr.Address, nil
|
||||
}
|
||||
|
||||
func addressLists(lists ...[]string) ([]string, error) {
|
||||
length := 0
|
||||
for _, lst := range lists {
|
||||
length += len(lst)
|
||||
}
|
||||
combined := make([]string, 0, length)
|
||||
|
||||
for _, lst := range lists {
|
||||
for _, full := range lst {
|
||||
addr, err := emailOnly(full)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
combined = append(combined, addr)
|
||||
}
|
||||
}
|
||||
|
||||
return combined, nil
|
||||
}
|
||||
|
||||
// Close immediately changes the pool's state so no new connections will be
|
||||
// created, then gets and closes the existing ones as they become available.
|
||||
func (p *Pool) Close() {
|
||||
close(p.closing)
|
||||
|
||||
for p.created > 0 {
|
||||
c := <-p.clients
|
||||
c.Quit()
|
||||
p.dec()
|
||||
}
|
||||
}
|
||||
186
common/utils/endec/endec.go
Normal file
186
common/utils/endec/endec.go
Normal file
@@ -0,0 +1,186 @@
|
||||
package endec
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/md5"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"crypto/x509"
|
||||
"encoding/hex"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"hash"
|
||||
)
|
||||
|
||||
func RsaParsePubKey(pubKeyPem []byte) (*rsa.PublicKey, error) {
|
||||
block, _ := pem.Decode(pubKeyPem)
|
||||
if block == nil {
|
||||
return nil, errors.New("invalid rsa public key")
|
||||
}
|
||||
pubInfo, err := x509.ParsePKIXPublicKey(block.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pubKey := pubInfo.(*rsa.PublicKey)
|
||||
return pubKey, nil
|
||||
}
|
||||
|
||||
func RsaParsePubKeyByPrivKey(privKeyPem []byte) (*rsa.PublicKey, error) {
|
||||
block, _ := pem.Decode(privKeyPem)
|
||||
if block == nil {
|
||||
return nil, errors.New("invalid rsa private key")
|
||||
}
|
||||
privKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &privKey.PublicKey, nil
|
||||
}
|
||||
|
||||
func RsaParsePrivKey(privKeyPem []byte) (*rsa.PrivateKey, error) {
|
||||
block, _ := pem.Decode(privKeyPem)
|
||||
if block == nil {
|
||||
return nil, errors.New("invalid rsa private key")
|
||||
}
|
||||
privKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return privKey, nil
|
||||
}
|
||||
|
||||
func RsaEncrypt(rawData []byte, pubKey *rsa.PublicKey) (encData []byte, err error) {
|
||||
return rsa.EncryptPKCS1v15(rand.Reader, pubKey, rawData)
|
||||
}
|
||||
|
||||
func RsaDecrypt(encData []byte, privKey *rsa.PrivateKey) (decData []byte, err error) {
|
||||
return rsa.DecryptPKCS1v15(rand.Reader, privKey, encData)
|
||||
}
|
||||
|
||||
func RsaSign(rawData []byte, privKey *rsa.PrivateKey) (signData []byte, err error) {
|
||||
msgHash := sha256.New()
|
||||
_, err = msgHash.Write(rawData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
msgHashSum := msgHash.Sum(nil)
|
||||
signData, err = rsa.SignPKCS1v15(rand.Reader, privKey, crypto.SHA256, msgHashSum)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return signData, nil
|
||||
}
|
||||
|
||||
func RsaVerify(rawData []byte, signData []byte, pubKey *rsa.PublicKey) (ok bool, err error) {
|
||||
msgHash := sha256.New()
|
||||
_, err = msgHash.Write(rawData)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
msgHashSum := msgHash.Sum(nil)
|
||||
err = rsa.VerifyPKCS1v15(pubKey, crypto.SHA256, msgHashSum, signData)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func AesCFBEncrypt(rawData []byte, key []byte, iv []byte) (encData []byte, err error) {
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
encData = make([]byte, len(rawData))
|
||||
if iv == nil {
|
||||
iv = make([]byte, aes.BlockSize)
|
||||
}
|
||||
stream := cipher.NewCFBEncrypter(block, iv)
|
||||
stream.XORKeyStream(encData, rawData)
|
||||
return encData, nil
|
||||
}
|
||||
|
||||
func AesCFBDecrypt(encData []byte, key []byte, iv []byte) (decData []byte, err error) {
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if iv == nil {
|
||||
iv = make([]byte, aes.BlockSize)
|
||||
}
|
||||
stream := cipher.NewCFBDecrypter(block, iv)
|
||||
decData = make([]byte, len(encData))
|
||||
stream.XORKeyStream(decData, encData)
|
||||
return decData, nil
|
||||
}
|
||||
|
||||
func AesCBCEncrypt(rawData []byte, key []byte, iv []byte) (encData []byte, err error) {
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
paddingChar := block.BlockSize() - len(rawData)%block.BlockSize()
|
||||
paddingData := bytes.Repeat([]byte{byte(paddingChar)}, paddingChar)
|
||||
rawData = append(rawData, paddingData...)
|
||||
encData = make([]byte, len(rawData))
|
||||
if iv == nil {
|
||||
iv = make([]byte, aes.BlockSize)
|
||||
}
|
||||
blockMode := cipher.NewCBCEncrypter(block, iv)
|
||||
blockMode.CryptBlocks(encData, rawData)
|
||||
return encData, nil
|
||||
}
|
||||
|
||||
func AesCBCDecrypt(encData []byte, key []byte, iv []byte) (decData []byte, err error) {
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if iv == nil {
|
||||
iv = make([]byte, aes.BlockSize)
|
||||
}
|
||||
blockMode := cipher.NewCBCDecrypter(block, iv)
|
||||
decData = make([]byte, len(encData))
|
||||
blockMode.CryptBlocks(decData, encData)
|
||||
paddingChar := int(decData[len(decData)-1])
|
||||
decData = decData[:len(decData)-paddingChar]
|
||||
return decData, nil
|
||||
}
|
||||
|
||||
func Sha1Str(inputStr string) string {
|
||||
h := sha1.New()
|
||||
return hashStr(h, inputStr)
|
||||
}
|
||||
|
||||
func Sha256Str(inputStr string) string {
|
||||
h := sha256.New()
|
||||
return hashStr(h, inputStr)
|
||||
}
|
||||
|
||||
func Md5Str(inputStr string) string {
|
||||
h := md5.New()
|
||||
return hashStr(h, inputStr)
|
||||
}
|
||||
|
||||
func hashStr(h hash.Hash, inputStr string) string {
|
||||
h.Write([]byte(inputStr))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
func Xor(data []byte, key []byte) {
|
||||
for i := 0; i < len(data); i++ {
|
||||
data[i] ^= key[i%len(key)]
|
||||
}
|
||||
}
|
||||
|
||||
func Hk4eAbilityHashCode(ability string) int32 {
|
||||
hashCode := int32(0)
|
||||
for i := 0; i < len(ability); i++ {
|
||||
hashCode = int32(ability[i]) + 131*hashCode
|
||||
}
|
||||
return hashCode
|
||||
}
|
||||
29
common/utils/endec/endec_test.go
Normal file
29
common/utils/endec/endec_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package endec
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var key []byte
|
||||
|
||||
func init() {
|
||||
key, _ = base64.StdEncoding.DecodeString("NK6Ucg8hCXN9oPZFojqcAqYEY2DETZzt6oKrGmZwdOU=")
|
||||
}
|
||||
|
||||
func TestAesCBC(t *testing.T) {
|
||||
raw := []byte("fuck")
|
||||
enc, _ := AesCBCEncrypt(raw, key, key[0:16])
|
||||
fmt.Printf("enc: %v\n", enc)
|
||||
dec, _ := AesCBCDecrypt(enc, key, key[0:16])
|
||||
fmt.Printf("dec: %v\n", dec)
|
||||
}
|
||||
|
||||
func TestAesCFB(t *testing.T) {
|
||||
raw := []byte("fuck")
|
||||
enc, _ := AesCFBEncrypt(raw, key, key[0:16])
|
||||
fmt.Printf("enc: %v\n", enc)
|
||||
dec, _ := AesCFBDecrypt(enc, key, key[0:16])
|
||||
fmt.Printf("dec: %v\n", dec)
|
||||
}
|
||||
76
common/utils/object/object.go
Normal file
76
common/utils/object/object.go
Normal file
@@ -0,0 +1,76 @@
|
||||
package object
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func ObjectDeepCopy(src, dest any) error {
|
||||
var buf bytes.Buffer
|
||||
if err := gob.NewEncoder(&buf).Encode(src); err != nil {
|
||||
return err
|
||||
}
|
||||
return gob.NewDecoder(bytes.NewBuffer(buf.Bytes())).Decode(dest)
|
||||
}
|
||||
|
||||
func ConvBoolToInt64(v bool) int64 {
|
||||
if v {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func ConvInt64ToBool(v int64) bool {
|
||||
if v != 0 {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func ConvListToMap[T any](l []T) map[uint64]T {
|
||||
ret := make(map[uint64]T)
|
||||
for index, value := range l {
|
||||
ret[uint64(index)] = value
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func ConvMapToList[T any](m map[uint64]T) []T {
|
||||
ret := make([]T, 0)
|
||||
for _, value := range m {
|
||||
ret = append(ret, value)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func IsUtf8String(value string) bool {
|
||||
data := []byte(value)
|
||||
for i := 0; i < len(data); {
|
||||
str := fmt.Sprintf("%b", data[i])
|
||||
num := 0
|
||||
for num < len(str) {
|
||||
if str[num] != '1' {
|
||||
break
|
||||
}
|
||||
num++
|
||||
}
|
||||
if data[i]&0x80 == 0x00 {
|
||||
i++
|
||||
continue
|
||||
} else if num > 2 {
|
||||
i++
|
||||
for j := 0; j < num-1; j++ {
|
||||
if data[i]&0xc0 != 0x80 {
|
||||
return false
|
||||
}
|
||||
i++
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
57
common/utils/random/random.go
Normal file
57
common/utils/random/random.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package random
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func GetRandomStr(strLen int) (str string) {
|
||||
baseStr := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||
for i := 0; i < strLen; i++ {
|
||||
index := rand.Intn(len(baseStr))
|
||||
str += string(baseStr[index])
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
func GetRandomByte(len int) []byte {
|
||||
ret := make([]byte, 0)
|
||||
for i := 0; i < len; i++ {
|
||||
r := uint8(rand.Intn(256))
|
||||
ret = append(ret, r)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func GetRandomByteHexStr(len int) string {
|
||||
return hex.EncodeToString(GetRandomByte(len))
|
||||
}
|
||||
|
||||
func GetRandomInt32(min int32, max int32) int32 {
|
||||
if max <= min {
|
||||
return 0
|
||||
}
|
||||
r := rand.Int31n(max-min+1) + min
|
||||
return r
|
||||
}
|
||||
|
||||
func GetRandomFloat32(min float32, max float32) float32 {
|
||||
if max <= min {
|
||||
return 0.0
|
||||
}
|
||||
r := rand.Float32()*(max-min) + min
|
||||
return r
|
||||
}
|
||||
|
||||
func GetRandomFloat64(min float64, max float64) float64 {
|
||||
if max <= min {
|
||||
return 0.0
|
||||
}
|
||||
r := rand.Float64()*(max-min) + min
|
||||
return r
|
||||
}
|
||||
11
common/utils/random/random_test.go
Normal file
11
common/utils/random/random_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package random
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetRandomStr(t *testing.T) {
|
||||
str := GetRandomStr(16)
|
||||
fmt.Println(str)
|
||||
}
|
||||
27
common/utils/reflection/struct.go
Normal file
27
common/utils/reflection/struct.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package reflection
|
||||
|
||||
import "reflect"
|
||||
|
||||
func ConvStructToMap(value any) map[string]any {
|
||||
refType := reflect.TypeOf(value)
|
||||
if refType.Kind() == reflect.Ptr {
|
||||
refType = refType.Elem()
|
||||
}
|
||||
if refType.Kind() != reflect.Struct {
|
||||
return nil
|
||||
}
|
||||
fieldNum := refType.NumField()
|
||||
result := make(map[string]any)
|
||||
nameList := make([]string, 0)
|
||||
for i := 0; i < fieldNum; i++ {
|
||||
nameList = append(nameList, refType.Field(i).Name)
|
||||
}
|
||||
refValue := reflect.ValueOf(value)
|
||||
if refValue.Kind() == reflect.Ptr {
|
||||
refValue = refValue.Elem()
|
||||
}
|
||||
for i := 0; i < fieldNum; i++ {
|
||||
result[nameList[i]] = refValue.FieldByName(nameList[i]).Interface()
|
||||
}
|
||||
return result
|
||||
}
|
||||
6
gate-hk4e-api/gm/forbid_user_info.go
Normal file
6
gate-hk4e-api/gm/forbid_user_info.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package gm
|
||||
|
||||
type ForbidUserInfo struct {
|
||||
UserId uint32
|
||||
ForbidEndTime uint64
|
||||
}
|
||||
6
gate-hk4e-api/gm/kick_player_info.go
Normal file
6
gate-hk4e-api/gm/kick_player_info.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package gm
|
||||
|
||||
type KickPlayerInfo struct {
|
||||
UserId uint32
|
||||
Reason uint32
|
||||
}
|
||||
11
gate-hk4e-api/gm/online_user_info.go
Normal file
11
gate-hk4e-api/gm/online_user_info.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package gm
|
||||
|
||||
type OnlineUserList struct {
|
||||
UserList []*OnlineUserInfo `json:"userList"`
|
||||
}
|
||||
|
||||
type OnlineUserInfo struct {
|
||||
Uid uint32 `json:"uid"`
|
||||
ConvId uint64 `json:"convId"`
|
||||
Addr string `json:"addr"`
|
||||
}
|
||||
16
gate-hk4e-api/go.mod
Normal file
16
gate-hk4e-api/go.mod
Normal file
@@ -0,0 +1,16 @@
|
||||
module gate-hk4e-api
|
||||
|
||||
go 1.19
|
||||
|
||||
require flswld.com/common v0.0.0-incompatible // indirect
|
||||
|
||||
replace flswld.com/common => ../common
|
||||
|
||||
require flswld.com/logger v0.0.0-incompatible
|
||||
|
||||
replace flswld.com/logger => ../logger
|
||||
|
||||
require github.com/BurntSushi/toml v0.3.1 // indirect
|
||||
|
||||
// protobuf
|
||||
require google.golang.org/protobuf v1.28.0
|
||||
10
gate-hk4e-api/go.sum
Normal file
10
gate-hk4e-api/go.sum
Normal file
@@ -0,0 +1,10 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
289
gate-hk4e-api/proto/AISnapshotEntityData.pb.go
Normal file
289
gate-hk4e-api/proto/AISnapshotEntityData.pb.go
Normal file
@@ -0,0 +1,289 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AISnapshotEntityData.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AISnapshotEntityData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TickTime float32 `protobuf:"fixed32,5,opt,name=tick_time,json=tickTime,proto3" json:"tick_time,omitempty"`
|
||||
Tactic uint32 `protobuf:"varint,2,opt,name=tactic,proto3" json:"tactic,omitempty"`
|
||||
FinishedSkillCycles []*AISnapshotEntitySkillCycle `protobuf:"bytes,9,rep,name=finished_skill_cycles,json=finishedSkillCycles,proto3" json:"finished_skill_cycles,omitempty"`
|
||||
MovedDistance float32 `protobuf:"fixed32,4,opt,name=moved_distance,json=movedDistance,proto3" json:"moved_distance,omitempty"`
|
||||
AiTargetId uint32 `protobuf:"varint,13,opt,name=ai_target_id,json=aiTargetId,proto3" json:"ai_target_id,omitempty"`
|
||||
ThreatTargetId uint32 `protobuf:"varint,3,opt,name=threat_target_id,json=threatTargetId,proto3" json:"threat_target_id,omitempty"`
|
||||
ThreatListSize uint32 `protobuf:"varint,1,opt,name=threat_list_size,json=threatListSize,proto3" json:"threat_list_size,omitempty"`
|
||||
EntityId uint32 `protobuf:"varint,15,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
|
||||
HittingAvatars map[uint32]uint32 `protobuf:"bytes,7,rep,name=hitting_avatars,json=hittingAvatars,proto3" json:"hitting_avatars,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||
DistanceToPlayer float32 `protobuf:"fixed32,11,opt,name=distance_to_player,json=distanceToPlayer,proto3" json:"distance_to_player,omitempty"`
|
||||
AttackTargetId uint32 `protobuf:"varint,10,opt,name=attack_target_id,json=attackTargetId,proto3" json:"attack_target_id,omitempty"`
|
||||
RealTime float32 `protobuf:"fixed32,14,opt,name=real_time,json=realTime,proto3" json:"real_time,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) Reset() {
|
||||
*x = AISnapshotEntityData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AISnapshotEntityData_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AISnapshotEntityData) ProtoMessage() {}
|
||||
|
||||
func (x *AISnapshotEntityData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AISnapshotEntityData_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AISnapshotEntityData.ProtoReflect.Descriptor instead.
|
||||
func (*AISnapshotEntityData) Descriptor() ([]byte, []int) {
|
||||
return file_AISnapshotEntityData_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetTickTime() float32 {
|
||||
if x != nil {
|
||||
return x.TickTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetTactic() uint32 {
|
||||
if x != nil {
|
||||
return x.Tactic
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetFinishedSkillCycles() []*AISnapshotEntitySkillCycle {
|
||||
if x != nil {
|
||||
return x.FinishedSkillCycles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetMovedDistance() float32 {
|
||||
if x != nil {
|
||||
return x.MovedDistance
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetAiTargetId() uint32 {
|
||||
if x != nil {
|
||||
return x.AiTargetId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetThreatTargetId() uint32 {
|
||||
if x != nil {
|
||||
return x.ThreatTargetId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetThreatListSize() uint32 {
|
||||
if x != nil {
|
||||
return x.ThreatListSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.EntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetHittingAvatars() map[uint32]uint32 {
|
||||
if x != nil {
|
||||
return x.HittingAvatars
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetDistanceToPlayer() float32 {
|
||||
if x != nil {
|
||||
return x.DistanceToPlayer
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetAttackTargetId() uint32 {
|
||||
if x != nil {
|
||||
return x.AttackTargetId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntityData) GetRealTime() float32 {
|
||||
if x != nil {
|
||||
return x.RealTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AISnapshotEntityData_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AISnapshotEntityData_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69,
|
||||
0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x41, 0x49,
|
||||
0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2,
|
||||
0x04, 0x0a, 0x14, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x5f,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x74, 0x69, 0x63, 0x6b,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x63, 0x74, 0x69, 0x63, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x74, 0x61, 0x63, 0x74, 0x69, 0x63, 0x12, 0x4f, 0x0a, 0x15,
|
||||
0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x63,
|
||||
0x79, 0x63, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x41, 0x49,
|
||||
0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x13, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68,
|
||||
0x65, 0x64, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x73, 0x12, 0x25, 0x0a,
|
||||
0x0e, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x44, 0x69, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x61, 0x69, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65,
|
||||
0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x61, 0x69, 0x54, 0x61,
|
||||
0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x68, 0x72, 0x65, 0x61, 0x74,
|
||||
0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x0e, 0x74, 0x68, 0x72, 0x65, 0x61, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64,
|
||||
0x12, 0x28, 0x0a, 0x10, 0x74, 0x68, 0x72, 0x65, 0x61, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x68, 0x72, 0x65,
|
||||
0x61, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65,
|
||||
0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x0f, 0x68, 0x69, 0x74, 0x74, 0x69,
|
||||
0x6e, 0x67, 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x29, 0x2e, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x48, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x41,
|
||||
0x76, 0x61, 0x74, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x68, 0x69, 0x74,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x64,
|
||||
0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x65,
|
||||
0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x10, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x54, 0x6f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x61, 0x74, 0x74,
|
||||
0x61, 0x63, 0x6b, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x61, 0x72, 0x67, 0x65,
|
||||
0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x18, 0x0e, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x1a, 0x41, 0x0a, 0x13, 0x48, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x76, 0x61, 0x74, 0x61,
|
||||
0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AISnapshotEntityData_proto_rawDescOnce sync.Once
|
||||
file_AISnapshotEntityData_proto_rawDescData = file_AISnapshotEntityData_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AISnapshotEntityData_proto_rawDescGZIP() []byte {
|
||||
file_AISnapshotEntityData_proto_rawDescOnce.Do(func() {
|
||||
file_AISnapshotEntityData_proto_rawDescData = protoimpl.X.CompressGZIP(file_AISnapshotEntityData_proto_rawDescData)
|
||||
})
|
||||
return file_AISnapshotEntityData_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AISnapshotEntityData_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_AISnapshotEntityData_proto_goTypes = []interface{}{
|
||||
(*AISnapshotEntityData)(nil), // 0: AISnapshotEntityData
|
||||
nil, // 1: AISnapshotEntityData.HittingAvatarsEntry
|
||||
(*AISnapshotEntitySkillCycle)(nil), // 2: AISnapshotEntitySkillCycle
|
||||
}
|
||||
var file_AISnapshotEntityData_proto_depIdxs = []int32{
|
||||
2, // 0: AISnapshotEntityData.finished_skill_cycles:type_name -> AISnapshotEntitySkillCycle
|
||||
1, // 1: AISnapshotEntityData.hitting_avatars:type_name -> AISnapshotEntityData.HittingAvatarsEntry
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AISnapshotEntityData_proto_init() }
|
||||
func file_AISnapshotEntityData_proto_init() {
|
||||
if File_AISnapshotEntityData_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AISnapshotEntitySkillCycle_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AISnapshotEntityData_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AISnapshotEntityData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AISnapshotEntityData_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AISnapshotEntityData_proto_goTypes,
|
||||
DependencyIndexes: file_AISnapshotEntityData_proto_depIdxs,
|
||||
MessageInfos: file_AISnapshotEntityData_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AISnapshotEntityData_proto = out.File
|
||||
file_AISnapshotEntityData_proto_rawDesc = nil
|
||||
file_AISnapshotEntityData_proto_goTypes = nil
|
||||
file_AISnapshotEntityData_proto_depIdxs = nil
|
||||
}
|
||||
36
gate-hk4e-api/proto/AISnapshotEntityData.proto
Normal file
36
gate-hk4e-api/proto/AISnapshotEntityData.proto
Normal file
@@ -0,0 +1,36 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AISnapshotEntitySkillCycle.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AISnapshotEntityData {
|
||||
float tick_time = 5;
|
||||
uint32 tactic = 2;
|
||||
repeated AISnapshotEntitySkillCycle finished_skill_cycles = 9;
|
||||
float moved_distance = 4;
|
||||
uint32 ai_target_id = 13;
|
||||
uint32 threat_target_id = 3;
|
||||
uint32 threat_list_size = 1;
|
||||
uint32 entity_id = 15;
|
||||
map<uint32, uint32> hitting_avatars = 7;
|
||||
float distance_to_player = 11;
|
||||
uint32 attack_target_id = 10;
|
||||
float real_time = 14;
|
||||
}
|
||||
198
gate-hk4e-api/proto/AISnapshotEntitySkillCycle.pb.go
Normal file
198
gate-hk4e-api/proto/AISnapshotEntitySkillCycle.pb.go
Normal file
@@ -0,0 +1,198 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AISnapshotEntitySkillCycle.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AISnapshotEntitySkillCycle struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Failed bool `protobuf:"varint,12,opt,name=failed,proto3" json:"failed,omitempty"`
|
||||
Trydoskill bool `protobuf:"varint,8,opt,name=trydoskill,proto3" json:"trydoskill,omitempty"`
|
||||
Success bool `protobuf:"varint,9,opt,name=success,proto3" json:"success,omitempty"`
|
||||
Selected bool `protobuf:"varint,1,opt,name=selected,proto3" json:"selected,omitempty"`
|
||||
SkillId uint32 `protobuf:"varint,2,opt,name=skill_id,json=skillId,proto3" json:"skill_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) Reset() {
|
||||
*x = AISnapshotEntitySkillCycle{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AISnapshotEntitySkillCycle_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AISnapshotEntitySkillCycle) ProtoMessage() {}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AISnapshotEntitySkillCycle_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AISnapshotEntitySkillCycle.ProtoReflect.Descriptor instead.
|
||||
func (*AISnapshotEntitySkillCycle) Descriptor() ([]byte, []int) {
|
||||
return file_AISnapshotEntitySkillCycle_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) GetFailed() bool {
|
||||
if x != nil {
|
||||
return x.Failed
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) GetTrydoskill() bool {
|
||||
if x != nil {
|
||||
return x.Trydoskill
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) GetSelected() bool {
|
||||
if x != nil {
|
||||
return x.Selected
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AISnapshotEntitySkillCycle) GetSkillId() uint32 {
|
||||
if x != nil {
|
||||
return x.SkillId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AISnapshotEntitySkillCycle_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AISnapshotEntitySkillCycle_proto_rawDesc = []byte{
|
||||
0x0a, 0x20, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69,
|
||||
0x74, 0x79, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x1a, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f,
|
||||
0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x79, 0x63, 0x6c,
|
||||
0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x72, 0x79,
|
||||
0x64, 0x6f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74,
|
||||
0x72, 0x79, 0x64, 0x6f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63,
|
||||
0x63, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63,
|
||||
0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12,
|
||||
0x19, 0x0a, 0x08, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f,
|
||||
0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AISnapshotEntitySkillCycle_proto_rawDescOnce sync.Once
|
||||
file_AISnapshotEntitySkillCycle_proto_rawDescData = file_AISnapshotEntitySkillCycle_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AISnapshotEntitySkillCycle_proto_rawDescGZIP() []byte {
|
||||
file_AISnapshotEntitySkillCycle_proto_rawDescOnce.Do(func() {
|
||||
file_AISnapshotEntitySkillCycle_proto_rawDescData = protoimpl.X.CompressGZIP(file_AISnapshotEntitySkillCycle_proto_rawDescData)
|
||||
})
|
||||
return file_AISnapshotEntitySkillCycle_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AISnapshotEntitySkillCycle_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AISnapshotEntitySkillCycle_proto_goTypes = []interface{}{
|
||||
(*AISnapshotEntitySkillCycle)(nil), // 0: AISnapshotEntitySkillCycle
|
||||
}
|
||||
var file_AISnapshotEntitySkillCycle_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AISnapshotEntitySkillCycle_proto_init() }
|
||||
func file_AISnapshotEntitySkillCycle_proto_init() {
|
||||
if File_AISnapshotEntitySkillCycle_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AISnapshotEntitySkillCycle_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AISnapshotEntitySkillCycle); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AISnapshotEntitySkillCycle_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AISnapshotEntitySkillCycle_proto_goTypes,
|
||||
DependencyIndexes: file_AISnapshotEntitySkillCycle_proto_depIdxs,
|
||||
MessageInfos: file_AISnapshotEntitySkillCycle_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AISnapshotEntitySkillCycle_proto = out.File
|
||||
file_AISnapshotEntitySkillCycle_proto_rawDesc = nil
|
||||
file_AISnapshotEntitySkillCycle_proto_goTypes = nil
|
||||
file_AISnapshotEntitySkillCycle_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AISnapshotEntitySkillCycle.proto
Normal file
27
gate-hk4e-api/proto/AISnapshotEntitySkillCycle.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AISnapshotEntitySkillCycle {
|
||||
bool failed = 12;
|
||||
bool trydoskill = 8;
|
||||
bool success = 9;
|
||||
bool selected = 1;
|
||||
uint32 skill_id = 2;
|
||||
}
|
||||
165
gate-hk4e-api/proto/AISnapshotInfo.pb.go
Normal file
165
gate-hk4e-api/proto/AISnapshotInfo.pb.go
Normal file
@@ -0,0 +1,165 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AISnapshotInfo.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AISnapshotInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AiSnapshots []*AISnapshotEntityData `protobuf:"bytes,13,rep,name=ai_snapshots,json=aiSnapshots,proto3" json:"ai_snapshots,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AISnapshotInfo) Reset() {
|
||||
*x = AISnapshotInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AISnapshotInfo_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AISnapshotInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AISnapshotInfo) ProtoMessage() {}
|
||||
|
||||
func (x *AISnapshotInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AISnapshotInfo_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AISnapshotInfo.ProtoReflect.Descriptor instead.
|
||||
func (*AISnapshotInfo) Descriptor() ([]byte, []int) {
|
||||
return file_AISnapshotInfo_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AISnapshotInfo) GetAiSnapshots() []*AISnapshotEntityData {
|
||||
if x != nil {
|
||||
return x.AiSnapshots
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AISnapshotInfo_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AISnapshotInfo_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68,
|
||||
0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x0e, 0x41, 0x49, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74,
|
||||
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x0c, 0x61, 0x69, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73,
|
||||
0x68, 0x6f, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x41, 0x49, 0x53,
|
||||
0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74,
|
||||
0x61, 0x52, 0x0b, 0x61, 0x69, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x42, 0x0a,
|
||||
0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AISnapshotInfo_proto_rawDescOnce sync.Once
|
||||
file_AISnapshotInfo_proto_rawDescData = file_AISnapshotInfo_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AISnapshotInfo_proto_rawDescGZIP() []byte {
|
||||
file_AISnapshotInfo_proto_rawDescOnce.Do(func() {
|
||||
file_AISnapshotInfo_proto_rawDescData = protoimpl.X.CompressGZIP(file_AISnapshotInfo_proto_rawDescData)
|
||||
})
|
||||
return file_AISnapshotInfo_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AISnapshotInfo_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AISnapshotInfo_proto_goTypes = []interface{}{
|
||||
(*AISnapshotInfo)(nil), // 0: AISnapshotInfo
|
||||
(*AISnapshotEntityData)(nil), // 1: AISnapshotEntityData
|
||||
}
|
||||
var file_AISnapshotInfo_proto_depIdxs = []int32{
|
||||
1, // 0: AISnapshotInfo.ai_snapshots:type_name -> AISnapshotEntityData
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AISnapshotInfo_proto_init() }
|
||||
func file_AISnapshotInfo_proto_init() {
|
||||
if File_AISnapshotInfo_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AISnapshotEntityData_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AISnapshotInfo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AISnapshotInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AISnapshotInfo_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AISnapshotInfo_proto_goTypes,
|
||||
DependencyIndexes: file_AISnapshotInfo_proto_depIdxs,
|
||||
MessageInfos: file_AISnapshotInfo_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AISnapshotInfo_proto = out.File
|
||||
file_AISnapshotInfo_proto_rawDesc = nil
|
||||
file_AISnapshotInfo_proto_goTypes = nil
|
||||
file_AISnapshotInfo_proto_depIdxs = nil
|
||||
}
|
||||
25
gate-hk4e-api/proto/AISnapshotInfo.proto
Normal file
25
gate-hk4e-api/proto/AISnapshotInfo.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AISnapshotEntityData.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AISnapshotInfo {
|
||||
repeated AISnapshotEntityData ai_snapshots = 13;
|
||||
}
|
||||
173
gate-hk4e-api/proto/AbilityActionBlink.pb.go
Normal file
173
gate-hk4e-api/proto/AbilityActionBlink.pb.go
Normal file
@@ -0,0 +1,173 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionBlink.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionBlink struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rot *Vector `protobuf:"bytes,11,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,10,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionBlink) Reset() {
|
||||
*x = AbilityActionBlink{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionBlink_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionBlink) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionBlink) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionBlink) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionBlink_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionBlink.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionBlink) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionBlink_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionBlink) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionBlink) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionBlink_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionBlink_proto_rawDesc = []byte{
|
||||
0x0a, 0x18, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42,
|
||||
0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74,
|
||||
0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x12, 0x41, 0x62, 0x69, 0x6c,
|
||||
0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x19,
|
||||
0x0a, 0x03, 0x72, 0x6f, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65,
|
||||
0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x72, 0x6f, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73,
|
||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52,
|
||||
0x03, 0x70, 0x6f, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionBlink_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionBlink_proto_rawDescData = file_AbilityActionBlink_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionBlink_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionBlink_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionBlink_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionBlink_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionBlink_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionBlink_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionBlink_proto_goTypes = []interface{}{
|
||||
(*AbilityActionBlink)(nil), // 0: AbilityActionBlink
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionBlink_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionBlink.rot:type_name -> Vector
|
||||
1, // 1: AbilityActionBlink.pos:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionBlink_proto_init() }
|
||||
func file_AbilityActionBlink_proto_init() {
|
||||
if File_AbilityActionBlink_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionBlink_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionBlink); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionBlink_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionBlink_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionBlink_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionBlink_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionBlink_proto = out.File
|
||||
file_AbilityActionBlink_proto_rawDesc = nil
|
||||
file_AbilityActionBlink_proto_goTypes = nil
|
||||
file_AbilityActionBlink_proto_depIdxs = nil
|
||||
}
|
||||
26
gate-hk4e-api/proto/AbilityActionBlink.proto
Normal file
26
gate-hk4e-api/proto/AbilityActionBlink.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionBlink {
|
||||
Vector rot = 11;
|
||||
Vector pos = 10;
|
||||
}
|
||||
183
gate-hk4e-api/proto/AbilityActionCreateGadget.pb.go
Normal file
183
gate-hk4e-api/proto/AbilityActionCreateGadget.pb.go
Normal file
@@ -0,0 +1,183 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionCreateGadget.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionCreateGadget struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RoomId uint32 `protobuf:"varint,3,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
|
||||
Rot *Vector `protobuf:"bytes,8,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,11,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateGadget) Reset() {
|
||||
*x = AbilityActionCreateGadget{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionCreateGadget_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateGadget) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionCreateGadget) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionCreateGadget) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionCreateGadget_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionCreateGadget.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionCreateGadget) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionCreateGadget_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateGadget) GetRoomId() uint32 {
|
||||
if x != nil {
|
||||
return x.RoomId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateGadget) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateGadget) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionCreateGadget_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionCreateGadget_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
|
||||
0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x64, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0x6a, 0x0a, 0x19, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x64, 0x67, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07,
|
||||
0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72,
|
||||
0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x03, 0x72, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x72, 0x6f, 0x74,
|
||||
0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e,
|
||||
0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
|
||||
0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionCreateGadget_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionCreateGadget_proto_rawDescData = file_AbilityActionCreateGadget_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionCreateGadget_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionCreateGadget_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionCreateGadget_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionCreateGadget_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionCreateGadget_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionCreateGadget_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionCreateGadget_proto_goTypes = []interface{}{
|
||||
(*AbilityActionCreateGadget)(nil), // 0: AbilityActionCreateGadget
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionCreateGadget_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionCreateGadget.rot:type_name -> Vector
|
||||
1, // 1: AbilityActionCreateGadget.pos:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionCreateGadget_proto_init() }
|
||||
func file_AbilityActionCreateGadget_proto_init() {
|
||||
if File_AbilityActionCreateGadget_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionCreateGadget_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionCreateGadget); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionCreateGadget_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionCreateGadget_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionCreateGadget_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionCreateGadget_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionCreateGadget_proto = out.File
|
||||
file_AbilityActionCreateGadget_proto_rawDesc = nil
|
||||
file_AbilityActionCreateGadget_proto_goTypes = nil
|
||||
file_AbilityActionCreateGadget_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AbilityActionCreateGadget.proto
Normal file
27
gate-hk4e-api/proto/AbilityActionCreateGadget.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionCreateGadget {
|
||||
uint32 room_id = 3;
|
||||
Vector rot = 8;
|
||||
Vector pos = 11;
|
||||
}
|
||||
174
gate-hk4e-api/proto/AbilityActionCreateTile.pb.go
Normal file
174
gate-hk4e-api/proto/AbilityActionCreateTile.pb.go
Normal file
@@ -0,0 +1,174 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionCreateTile.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionCreateTile struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rot *Vector `protobuf:"bytes,3,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,8,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateTile) Reset() {
|
||||
*x = AbilityActionCreateTile{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionCreateTile_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateTile) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionCreateTile) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionCreateTile) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionCreateTile_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionCreateTile.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionCreateTile) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionCreateTile_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateTile) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionCreateTile) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionCreateTile_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionCreateTile_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
|
||||
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a,
|
||||
0x17, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72,
|
||||
0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x72, 0x6f, 0x74, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03,
|
||||
0x72, 0x6f, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x42, 0x0a,
|
||||
0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionCreateTile_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionCreateTile_proto_rawDescData = file_AbilityActionCreateTile_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionCreateTile_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionCreateTile_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionCreateTile_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionCreateTile_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionCreateTile_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionCreateTile_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionCreateTile_proto_goTypes = []interface{}{
|
||||
(*AbilityActionCreateTile)(nil), // 0: AbilityActionCreateTile
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionCreateTile_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionCreateTile.rot:type_name -> Vector
|
||||
1, // 1: AbilityActionCreateTile.pos:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionCreateTile_proto_init() }
|
||||
func file_AbilityActionCreateTile_proto_init() {
|
||||
if File_AbilityActionCreateTile_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionCreateTile_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionCreateTile); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionCreateTile_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionCreateTile_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionCreateTile_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionCreateTile_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionCreateTile_proto = out.File
|
||||
file_AbilityActionCreateTile_proto_rawDesc = nil
|
||||
file_AbilityActionCreateTile_proto_goTypes = nil
|
||||
file_AbilityActionCreateTile_proto_depIdxs = nil
|
||||
}
|
||||
26
gate-hk4e-api/proto/AbilityActionCreateTile.proto
Normal file
26
gate-hk4e-api/proto/AbilityActionCreateTile.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionCreateTile {
|
||||
Vector rot = 3;
|
||||
Vector pos = 8;
|
||||
}
|
||||
174
gate-hk4e-api/proto/AbilityActionDestroyTile.pb.go
Normal file
174
gate-hk4e-api/proto/AbilityActionDestroyTile.pb.go
Normal file
@@ -0,0 +1,174 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionDestroyTile.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionDestroyTile struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rot *Vector `protobuf:"bytes,3,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,1,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionDestroyTile) Reset() {
|
||||
*x = AbilityActionDestroyTile{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionDestroyTile_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionDestroyTile) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionDestroyTile) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionDestroyTile) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionDestroyTile_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionDestroyTile.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionDestroyTile) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionDestroyTile_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionDestroyTile) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionDestroyTile) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionDestroyTile_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionDestroyTile_proto_rawDesc = []byte{
|
||||
0x0a, 0x1e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44,
|
||||
0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x54, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50,
|
||||
0x0a, 0x18, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44,
|
||||
0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x54, 0x69, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x72, 0x6f,
|
||||
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72,
|
||||
0x52, 0x03, 0x72, 0x6f, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x70, 0x6f, 0x73,
|
||||
0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionDestroyTile_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionDestroyTile_proto_rawDescData = file_AbilityActionDestroyTile_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionDestroyTile_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionDestroyTile_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionDestroyTile_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionDestroyTile_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionDestroyTile_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionDestroyTile_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionDestroyTile_proto_goTypes = []interface{}{
|
||||
(*AbilityActionDestroyTile)(nil), // 0: AbilityActionDestroyTile
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionDestroyTile_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionDestroyTile.rot:type_name -> Vector
|
||||
1, // 1: AbilityActionDestroyTile.pos:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionDestroyTile_proto_init() }
|
||||
func file_AbilityActionDestroyTile_proto_init() {
|
||||
if File_AbilityActionDestroyTile_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionDestroyTile_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionDestroyTile); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionDestroyTile_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionDestroyTile_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionDestroyTile_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionDestroyTile_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionDestroyTile_proto = out.File
|
||||
file_AbilityActionDestroyTile_proto_rawDesc = nil
|
||||
file_AbilityActionDestroyTile_proto_goTypes = nil
|
||||
file_AbilityActionDestroyTile_proto_depIdxs = nil
|
||||
}
|
||||
26
gate-hk4e-api/proto/AbilityActionDestroyTile.proto
Normal file
26
gate-hk4e-api/proto/AbilityActionDestroyTile.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionDestroyTile {
|
||||
Vector rot = 3;
|
||||
Vector pos = 1;
|
||||
}
|
||||
163
gate-hk4e-api/proto/AbilityActionFireAfterImage.pb.go
Normal file
163
gate-hk4e-api/proto/AbilityActionFireAfterImage.pb.go
Normal file
@@ -0,0 +1,163 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionFireAfterImage.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionFireAfterImage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Dir *Vector `protobuf:"bytes,12,opt,name=dir,proto3" json:"dir,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionFireAfterImage) Reset() {
|
||||
*x = AbilityActionFireAfterImage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionFireAfterImage_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionFireAfterImage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionFireAfterImage) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionFireAfterImage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionFireAfterImage_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionFireAfterImage.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionFireAfterImage) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionFireAfterImage_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionFireAfterImage) GetDir() *Vector {
|
||||
if x != nil {
|
||||
return x.Dir
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionFireAfterImage_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionFireAfterImage_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46,
|
||||
0x69, 0x72, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x38, 0x0a, 0x1b, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x46, 0x69, 0x72, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65,
|
||||
0x12, 0x19, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e,
|
||||
0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x64, 0x69, 0x72, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
|
||||
0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionFireAfterImage_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionFireAfterImage_proto_rawDescData = file_AbilityActionFireAfterImage_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionFireAfterImage_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionFireAfterImage_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionFireAfterImage_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionFireAfterImage_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionFireAfterImage_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionFireAfterImage_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionFireAfterImage_proto_goTypes = []interface{}{
|
||||
(*AbilityActionFireAfterImage)(nil), // 0: AbilityActionFireAfterImage
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionFireAfterImage_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionFireAfterImage.dir:type_name -> Vector
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionFireAfterImage_proto_init() }
|
||||
func file_AbilityActionFireAfterImage_proto_init() {
|
||||
if File_AbilityActionFireAfterImage_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionFireAfterImage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionFireAfterImage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionFireAfterImage_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionFireAfterImage_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionFireAfterImage_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionFireAfterImage_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionFireAfterImage_proto = out.File
|
||||
file_AbilityActionFireAfterImage_proto_rawDesc = nil
|
||||
file_AbilityActionFireAfterImage_proto_goTypes = nil
|
||||
file_AbilityActionFireAfterImage_proto_depIdxs = nil
|
||||
}
|
||||
25
gate-hk4e-api/proto/AbilityActionFireAfterImage.proto
Normal file
25
gate-hk4e-api/proto/AbilityActionFireAfterImage.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionFireAfterImage {
|
||||
Vector dir = 12;
|
||||
}
|
||||
184
gate-hk4e-api/proto/AbilityActionGenerateElemBall.pb.go
Normal file
184
gate-hk4e-api/proto/AbilityActionGenerateElemBall.pb.go
Normal file
@@ -0,0 +1,184 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionGenerateElemBall.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionGenerateElemBall struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RoomId uint32 `protobuf:"varint,2,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,7,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
Rot *Vector `protobuf:"bytes,13,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) Reset() {
|
||||
*x = AbilityActionGenerateElemBall{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionGenerateElemBall_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionGenerateElemBall) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionGenerateElemBall_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionGenerateElemBall.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionGenerateElemBall) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionGenerateElemBall_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) GetRoomId() uint32 {
|
||||
if x != nil {
|
||||
return x.RoomId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionGenerateElemBall) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionGenerateElemBall_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionGenerateElemBall_proto_rawDesc = []byte{
|
||||
0x0a, 0x23, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x47,
|
||||
0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x42, 0x61, 0x6c, 0x6c, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, 0x1d, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d,
|
||||
0x42, 0x61, 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x19, 0x0a,
|
||||
0x03, 0x70, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63,
|
||||
0x74, 0x6f, 0x72, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x19, 0x0a, 0x03, 0x72, 0x6f, 0x74, 0x18,
|
||||
0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03,
|
||||
0x72, 0x6f, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionGenerateElemBall_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionGenerateElemBall_proto_rawDescData = file_AbilityActionGenerateElemBall_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionGenerateElemBall_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionGenerateElemBall_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionGenerateElemBall_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionGenerateElemBall_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionGenerateElemBall_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionGenerateElemBall_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionGenerateElemBall_proto_goTypes = []interface{}{
|
||||
(*AbilityActionGenerateElemBall)(nil), // 0: AbilityActionGenerateElemBall
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionGenerateElemBall_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionGenerateElemBall.pos:type_name -> Vector
|
||||
1, // 1: AbilityActionGenerateElemBall.rot:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionGenerateElemBall_proto_init() }
|
||||
func file_AbilityActionGenerateElemBall_proto_init() {
|
||||
if File_AbilityActionGenerateElemBall_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionGenerateElemBall_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionGenerateElemBall); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionGenerateElemBall_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionGenerateElemBall_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionGenerateElemBall_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionGenerateElemBall_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionGenerateElemBall_proto = out.File
|
||||
file_AbilityActionGenerateElemBall_proto_rawDesc = nil
|
||||
file_AbilityActionGenerateElemBall_proto_goTypes = nil
|
||||
file_AbilityActionGenerateElemBall_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AbilityActionGenerateElemBall.proto
Normal file
27
gate-hk4e-api/proto/AbilityActionGenerateElemBall.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionGenerateElemBall {
|
||||
uint32 room_id = 2;
|
||||
Vector pos = 7;
|
||||
Vector rot = 13;
|
||||
}
|
||||
160
gate-hk4e-api/proto/AbilityActionServerMonsterLog.pb.go
Normal file
160
gate-hk4e-api/proto/AbilityActionServerMonsterLog.pb.go
Normal file
@@ -0,0 +1,160 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionServerMonsterLog.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionServerMonsterLog struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ParamList []int32 `protobuf:"varint,2,rep,packed,name=param_list,json=paramList,proto3" json:"param_list,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionServerMonsterLog) Reset() {
|
||||
*x = AbilityActionServerMonsterLog{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionServerMonsterLog_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionServerMonsterLog) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionServerMonsterLog) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionServerMonsterLog) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionServerMonsterLog_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionServerMonsterLog.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionServerMonsterLog) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionServerMonsterLog_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionServerMonsterLog) GetParamList() []int32 {
|
||||
if x != nil {
|
||||
return x.ParamList
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionServerMonsterLog_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionServerMonsterLog_proto_rawDesc = []byte{
|
||||
0x0a, 0x23, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x1d, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
|
||||
0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x6f, 0x6e, 0x73,
|
||||
0x74, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f,
|
||||
0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionServerMonsterLog_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionServerMonsterLog_proto_rawDescData = file_AbilityActionServerMonsterLog_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionServerMonsterLog_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionServerMonsterLog_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionServerMonsterLog_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionServerMonsterLog_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionServerMonsterLog_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionServerMonsterLog_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionServerMonsterLog_proto_goTypes = []interface{}{
|
||||
(*AbilityActionServerMonsterLog)(nil), // 0: AbilityActionServerMonsterLog
|
||||
}
|
||||
var file_AbilityActionServerMonsterLog_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionServerMonsterLog_proto_init() }
|
||||
func file_AbilityActionServerMonsterLog_proto_init() {
|
||||
if File_AbilityActionServerMonsterLog_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionServerMonsterLog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionServerMonsterLog); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionServerMonsterLog_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionServerMonsterLog_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionServerMonsterLog_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionServerMonsterLog_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionServerMonsterLog_proto = out.File
|
||||
file_AbilityActionServerMonsterLog_proto_rawDesc = nil
|
||||
file_AbilityActionServerMonsterLog_proto_goTypes = nil
|
||||
file_AbilityActionServerMonsterLog_proto_depIdxs = nil
|
||||
}
|
||||
23
gate-hk4e-api/proto/AbilityActionServerMonsterLog.proto
Normal file
23
gate-hk4e-api/proto/AbilityActionServerMonsterLog.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionServerMonsterLog {
|
||||
repeated int32 param_list = 2;
|
||||
}
|
||||
173
gate-hk4e-api/proto/AbilityActionSetCrashDamage.pb.go
Normal file
173
gate-hk4e-api/proto/AbilityActionSetCrashDamage.pb.go
Normal file
@@ -0,0 +1,173 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionSetCrashDamage.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionSetCrashDamage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
HitPos *Vector `protobuf:"bytes,2,opt,name=hit_pos,json=hitPos,proto3" json:"hit_pos,omitempty"`
|
||||
Damage float32 `protobuf:"fixed32,15,opt,name=damage,proto3" json:"damage,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetCrashDamage) Reset() {
|
||||
*x = AbilityActionSetCrashDamage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionSetCrashDamage_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetCrashDamage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionSetCrashDamage) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionSetCrashDamage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionSetCrashDamage_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionSetCrashDamage.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionSetCrashDamage) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionSetCrashDamage_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetCrashDamage) GetHitPos() *Vector {
|
||||
if x != nil {
|
||||
return x.HitPos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetCrashDamage) GetDamage() float32 {
|
||||
if x != nil {
|
||||
return x.Damage
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityActionSetCrashDamage_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionSetCrashDamage_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53,
|
||||
0x65, 0x74, 0x43, 0x72, 0x61, 0x73, 0x68, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x57, 0x0a, 0x1b, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x65, 0x74, 0x43, 0x72, 0x61, 0x73, 0x68, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65,
|
||||
0x12, 0x20, 0x0a, 0x07, 0x68, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x06, 0x68, 0x69, 0x74, 0x50,
|
||||
0x6f, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0f, 0x20, 0x01,
|
||||
0x28, 0x02, 0x52, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f,
|
||||
0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionSetCrashDamage_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionSetCrashDamage_proto_rawDescData = file_AbilityActionSetCrashDamage_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionSetCrashDamage_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionSetCrashDamage_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionSetCrashDamage_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionSetCrashDamage_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionSetCrashDamage_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionSetCrashDamage_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionSetCrashDamage_proto_goTypes = []interface{}{
|
||||
(*AbilityActionSetCrashDamage)(nil), // 0: AbilityActionSetCrashDamage
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionSetCrashDamage_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionSetCrashDamage.hit_pos:type_name -> Vector
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionSetCrashDamage_proto_init() }
|
||||
func file_AbilityActionSetCrashDamage_proto_init() {
|
||||
if File_AbilityActionSetCrashDamage_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionSetCrashDamage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionSetCrashDamage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionSetCrashDamage_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionSetCrashDamage_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionSetCrashDamage_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionSetCrashDamage_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionSetCrashDamage_proto = out.File
|
||||
file_AbilityActionSetCrashDamage_proto_rawDesc = nil
|
||||
file_AbilityActionSetCrashDamage_proto_goTypes = nil
|
||||
file_AbilityActionSetCrashDamage_proto_depIdxs = nil
|
||||
}
|
||||
26
gate-hk4e-api/proto/AbilityActionSetCrashDamage.proto
Normal file
26
gate-hk4e-api/proto/AbilityActionSetCrashDamage.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionSetCrashDamage {
|
||||
Vector hit_pos = 2;
|
||||
float damage = 15;
|
||||
}
|
||||
161
gate-hk4e-api/proto/AbilityActionSetRandomOverrideMapValue.pb.go
Normal file
161
gate-hk4e-api/proto/AbilityActionSetRandomOverrideMapValue.pb.go
Normal file
@@ -0,0 +1,161 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionSetRandomOverrideMapValue.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionSetRandomOverrideMapValue struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RandomValue float32 `protobuf:"fixed32,1,opt,name=random_value,json=randomValue,proto3" json:"random_value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetRandomOverrideMapValue) Reset() {
|
||||
*x = AbilityActionSetRandomOverrideMapValue{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionSetRandomOverrideMapValue_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetRandomOverrideMapValue) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionSetRandomOverrideMapValue) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionSetRandomOverrideMapValue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionSetRandomOverrideMapValue_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionSetRandomOverrideMapValue.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionSetRandomOverrideMapValue) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionSetRandomOverrideMapValue_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSetRandomOverrideMapValue) GetRandomValue() float32 {
|
||||
if x != nil {
|
||||
return x.RandomValue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityActionSetRandomOverrideMapValue_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionSetRandomOverrideMapValue_proto_rawDesc = []byte{
|
||||
0x0a, 0x2c, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53,
|
||||
0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65,
|
||||
0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b,
|
||||
0x0a, 0x26, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53,
|
||||
0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65,
|
||||
0x4d, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64,
|
||||
0x6f, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b,
|
||||
0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
|
||||
0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_rawDescData = file_AbilityActionSetRandomOverrideMapValue_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionSetRandomOverrideMapValue_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionSetRandomOverrideMapValue_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionSetRandomOverrideMapValue_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionSetRandomOverrideMapValue_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionSetRandomOverrideMapValue_proto_goTypes = []interface{}{
|
||||
(*AbilityActionSetRandomOverrideMapValue)(nil), // 0: AbilityActionSetRandomOverrideMapValue
|
||||
}
|
||||
var file_AbilityActionSetRandomOverrideMapValue_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionSetRandomOverrideMapValue_proto_init() }
|
||||
func file_AbilityActionSetRandomOverrideMapValue_proto_init() {
|
||||
if File_AbilityActionSetRandomOverrideMapValue_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionSetRandomOverrideMapValue); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionSetRandomOverrideMapValue_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionSetRandomOverrideMapValue_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionSetRandomOverrideMapValue_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionSetRandomOverrideMapValue_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionSetRandomOverrideMapValue_proto = out.File
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_rawDesc = nil
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_goTypes = nil
|
||||
file_AbilityActionSetRandomOverrideMapValue_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionSetRandomOverrideMapValue {
|
||||
float random_value = 1;
|
||||
}
|
||||
173
gate-hk4e-api/proto/AbilityActionSummon.pb.go
Normal file
173
gate-hk4e-api/proto/AbilityActionSummon.pb.go
Normal file
@@ -0,0 +1,173 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionSummon.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionSummon struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Pos *Vector `protobuf:"bytes,10,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
Rot *Vector `protobuf:"bytes,1,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionSummon) Reset() {
|
||||
*x = AbilityActionSummon{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionSummon_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSummon) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionSummon) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionSummon) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionSummon_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionSummon.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionSummon) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionSummon_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionSummon) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityActionSummon) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityActionSummon_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionSummon_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53,
|
||||
0x75, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63,
|
||||
0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, 0x6d, 0x6f, 0x6e,
|
||||
0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e,
|
||||
0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x19, 0x0a, 0x03, 0x72,
|
||||
0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f,
|
||||
0x72, 0x52, 0x03, 0x72, 0x6f, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionSummon_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionSummon_proto_rawDescData = file_AbilityActionSummon_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionSummon_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionSummon_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionSummon_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionSummon_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionSummon_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionSummon_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionSummon_proto_goTypes = []interface{}{
|
||||
(*AbilityActionSummon)(nil), // 0: AbilityActionSummon
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityActionSummon_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityActionSummon.pos:type_name -> Vector
|
||||
1, // 1: AbilityActionSummon.rot:type_name -> Vector
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionSummon_proto_init() }
|
||||
func file_AbilityActionSummon_proto_init() {
|
||||
if File_AbilityActionSummon_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionSummon_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionSummon); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionSummon_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionSummon_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionSummon_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionSummon_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionSummon_proto = out.File
|
||||
file_AbilityActionSummon_proto_rawDesc = nil
|
||||
file_AbilityActionSummon_proto_goTypes = nil
|
||||
file_AbilityActionSummon_proto_depIdxs = nil
|
||||
}
|
||||
26
gate-hk4e-api/proto/AbilityActionSummon.proto
Normal file
26
gate-hk4e-api/proto/AbilityActionSummon.proto
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionSummon {
|
||||
Vector pos = 10;
|
||||
Vector rot = 1;
|
||||
}
|
||||
160
gate-hk4e-api/proto/AbilityActionTriggerAbility.pb.go
Normal file
160
gate-hk4e-api/proto/AbilityActionTriggerAbility.pb.go
Normal file
@@ -0,0 +1,160 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityActionTriggerAbility.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityActionTriggerAbility struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OtherId uint32 `protobuf:"varint,14,opt,name=other_id,json=otherId,proto3" json:"other_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityActionTriggerAbility) Reset() {
|
||||
*x = AbilityActionTriggerAbility{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityActionTriggerAbility_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityActionTriggerAbility) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityActionTriggerAbility) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityActionTriggerAbility) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityActionTriggerAbility_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityActionTriggerAbility.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityActionTriggerAbility) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityActionTriggerAbility_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityActionTriggerAbility) GetOtherId() uint32 {
|
||||
if x != nil {
|
||||
return x.OtherId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityActionTriggerAbility_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityActionTriggerAbility_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54,
|
||||
0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x1b, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x41, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0e,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x64, 0x42, 0x0a, 0x5a,
|
||||
0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityActionTriggerAbility_proto_rawDescOnce sync.Once
|
||||
file_AbilityActionTriggerAbility_proto_rawDescData = file_AbilityActionTriggerAbility_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityActionTriggerAbility_proto_rawDescGZIP() []byte {
|
||||
file_AbilityActionTriggerAbility_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityActionTriggerAbility_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityActionTriggerAbility_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityActionTriggerAbility_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityActionTriggerAbility_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityActionTriggerAbility_proto_goTypes = []interface{}{
|
||||
(*AbilityActionTriggerAbility)(nil), // 0: AbilityActionTriggerAbility
|
||||
}
|
||||
var file_AbilityActionTriggerAbility_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityActionTriggerAbility_proto_init() }
|
||||
func file_AbilityActionTriggerAbility_proto_init() {
|
||||
if File_AbilityActionTriggerAbility_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityActionTriggerAbility_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityActionTriggerAbility); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityActionTriggerAbility_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityActionTriggerAbility_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityActionTriggerAbility_proto_depIdxs,
|
||||
MessageInfos: file_AbilityActionTriggerAbility_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityActionTriggerAbility_proto = out.File
|
||||
file_AbilityActionTriggerAbility_proto_rawDesc = nil
|
||||
file_AbilityActionTriggerAbility_proto_goTypes = nil
|
||||
file_AbilityActionTriggerAbility_proto_depIdxs = nil
|
||||
}
|
||||
23
gate-hk4e-api/proto/AbilityActionTriggerAbility.proto
Normal file
23
gate-hk4e-api/proto/AbilityActionTriggerAbility.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityActionTriggerAbility {
|
||||
uint32 other_id = 14;
|
||||
}
|
||||
205
gate-hk4e-api/proto/AbilityAppliedAbility.pb.go
Normal file
205
gate-hk4e-api/proto/AbilityAppliedAbility.pb.go
Normal file
@@ -0,0 +1,205 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityAppliedAbility.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityAppliedAbility struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AbilityName *AbilityString `protobuf:"bytes,1,opt,name=ability_name,json=abilityName,proto3" json:"ability_name,omitempty"`
|
||||
AbilityOverride *AbilityString `protobuf:"bytes,2,opt,name=ability_override,json=abilityOverride,proto3" json:"ability_override,omitempty"`
|
||||
OverrideMap []*AbilityScalarValueEntry `protobuf:"bytes,3,rep,name=override_map,json=overrideMap,proto3" json:"override_map,omitempty"`
|
||||
InstancedAbilityId uint32 `protobuf:"varint,4,opt,name=instanced_ability_id,json=instancedAbilityId,proto3" json:"instanced_ability_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) Reset() {
|
||||
*x = AbilityAppliedAbility{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityAppliedAbility_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityAppliedAbility) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityAppliedAbility) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityAppliedAbility_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityAppliedAbility.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityAppliedAbility) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityAppliedAbility_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) GetAbilityName() *AbilityString {
|
||||
if x != nil {
|
||||
return x.AbilityName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) GetAbilityOverride() *AbilityString {
|
||||
if x != nil {
|
||||
return x.AbilityOverride
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) GetOverrideMap() []*AbilityScalarValueEntry {
|
||||
if x != nil {
|
||||
return x.OverrideMap
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedAbility) GetInstancedAbilityId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedAbilityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityAppliedAbility_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityAppliedAbility_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64,
|
||||
0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x41,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x56, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x41, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xf4, 0x01, 0x0a, 0x15, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70,
|
||||
0x6c, 0x69, 0x65, 0x64, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x31, 0x0a, 0x0c, 0x61,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e,
|
||||
0x67, 0x52, 0x0b, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39,
|
||||
0x0a, 0x10, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69,
|
||||
0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x6f, 0x76, 0x65,
|
||||
0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x18, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6f, 0x76, 0x65, 0x72, 0x72,
|
||||
0x69, 0x64, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
|
||||
0x63, 0x65, 0x64, 0x5f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x64, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityAppliedAbility_proto_rawDescOnce sync.Once
|
||||
file_AbilityAppliedAbility_proto_rawDescData = file_AbilityAppliedAbility_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityAppliedAbility_proto_rawDescGZIP() []byte {
|
||||
file_AbilityAppliedAbility_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityAppliedAbility_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityAppliedAbility_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityAppliedAbility_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityAppliedAbility_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityAppliedAbility_proto_goTypes = []interface{}{
|
||||
(*AbilityAppliedAbility)(nil), // 0: AbilityAppliedAbility
|
||||
(*AbilityString)(nil), // 1: AbilityString
|
||||
(*AbilityScalarValueEntry)(nil), // 2: AbilityScalarValueEntry
|
||||
}
|
||||
var file_AbilityAppliedAbility_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityAppliedAbility.ability_name:type_name -> AbilityString
|
||||
1, // 1: AbilityAppliedAbility.ability_override:type_name -> AbilityString
|
||||
2, // 2: AbilityAppliedAbility.override_map:type_name -> AbilityScalarValueEntry
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityAppliedAbility_proto_init() }
|
||||
func file_AbilityAppliedAbility_proto_init() {
|
||||
if File_AbilityAppliedAbility_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityScalarValueEntry_proto_init()
|
||||
file_AbilityString_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityAppliedAbility_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityAppliedAbility); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityAppliedAbility_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityAppliedAbility_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityAppliedAbility_proto_depIdxs,
|
||||
MessageInfos: file_AbilityAppliedAbility_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityAppliedAbility_proto = out.File
|
||||
file_AbilityAppliedAbility_proto_rawDesc = nil
|
||||
file_AbilityAppliedAbility_proto_goTypes = nil
|
||||
file_AbilityAppliedAbility_proto_depIdxs = nil
|
||||
}
|
||||
29
gate-hk4e-api/proto/AbilityAppliedAbility.proto
Normal file
29
gate-hk4e-api/proto/AbilityAppliedAbility.proto
Normal file
@@ -0,0 +1,29 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityScalarValueEntry.proto";
|
||||
import "AbilityString.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityAppliedAbility {
|
||||
AbilityString ability_name = 1;
|
||||
AbilityString ability_override = 2;
|
||||
repeated AbilityScalarValueEntry override_map = 3;
|
||||
uint32 instanced_ability_id = 4;
|
||||
}
|
||||
313
gate-hk4e-api/proto/AbilityAppliedModifier.pb.go
Normal file
313
gate-hk4e-api/proto/AbilityAppliedModifier.pb.go
Normal file
@@ -0,0 +1,313 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityAppliedModifier.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityAppliedModifier struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ModifierLocalId int32 `protobuf:"varint,1,opt,name=modifier_local_id,json=modifierLocalId,proto3" json:"modifier_local_id,omitempty"`
|
||||
ParentAbilityEntityId uint32 `protobuf:"varint,2,opt,name=parent_ability_entity_id,json=parentAbilityEntityId,proto3" json:"parent_ability_entity_id,omitempty"`
|
||||
ParentAbilityName *AbilityString `protobuf:"bytes,3,opt,name=parent_ability_name,json=parentAbilityName,proto3" json:"parent_ability_name,omitempty"`
|
||||
ParentAbilityOverride *AbilityString `protobuf:"bytes,4,opt,name=parent_ability_override,json=parentAbilityOverride,proto3" json:"parent_ability_override,omitempty"`
|
||||
InstancedAbilityId uint32 `protobuf:"varint,5,opt,name=instanced_ability_id,json=instancedAbilityId,proto3" json:"instanced_ability_id,omitempty"`
|
||||
InstancedModifierId uint32 `protobuf:"varint,6,opt,name=instanced_modifier_id,json=instancedModifierId,proto3" json:"instanced_modifier_id,omitempty"`
|
||||
ExistDuration float32 `protobuf:"fixed32,7,opt,name=exist_duration,json=existDuration,proto3" json:"exist_duration,omitempty"`
|
||||
AttachedInstancedModifier *AbilityAttachedModifier `protobuf:"bytes,8,opt,name=attached_instanced_modifier,json=attachedInstancedModifier,proto3" json:"attached_instanced_modifier,omitempty"`
|
||||
ApplyEntityId uint32 `protobuf:"varint,9,opt,name=apply_entity_id,json=applyEntityId,proto3" json:"apply_entity_id,omitempty"`
|
||||
IsAttachedParentAbility bool `protobuf:"varint,10,opt,name=is_attached_parent_ability,json=isAttachedParentAbility,proto3" json:"is_attached_parent_ability,omitempty"`
|
||||
ModifierDurability *ModifierDurability `protobuf:"bytes,11,opt,name=modifier_durability,json=modifierDurability,proto3" json:"modifier_durability,omitempty"`
|
||||
SbuffUid uint32 `protobuf:"varint,12,opt,name=sbuff_uid,json=sbuffUid,proto3" json:"sbuff_uid,omitempty"`
|
||||
IsServerbuffModifier bool `protobuf:"varint,13,opt,name=is_serverbuff_modifier,json=isServerbuffModifier,proto3" json:"is_serverbuff_modifier,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) Reset() {
|
||||
*x = AbilityAppliedModifier{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityAppliedModifier_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityAppliedModifier) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityAppliedModifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityAppliedModifier_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityAppliedModifier.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityAppliedModifier) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityAppliedModifier_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetModifierLocalId() int32 {
|
||||
if x != nil {
|
||||
return x.ModifierLocalId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetParentAbilityEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.ParentAbilityEntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetParentAbilityName() *AbilityString {
|
||||
if x != nil {
|
||||
return x.ParentAbilityName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetParentAbilityOverride() *AbilityString {
|
||||
if x != nil {
|
||||
return x.ParentAbilityOverride
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetInstancedAbilityId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedAbilityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetInstancedModifierId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedModifierId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetExistDuration() float32 {
|
||||
if x != nil {
|
||||
return x.ExistDuration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetAttachedInstancedModifier() *AbilityAttachedModifier {
|
||||
if x != nil {
|
||||
return x.AttachedInstancedModifier
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetApplyEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.ApplyEntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetIsAttachedParentAbility() bool {
|
||||
if x != nil {
|
||||
return x.IsAttachedParentAbility
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetModifierDurability() *ModifierDurability {
|
||||
if x != nil {
|
||||
return x.ModifierDurability
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetSbuffUid() uint32 {
|
||||
if x != nil {
|
||||
return x.SbuffUid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAppliedModifier) GetIsServerbuffModifier() bool {
|
||||
if x != nil {
|
||||
return x.IsServerbuffModifier
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_AbilityAppliedModifier_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityAppliedModifier_proto_rawDesc = []byte{
|
||||
0x0a, 0x1c, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64,
|
||||
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d,
|
||||
0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x4d,
|
||||
0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x41,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x18, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x05, 0x0a,
|
||||
0x16, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x4d,
|
||||
0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66,
|
||||
0x69, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x4c, 0x6f, 0x63, 0x61,
|
||||
0x6c, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x13,
|
||||
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x62, 0x69, 0x6c,
|
||||
0x69, 0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e,
|
||||
0x74, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x17,
|
||||
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6f,
|
||||
0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
|
||||
0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x15, 0x70,
|
||||
0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4f, 0x76, 0x65, 0x72,
|
||||
0x72, 0x69, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
|
||||
0x64, 0x5f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
|
||||
0x63, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64,
|
||||
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78,
|
||||
0x69, 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01,
|
||||
0x28, 0x02, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x58, 0x0a, 0x1b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x69, 0x6e,
|
||||
0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72,
|
||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
|
||||
0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72,
|
||||
0x52, 0x19, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e,
|
||||
0x63, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x61,
|
||||
0x70, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x09,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x73, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68,
|
||||
0x65, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x69, 0x73, 0x41, 0x74, 0x74, 0x61, 0x63,
|
||||
0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
|
||||
0x12, 0x44, 0x0a, 0x13, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x64, 0x75, 0x72,
|
||||
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x52, 0x12, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61,
|
||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x62, 0x75, 0x66, 0x66, 0x5f,
|
||||
0x75, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x62, 0x75, 0x66, 0x66,
|
||||
0x55, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x62, 0x75, 0x66, 0x66, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x0d, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x75, 0x66,
|
||||
0x66, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityAppliedModifier_proto_rawDescOnce sync.Once
|
||||
file_AbilityAppliedModifier_proto_rawDescData = file_AbilityAppliedModifier_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityAppliedModifier_proto_rawDescGZIP() []byte {
|
||||
file_AbilityAppliedModifier_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityAppliedModifier_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityAppliedModifier_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityAppliedModifier_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityAppliedModifier_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityAppliedModifier_proto_goTypes = []interface{}{
|
||||
(*AbilityAppliedModifier)(nil), // 0: AbilityAppliedModifier
|
||||
(*AbilityString)(nil), // 1: AbilityString
|
||||
(*AbilityAttachedModifier)(nil), // 2: AbilityAttachedModifier
|
||||
(*ModifierDurability)(nil), // 3: ModifierDurability
|
||||
}
|
||||
var file_AbilityAppliedModifier_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityAppliedModifier.parent_ability_name:type_name -> AbilityString
|
||||
1, // 1: AbilityAppliedModifier.parent_ability_override:type_name -> AbilityString
|
||||
2, // 2: AbilityAppliedModifier.attached_instanced_modifier:type_name -> AbilityAttachedModifier
|
||||
3, // 3: AbilityAppliedModifier.modifier_durability:type_name -> ModifierDurability
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityAppliedModifier_proto_init() }
|
||||
func file_AbilityAppliedModifier_proto_init() {
|
||||
if File_AbilityAppliedModifier_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityAttachedModifier_proto_init()
|
||||
file_AbilityString_proto_init()
|
||||
file_ModifierDurability_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityAppliedModifier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityAppliedModifier); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityAppliedModifier_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityAppliedModifier_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityAppliedModifier_proto_depIdxs,
|
||||
MessageInfos: file_AbilityAppliedModifier_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityAppliedModifier_proto = out.File
|
||||
file_AbilityAppliedModifier_proto_rawDesc = nil
|
||||
file_AbilityAppliedModifier_proto_goTypes = nil
|
||||
file_AbilityAppliedModifier_proto_depIdxs = nil
|
||||
}
|
||||
39
gate-hk4e-api/proto/AbilityAppliedModifier.proto
Normal file
39
gate-hk4e-api/proto/AbilityAppliedModifier.proto
Normal file
@@ -0,0 +1,39 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityAttachedModifier.proto";
|
||||
import "AbilityString.proto";
|
||||
import "ModifierDurability.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityAppliedModifier {
|
||||
int32 modifier_local_id = 1;
|
||||
uint32 parent_ability_entity_id = 2;
|
||||
AbilityString parent_ability_name = 3;
|
||||
AbilityString parent_ability_override = 4;
|
||||
uint32 instanced_ability_id = 5;
|
||||
uint32 instanced_modifier_id = 6;
|
||||
float exist_duration = 7;
|
||||
AbilityAttachedModifier attached_instanced_modifier = 8;
|
||||
uint32 apply_entity_id = 9;
|
||||
bool is_attached_parent_ability = 10;
|
||||
ModifierDurability modifier_durability = 11;
|
||||
uint32 sbuff_uid = 12;
|
||||
bool is_serverbuff_modifier = 13;
|
||||
}
|
||||
160
gate-hk4e-api/proto/AbilityApplyLevelModifier.pb.go
Normal file
160
gate-hk4e-api/proto/AbilityApplyLevelModifier.pb.go
Normal file
@@ -0,0 +1,160 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityApplyLevelModifier.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityApplyLevelModifier struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ApplyEntityId uint32 `protobuf:"varint,6,opt,name=apply_entity_id,json=applyEntityId,proto3" json:"apply_entity_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityApplyLevelModifier) Reset() {
|
||||
*x = AbilityApplyLevelModifier{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityApplyLevelModifier_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityApplyLevelModifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityApplyLevelModifier) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityApplyLevelModifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityApplyLevelModifier_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityApplyLevelModifier.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityApplyLevelModifier) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityApplyLevelModifier_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityApplyLevelModifier) GetApplyEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.ApplyEntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityApplyLevelModifier_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityApplyLevelModifier_proto_rawDesc = []byte{
|
||||
0x0a, 0x1f, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x65,
|
||||
0x76, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x43, 0x0a, 0x19, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c,
|
||||
0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x26,
|
||||
0x0a, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityApplyLevelModifier_proto_rawDescOnce sync.Once
|
||||
file_AbilityApplyLevelModifier_proto_rawDescData = file_AbilityApplyLevelModifier_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityApplyLevelModifier_proto_rawDescGZIP() []byte {
|
||||
file_AbilityApplyLevelModifier_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityApplyLevelModifier_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityApplyLevelModifier_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityApplyLevelModifier_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityApplyLevelModifier_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityApplyLevelModifier_proto_goTypes = []interface{}{
|
||||
(*AbilityApplyLevelModifier)(nil), // 0: AbilityApplyLevelModifier
|
||||
}
|
||||
var file_AbilityApplyLevelModifier_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityApplyLevelModifier_proto_init() }
|
||||
func file_AbilityApplyLevelModifier_proto_init() {
|
||||
if File_AbilityApplyLevelModifier_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityApplyLevelModifier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityApplyLevelModifier); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityApplyLevelModifier_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityApplyLevelModifier_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityApplyLevelModifier_proto_depIdxs,
|
||||
MessageInfos: file_AbilityApplyLevelModifier_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityApplyLevelModifier_proto = out.File
|
||||
file_AbilityApplyLevelModifier_proto_rawDesc = nil
|
||||
file_AbilityApplyLevelModifier_proto_goTypes = nil
|
||||
file_AbilityApplyLevelModifier_proto_depIdxs = nil
|
||||
}
|
||||
23
gate-hk4e-api/proto/AbilityApplyLevelModifier.proto
Normal file
23
gate-hk4e-api/proto/AbilityApplyLevelModifier.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityApplyLevelModifier {
|
||||
uint32 apply_entity_id = 6;
|
||||
}
|
||||
214
gate-hk4e-api/proto/AbilityArgument.pb.go
Normal file
214
gate-hk4e-api/proto/AbilityArgument.pb.go
Normal file
@@ -0,0 +1,214 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityArgument.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityArgument struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Arg:
|
||||
// *AbilityArgument_IntArg
|
||||
// *AbilityArgument_FloatArg
|
||||
// *AbilityArgument_StrArg
|
||||
Arg isAbilityArgument_Arg `protobuf_oneof:"arg"`
|
||||
}
|
||||
|
||||
func (x *AbilityArgument) Reset() {
|
||||
*x = AbilityArgument{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityArgument_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityArgument) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityArgument) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityArgument) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityArgument_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityArgument.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityArgument) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityArgument_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *AbilityArgument) GetArg() isAbilityArgument_Arg {
|
||||
if m != nil {
|
||||
return m.Arg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityArgument) GetIntArg() uint32 {
|
||||
if x, ok := x.GetArg().(*AbilityArgument_IntArg); ok {
|
||||
return x.IntArg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityArgument) GetFloatArg() float32 {
|
||||
if x, ok := x.GetArg().(*AbilityArgument_FloatArg); ok {
|
||||
return x.FloatArg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityArgument) GetStrArg() string {
|
||||
if x, ok := x.GetArg().(*AbilityArgument_StrArg); ok {
|
||||
return x.StrArg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type isAbilityArgument_Arg interface {
|
||||
isAbilityArgument_Arg()
|
||||
}
|
||||
|
||||
type AbilityArgument_IntArg struct {
|
||||
IntArg uint32 `protobuf:"varint,5,opt,name=int_arg,json=intArg,proto3,oneof"`
|
||||
}
|
||||
|
||||
type AbilityArgument_FloatArg struct {
|
||||
FloatArg float32 `protobuf:"fixed32,15,opt,name=float_arg,json=floatArg,proto3,oneof"`
|
||||
}
|
||||
|
||||
type AbilityArgument_StrArg struct {
|
||||
StrArg string `protobuf:"bytes,11,opt,name=str_arg,json=strArg,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*AbilityArgument_IntArg) isAbilityArgument_Arg() {}
|
||||
|
||||
func (*AbilityArgument_FloatArg) isAbilityArgument_Arg() {}
|
||||
|
||||
func (*AbilityArgument_StrArg) isAbilityArgument_Arg() {}
|
||||
|
||||
var File_AbilityArgument_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityArgument_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x0f, 0x41, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x69, 0x6e,
|
||||
0x74, 0x5f, 0x61, 0x72, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x06, 0x69,
|
||||
0x6e, 0x74, 0x41, 0x72, 0x67, 0x12, 0x1d, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x61,
|
||||
0x72, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x08, 0x66, 0x6c, 0x6f, 0x61,
|
||||
0x74, 0x41, 0x72, 0x67, 0x12, 0x19, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x5f, 0x61, 0x72, 0x67, 0x18,
|
||||
0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x41, 0x72, 0x67, 0x42,
|
||||
0x05, 0x0a, 0x03, 0x61, 0x72, 0x67, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityArgument_proto_rawDescOnce sync.Once
|
||||
file_AbilityArgument_proto_rawDescData = file_AbilityArgument_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityArgument_proto_rawDescGZIP() []byte {
|
||||
file_AbilityArgument_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityArgument_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityArgument_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityArgument_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityArgument_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityArgument_proto_goTypes = []interface{}{
|
||||
(*AbilityArgument)(nil), // 0: AbilityArgument
|
||||
}
|
||||
var file_AbilityArgument_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityArgument_proto_init() }
|
||||
func file_AbilityArgument_proto_init() {
|
||||
if File_AbilityArgument_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityArgument_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityArgument); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_AbilityArgument_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*AbilityArgument_IntArg)(nil),
|
||||
(*AbilityArgument_FloatArg)(nil),
|
||||
(*AbilityArgument_StrArg)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityArgument_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityArgument_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityArgument_proto_depIdxs,
|
||||
MessageInfos: file_AbilityArgument_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityArgument_proto = out.File
|
||||
file_AbilityArgument_proto_rawDesc = nil
|
||||
file_AbilityArgument_proto_goTypes = nil
|
||||
file_AbilityArgument_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AbilityArgument.proto
Normal file
27
gate-hk4e-api/proto/AbilityArgument.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityArgument {
|
||||
oneof arg {
|
||||
uint32 int_arg = 5;
|
||||
float float_arg = 15;
|
||||
string str_arg = 11;
|
||||
}
|
||||
}
|
||||
203
gate-hk4e-api/proto/AbilityAttachedModifier.pb.go
Normal file
203
gate-hk4e-api/proto/AbilityAttachedModifier.pb.go
Normal file
@@ -0,0 +1,203 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityAttachedModifier.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityAttachedModifier struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
IsInvalid bool `protobuf:"varint,1,opt,name=is_invalid,json=isInvalid,proto3" json:"is_invalid,omitempty"`
|
||||
OwnerEntityId uint32 `protobuf:"varint,2,opt,name=owner_entity_id,json=ownerEntityId,proto3" json:"owner_entity_id,omitempty"`
|
||||
InstancedModifierId uint32 `protobuf:"varint,3,opt,name=instanced_modifier_id,json=instancedModifierId,proto3" json:"instanced_modifier_id,omitempty"`
|
||||
IsServerbuffModifier bool `protobuf:"varint,4,opt,name=is_serverbuff_modifier,json=isServerbuffModifier,proto3" json:"is_serverbuff_modifier,omitempty"`
|
||||
AttachNameHash int32 `protobuf:"varint,5,opt,name=attach_name_hash,json=attachNameHash,proto3" json:"attach_name_hash,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) Reset() {
|
||||
*x = AbilityAttachedModifier{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityAttachedModifier_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityAttachedModifier) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityAttachedModifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityAttachedModifier_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityAttachedModifier.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityAttachedModifier) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityAttachedModifier_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) GetIsInvalid() bool {
|
||||
if x != nil {
|
||||
return x.IsInvalid
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) GetOwnerEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.OwnerEntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) GetInstancedModifierId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedModifierId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) GetIsServerbuffModifier() bool {
|
||||
if x != nil {
|
||||
return x.IsServerbuffModifier
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AbilityAttachedModifier) GetAttachNameHash() int32 {
|
||||
if x != nil {
|
||||
return x.AttachNameHash
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityAttachedModifier_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityAttachedModifier_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65,
|
||||
0x64, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0xf4, 0x01, 0x0a, 0x17, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x41, 0x74, 0x74, 0x61, 0x63,
|
||||
0x68, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x69,
|
||||
0x73, 0x5f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x09, 0x69, 0x73, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x6f, 0x77,
|
||||
0x6e, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79,
|
||||
0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x5f,
|
||||
0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x69,
|
||||
0x66, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x65, 0x72, 0x62, 0x75, 0x66, 0x66, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x62, 0x75, 0x66, 0x66, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10,
|
||||
0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68,
|
||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x4e, 0x61,
|
||||
0x6d, 0x65, 0x48, 0x61, 0x73, 0x68, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityAttachedModifier_proto_rawDescOnce sync.Once
|
||||
file_AbilityAttachedModifier_proto_rawDescData = file_AbilityAttachedModifier_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityAttachedModifier_proto_rawDescGZIP() []byte {
|
||||
file_AbilityAttachedModifier_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityAttachedModifier_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityAttachedModifier_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityAttachedModifier_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityAttachedModifier_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityAttachedModifier_proto_goTypes = []interface{}{
|
||||
(*AbilityAttachedModifier)(nil), // 0: AbilityAttachedModifier
|
||||
}
|
||||
var file_AbilityAttachedModifier_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityAttachedModifier_proto_init() }
|
||||
func file_AbilityAttachedModifier_proto_init() {
|
||||
if File_AbilityAttachedModifier_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityAttachedModifier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityAttachedModifier); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityAttachedModifier_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityAttachedModifier_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityAttachedModifier_proto_depIdxs,
|
||||
MessageInfos: file_AbilityAttachedModifier_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityAttachedModifier_proto = out.File
|
||||
file_AbilityAttachedModifier_proto_rawDesc = nil
|
||||
file_AbilityAttachedModifier_proto_goTypes = nil
|
||||
file_AbilityAttachedModifier_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AbilityAttachedModifier.proto
Normal file
27
gate-hk4e-api/proto/AbilityAttachedModifier.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityAttachedModifier {
|
||||
bool is_invalid = 1;
|
||||
uint32 owner_entity_id = 2;
|
||||
uint32 instanced_modifier_id = 3;
|
||||
bool is_serverbuff_modifier = 4;
|
||||
int32 attach_name_hash = 5;
|
||||
}
|
||||
184
gate-hk4e-api/proto/AbilityBornType.pb.go
Normal file
184
gate-hk4e-api/proto/AbilityBornType.pb.go
Normal file
@@ -0,0 +1,184 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityBornType.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityBornType struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rot *Vector `protobuf:"bytes,2,opt,name=rot,proto3" json:"rot,omitempty"`
|
||||
MoveDir *Vector `protobuf:"bytes,14,opt,name=move_dir,json=moveDir,proto3" json:"move_dir,omitempty"`
|
||||
Pos *Vector `protobuf:"bytes,5,opt,name=pos,proto3" json:"pos,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityBornType) Reset() {
|
||||
*x = AbilityBornType{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityBornType_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityBornType) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityBornType) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityBornType) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityBornType_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityBornType.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityBornType) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityBornType_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityBornType) GetRot() *Vector {
|
||||
if x != nil {
|
||||
return x.Rot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityBornType) GetMoveDir() *Vector {
|
||||
if x != nil {
|
||||
return x.MoveDir
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityBornType) GetPos() *Vector {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityBornType_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityBornType_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x6f, 0x72, 0x6e, 0x54, 0x79, 0x70,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0f, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
|
||||
0x42, 0x6f, 0x72, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x72, 0x6f, 0x74, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03,
|
||||
0x72, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x08, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x18,
|
||||
0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x07,
|
||||
0x6d, 0x6f, 0x76, 0x65, 0x44, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x70,
|
||||
0x6f, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityBornType_proto_rawDescOnce sync.Once
|
||||
file_AbilityBornType_proto_rawDescData = file_AbilityBornType_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityBornType_proto_rawDescGZIP() []byte {
|
||||
file_AbilityBornType_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityBornType_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityBornType_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityBornType_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityBornType_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityBornType_proto_goTypes = []interface{}{
|
||||
(*AbilityBornType)(nil), // 0: AbilityBornType
|
||||
(*Vector)(nil), // 1: Vector
|
||||
}
|
||||
var file_AbilityBornType_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityBornType.rot:type_name -> Vector
|
||||
1, // 1: AbilityBornType.move_dir:type_name -> Vector
|
||||
1, // 2: AbilityBornType.pos:type_name -> Vector
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityBornType_proto_init() }
|
||||
func file_AbilityBornType_proto_init() {
|
||||
if File_AbilityBornType_proto != nil {
|
||||
return
|
||||
}
|
||||
file_Vector_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityBornType_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityBornType); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityBornType_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityBornType_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityBornType_proto_depIdxs,
|
||||
MessageInfos: file_AbilityBornType_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityBornType_proto = out.File
|
||||
file_AbilityBornType_proto_rawDesc = nil
|
||||
file_AbilityBornType_proto_goTypes = nil
|
||||
file_AbilityBornType_proto_depIdxs = nil
|
||||
}
|
||||
27
gate-hk4e-api/proto/AbilityBornType.proto
Normal file
27
gate-hk4e-api/proto/AbilityBornType.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "Vector.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityBornType {
|
||||
Vector rot = 2;
|
||||
Vector move_dir = 14;
|
||||
Vector pos = 5;
|
||||
}
|
||||
179
gate-hk4e-api/proto/AbilityChangeNotify.pb.go
Normal file
179
gate-hk4e-api/proto/AbilityChangeNotify.pb.go
Normal file
@@ -0,0 +1,179 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityChangeNotify.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// CmdId: 1131
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
type AbilityChangeNotify struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EntityId uint32 `protobuf:"varint,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
|
||||
AbilityControlBlock *AbilityControlBlock `protobuf:"bytes,15,opt,name=ability_control_block,json=abilityControlBlock,proto3" json:"ability_control_block,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityChangeNotify) Reset() {
|
||||
*x = AbilityChangeNotify{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityChangeNotify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityChangeNotify) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityChangeNotify) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityChangeNotify) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityChangeNotify_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityChangeNotify.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityChangeNotify) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityChangeNotify_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityChangeNotify) GetEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.EntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityChangeNotify) GetAbilityControlBlock() *AbilityControlBlock {
|
||||
if x != nil {
|
||||
return x.AbilityControlBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityChangeNotify_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityChangeNotify_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e,
|
||||
0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x13, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x1b, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x15, 0x61, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x62, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x41, 0x62, 0x69, 0x6c,
|
||||
0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52,
|
||||
0x13, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityChangeNotify_proto_rawDescOnce sync.Once
|
||||
file_AbilityChangeNotify_proto_rawDescData = file_AbilityChangeNotify_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityChangeNotify_proto_rawDescGZIP() []byte {
|
||||
file_AbilityChangeNotify_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityChangeNotify_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityChangeNotify_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityChangeNotify_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityChangeNotify_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityChangeNotify_proto_goTypes = []interface{}{
|
||||
(*AbilityChangeNotify)(nil), // 0: AbilityChangeNotify
|
||||
(*AbilityControlBlock)(nil), // 1: AbilityControlBlock
|
||||
}
|
||||
var file_AbilityChangeNotify_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityChangeNotify.ability_control_block:type_name -> AbilityControlBlock
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityChangeNotify_proto_init() }
|
||||
func file_AbilityChangeNotify_proto_init() {
|
||||
if File_AbilityChangeNotify_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityControlBlock_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityChangeNotify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityChangeNotify); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityChangeNotify_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityChangeNotify_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityChangeNotify_proto_depIdxs,
|
||||
MessageInfos: file_AbilityChangeNotify_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityChangeNotify_proto = out.File
|
||||
file_AbilityChangeNotify_proto_rawDesc = nil
|
||||
file_AbilityChangeNotify_proto_goTypes = nil
|
||||
file_AbilityChangeNotify_proto_depIdxs = nil
|
||||
}
|
||||
29
gate-hk4e-api/proto/AbilityChangeNotify.proto
Normal file
29
gate-hk4e-api/proto/AbilityChangeNotify.proto
Normal file
@@ -0,0 +1,29 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityControlBlock.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
// CmdId: 1131
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
message AbilityChangeNotify {
|
||||
uint32 entity_id = 1;
|
||||
AbilityControlBlock ability_control_block = 15;
|
||||
}
|
||||
165
gate-hk4e-api/proto/AbilityControlBlock.pb.go
Normal file
165
gate-hk4e-api/proto/AbilityControlBlock.pb.go
Normal file
@@ -0,0 +1,165 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityControlBlock.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityControlBlock struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AbilityEmbryoList []*AbilityEmbryo `protobuf:"bytes,1,rep,name=ability_embryo_list,json=abilityEmbryoList,proto3" json:"ability_embryo_list,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityControlBlock) Reset() {
|
||||
*x = AbilityControlBlock{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityControlBlock_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityControlBlock) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityControlBlock) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityControlBlock) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityControlBlock_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityControlBlock.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityControlBlock) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityControlBlock_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityControlBlock) GetAbilityEmbryoList() []*AbilityEmbryo {
|
||||
if x != nil {
|
||||
return x.AbilityEmbryoList
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityControlBlock_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityControlBlock_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x45, 0x6d, 0x62, 0x72, 0x79, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0x55, 0x0a, 0x13, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72,
|
||||
0x6f, 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3e, 0x0a, 0x13, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x5f, 0x65, 0x6d, 0x62, 0x72, 0x79, 0x6f, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6d,
|
||||
0x62, 0x72, 0x79, 0x6f, 0x52, 0x11, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6d, 0x62,
|
||||
0x72, 0x79, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityControlBlock_proto_rawDescOnce sync.Once
|
||||
file_AbilityControlBlock_proto_rawDescData = file_AbilityControlBlock_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityControlBlock_proto_rawDescGZIP() []byte {
|
||||
file_AbilityControlBlock_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityControlBlock_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityControlBlock_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityControlBlock_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityControlBlock_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityControlBlock_proto_goTypes = []interface{}{
|
||||
(*AbilityControlBlock)(nil), // 0: AbilityControlBlock
|
||||
(*AbilityEmbryo)(nil), // 1: AbilityEmbryo
|
||||
}
|
||||
var file_AbilityControlBlock_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityControlBlock.ability_embryo_list:type_name -> AbilityEmbryo
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityControlBlock_proto_init() }
|
||||
func file_AbilityControlBlock_proto_init() {
|
||||
if File_AbilityControlBlock_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityEmbryo_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityControlBlock_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityControlBlock); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityControlBlock_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityControlBlock_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityControlBlock_proto_depIdxs,
|
||||
MessageInfos: file_AbilityControlBlock_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityControlBlock_proto = out.File
|
||||
file_AbilityControlBlock_proto_rawDesc = nil
|
||||
file_AbilityControlBlock_proto_goTypes = nil
|
||||
file_AbilityControlBlock_proto_depIdxs = nil
|
||||
}
|
||||
25
gate-hk4e-api/proto/AbilityControlBlock.proto
Normal file
25
gate-hk4e-api/proto/AbilityControlBlock.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityEmbryo.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityControlBlock {
|
||||
repeated AbilityEmbryo ability_embryo_list = 1;
|
||||
}
|
||||
181
gate-hk4e-api/proto/AbilityEmbryo.pb.go
Normal file
181
gate-hk4e-api/proto/AbilityEmbryo.pb.go
Normal file
@@ -0,0 +1,181 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityEmbryo.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityEmbryo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AbilityId uint32 `protobuf:"varint,1,opt,name=ability_id,json=abilityId,proto3" json:"ability_id,omitempty"`
|
||||
AbilityNameHash uint32 `protobuf:"fixed32,2,opt,name=ability_name_hash,json=abilityNameHash,proto3" json:"ability_name_hash,omitempty"`
|
||||
AbilityOverrideNameHash uint32 `protobuf:"fixed32,3,opt,name=ability_override_name_hash,json=abilityOverrideNameHash,proto3" json:"ability_override_name_hash,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityEmbryo) Reset() {
|
||||
*x = AbilityEmbryo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityEmbryo_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityEmbryo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityEmbryo) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityEmbryo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityEmbryo_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityEmbryo.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityEmbryo) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityEmbryo_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityEmbryo) GetAbilityId() uint32 {
|
||||
if x != nil {
|
||||
return x.AbilityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityEmbryo) GetAbilityNameHash() uint32 {
|
||||
if x != nil {
|
||||
return x.AbilityNameHash
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityEmbryo) GetAbilityOverrideNameHash() uint32 {
|
||||
if x != nil {
|
||||
return x.AbilityOverrideNameHash
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityEmbryo_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityEmbryo_proto_rawDesc = []byte{
|
||||
0x0a, 0x13, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x45, 0x6d, 0x62, 0x72, 0x79, 0x6f, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0d, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x45, 0x6d, 0x62, 0x72, 0x79, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x61, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x07, 0x52, 0x0f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x61,
|
||||
0x73, 0x68, 0x12, 0x3b, 0x0a, 0x1a, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x76,
|
||||
0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x07, 0x52, 0x17, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4f,
|
||||
0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x73, 0x68, 0x42,
|
||||
0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityEmbryo_proto_rawDescOnce sync.Once
|
||||
file_AbilityEmbryo_proto_rawDescData = file_AbilityEmbryo_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityEmbryo_proto_rawDescGZIP() []byte {
|
||||
file_AbilityEmbryo_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityEmbryo_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityEmbryo_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityEmbryo_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityEmbryo_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityEmbryo_proto_goTypes = []interface{}{
|
||||
(*AbilityEmbryo)(nil), // 0: AbilityEmbryo
|
||||
}
|
||||
var file_AbilityEmbryo_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityEmbryo_proto_init() }
|
||||
func file_AbilityEmbryo_proto_init() {
|
||||
if File_AbilityEmbryo_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityEmbryo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityEmbryo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityEmbryo_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityEmbryo_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityEmbryo_proto_depIdxs,
|
||||
MessageInfos: file_AbilityEmbryo_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityEmbryo_proto = out.File
|
||||
file_AbilityEmbryo_proto_rawDesc = nil
|
||||
file_AbilityEmbryo_proto_goTypes = nil
|
||||
file_AbilityEmbryo_proto_depIdxs = nil
|
||||
}
|
||||
25
gate-hk4e-api/proto/AbilityEmbryo.proto
Normal file
25
gate-hk4e-api/proto/AbilityEmbryo.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityEmbryo {
|
||||
uint32 ability_id = 1;
|
||||
fixed32 ability_name_hash = 2;
|
||||
fixed32 ability_override_name_hash = 3;
|
||||
}
|
||||
158
gate-hk4e-api/proto/AbilityFloatValue.pb.go
Normal file
158
gate-hk4e-api/proto/AbilityFloatValue.pb.go
Normal file
@@ -0,0 +1,158 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityFloatValue.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityFloatValue struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityFloatValue) Reset() {
|
||||
*x = AbilityFloatValue{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityFloatValue_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityFloatValue) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityFloatValue) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityFloatValue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityFloatValue_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityFloatValue.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityFloatValue) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityFloatValue_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityFloatValue) GetValue() float32 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityFloatValue_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityFloatValue_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x11, 0x41, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityFloatValue_proto_rawDescOnce sync.Once
|
||||
file_AbilityFloatValue_proto_rawDescData = file_AbilityFloatValue_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityFloatValue_proto_rawDescGZIP() []byte {
|
||||
file_AbilityFloatValue_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityFloatValue_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityFloatValue_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityFloatValue_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityFloatValue_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityFloatValue_proto_goTypes = []interface{}{
|
||||
(*AbilityFloatValue)(nil), // 0: AbilityFloatValue
|
||||
}
|
||||
var file_AbilityFloatValue_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityFloatValue_proto_init() }
|
||||
func file_AbilityFloatValue_proto_init() {
|
||||
if File_AbilityFloatValue_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityFloatValue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityFloatValue); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityFloatValue_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityFloatValue_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityFloatValue_proto_depIdxs,
|
||||
MessageInfos: file_AbilityFloatValue_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityFloatValue_proto = out.File
|
||||
file_AbilityFloatValue_proto_rawDesc = nil
|
||||
file_AbilityFloatValue_proto_goTypes = nil
|
||||
file_AbilityFloatValue_proto_depIdxs = nil
|
||||
}
|
||||
23
gate-hk4e-api/proto/AbilityFloatValue.proto
Normal file
23
gate-hk4e-api/proto/AbilityFloatValue.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityFloatValue {
|
||||
float value = 1;
|
||||
}
|
||||
179
gate-hk4e-api/proto/AbilityGadgetInfo.pb.go
Normal file
179
gate-hk4e-api/proto/AbilityGadgetInfo.pb.go
Normal file
@@ -0,0 +1,179 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityGadgetInfo.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityGadgetInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CampId uint32 `protobuf:"varint,1,opt,name=camp_id,json=campId,proto3" json:"camp_id,omitempty"`
|
||||
CampTargetType uint32 `protobuf:"varint,2,opt,name=camp_target_type,json=campTargetType,proto3" json:"camp_target_type,omitempty"`
|
||||
TargetEntityId uint32 `protobuf:"varint,3,opt,name=target_entity_id,json=targetEntityId,proto3" json:"target_entity_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityGadgetInfo) Reset() {
|
||||
*x = AbilityGadgetInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityGadgetInfo_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityGadgetInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityGadgetInfo) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityGadgetInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityGadgetInfo_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityGadgetInfo.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityGadgetInfo) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityGadgetInfo_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityGadgetInfo) GetCampId() uint32 {
|
||||
if x != nil {
|
||||
return x.CampId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityGadgetInfo) GetCampTargetType() uint32 {
|
||||
if x != nil {
|
||||
return x.CampTargetType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityGadgetInfo) GetTargetEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.TargetEntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityGadgetInfo_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityGadgetInfo_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x61, 0x64, 0x67, 0x65, 0x74, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x11, 0x41, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x47, 0x61, 0x64, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12,
|
||||
0x17, 0x0a, 0x07, 0x63, 0x61, 0x6d, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x06, 0x63, 0x61, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70,
|
||||
0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79,
|
||||
0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x65, 0x6e, 0x74,
|
||||
0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x61,
|
||||
0x72, 0x67, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x42, 0x0a, 0x5a, 0x08,
|
||||
0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityGadgetInfo_proto_rawDescOnce sync.Once
|
||||
file_AbilityGadgetInfo_proto_rawDescData = file_AbilityGadgetInfo_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityGadgetInfo_proto_rawDescGZIP() []byte {
|
||||
file_AbilityGadgetInfo_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityGadgetInfo_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityGadgetInfo_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityGadgetInfo_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityGadgetInfo_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityGadgetInfo_proto_goTypes = []interface{}{
|
||||
(*AbilityGadgetInfo)(nil), // 0: AbilityGadgetInfo
|
||||
}
|
||||
var file_AbilityGadgetInfo_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityGadgetInfo_proto_init() }
|
||||
func file_AbilityGadgetInfo_proto_init() {
|
||||
if File_AbilityGadgetInfo_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityGadgetInfo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityGadgetInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityGadgetInfo_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityGadgetInfo_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityGadgetInfo_proto_depIdxs,
|
||||
MessageInfos: file_AbilityGadgetInfo_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityGadgetInfo_proto = out.File
|
||||
file_AbilityGadgetInfo_proto_rawDesc = nil
|
||||
file_AbilityGadgetInfo_proto_goTypes = nil
|
||||
file_AbilityGadgetInfo_proto_depIdxs = nil
|
||||
}
|
||||
25
gate-hk4e-api/proto/AbilityGadgetInfo.proto
Normal file
25
gate-hk4e-api/proto/AbilityGadgetInfo.proto
Normal file
@@ -0,0 +1,25 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityGadgetInfo {
|
||||
uint32 camp_id = 1;
|
||||
uint32 camp_target_type = 2;
|
||||
uint32 target_entity_id = 3;
|
||||
}
|
||||
214
gate-hk4e-api/proto/AbilityIdentifier.pb.go
Normal file
214
gate-hk4e-api/proto/AbilityIdentifier.pb.go
Normal file
@@ -0,0 +1,214 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityIdentifier.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type AbilityIdentifier struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ModifierOwnerId uint32 `protobuf:"varint,2,opt,name=modifier_owner_id,json=modifierOwnerId,proto3" json:"modifier_owner_id,omitempty"`
|
||||
InstancedModifierId uint32 `protobuf:"varint,9,opt,name=instanced_modifier_id,json=instancedModifierId,proto3" json:"instanced_modifier_id,omitempty"`
|
||||
InstancedAbilityId uint32 `protobuf:"varint,10,opt,name=instanced_ability_id,json=instancedAbilityId,proto3" json:"instanced_ability_id,omitempty"`
|
||||
IsServerbuffModifier bool `protobuf:"varint,6,opt,name=is_serverbuff_modifier,json=isServerbuffModifier,proto3" json:"is_serverbuff_modifier,omitempty"`
|
||||
AbilityCasterId uint32 `protobuf:"varint,15,opt,name=ability_caster_id,json=abilityCasterId,proto3" json:"ability_caster_id,omitempty"`
|
||||
LocalId int32 `protobuf:"varint,3,opt,name=local_id,json=localId,proto3" json:"local_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) Reset() {
|
||||
*x = AbilityIdentifier{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityIdentifier_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityIdentifier) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityIdentifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityIdentifier_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityIdentifier.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityIdentifier) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityIdentifier_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetModifierOwnerId() uint32 {
|
||||
if x != nil {
|
||||
return x.ModifierOwnerId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetInstancedModifierId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedModifierId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetInstancedAbilityId() uint32 {
|
||||
if x != nil {
|
||||
return x.InstancedAbilityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetIsServerbuffModifier() bool {
|
||||
if x != nil {
|
||||
return x.IsServerbuffModifier
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetAbilityCasterId() uint32 {
|
||||
if x != nil {
|
||||
return x.AbilityCasterId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityIdentifier) GetLocalId() int32 {
|
||||
if x != nil {
|
||||
return x.LocalId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_AbilityIdentifier_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityIdentifier_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,
|
||||
0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, 0x0a, 0x11, 0x41, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12,
|
||||
0x2a, 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x77, 0x6e, 0x65,
|
||||
0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69,
|
||||
0x66, 0x69, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x69,
|
||||
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65,
|
||||
0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12,
|
||||
0x30, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x61, 0x62, 0x69,
|
||||
0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x69,
|
||||
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49,
|
||||
0x64, 0x12, 0x34, 0x0a, 0x16, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x75,
|
||||
0x66, 0x66, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x14, 0x69, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x75, 0x66, 0x66, 0x4d,
|
||||
0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x5f, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x0f, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x61, 0x73, 0x74, 0x65,
|
||||
0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x42, 0x0a,
|
||||
0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityIdentifier_proto_rawDescOnce sync.Once
|
||||
file_AbilityIdentifier_proto_rawDescData = file_AbilityIdentifier_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityIdentifier_proto_rawDescGZIP() []byte {
|
||||
file_AbilityIdentifier_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityIdentifier_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityIdentifier_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityIdentifier_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityIdentifier_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityIdentifier_proto_goTypes = []interface{}{
|
||||
(*AbilityIdentifier)(nil), // 0: AbilityIdentifier
|
||||
}
|
||||
var file_AbilityIdentifier_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityIdentifier_proto_init() }
|
||||
func file_AbilityIdentifier_proto_init() {
|
||||
if File_AbilityIdentifier_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityIdentifier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityIdentifier); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityIdentifier_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityIdentifier_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityIdentifier_proto_depIdxs,
|
||||
MessageInfos: file_AbilityIdentifier_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityIdentifier_proto = out.File
|
||||
file_AbilityIdentifier_proto_rawDesc = nil
|
||||
file_AbilityIdentifier_proto_goTypes = nil
|
||||
file_AbilityIdentifier_proto_depIdxs = nil
|
||||
}
|
||||
28
gate-hk4e-api/proto/AbilityIdentifier.proto
Normal file
28
gate-hk4e-api/proto/AbilityIdentifier.proto
Normal file
@@ -0,0 +1,28 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
message AbilityIdentifier {
|
||||
uint32 modifier_owner_id = 2;
|
||||
uint32 instanced_modifier_id = 9;
|
||||
uint32 instanced_ability_id = 10;
|
||||
bool is_serverbuff_modifier = 6;
|
||||
uint32 ability_caster_id = 15;
|
||||
int32 local_id = 3;
|
||||
}
|
||||
188
gate-hk4e-api/proto/AbilityInvocationFailNotify.pb.go
Normal file
188
gate-hk4e-api/proto/AbilityInvocationFailNotify.pb.go
Normal file
@@ -0,0 +1,188 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityInvocationFailNotify.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// CmdId: 1107
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
type AbilityInvocationFailNotify struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Reason string `protobuf:"bytes,7,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
EntityId uint32 `protobuf:"varint,13,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
|
||||
Invoke *AbilityInvokeEntry `protobuf:"bytes,3,opt,name=invoke,proto3" json:"invoke,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) Reset() {
|
||||
*x = AbilityInvocationFailNotify{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityInvocationFailNotify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityInvocationFailNotify) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityInvocationFailNotify_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityInvocationFailNotify.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityInvocationFailNotify) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityInvocationFailNotify_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) GetEntityId() uint32 {
|
||||
if x != nil {
|
||||
return x.EntityId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFailNotify) GetInvoke() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityInvocationFailNotify_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityInvocationFailNotify_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f,
|
||||
0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7f, 0x0a,
|
||||
0x1b, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65,
|
||||
0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49,
|
||||
0x64, 0x12, 0x2b, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x6b,
|
||||
0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x42, 0x0a,
|
||||
0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityInvocationFailNotify_proto_rawDescOnce sync.Once
|
||||
file_AbilityInvocationFailNotify_proto_rawDescData = file_AbilityInvocationFailNotify_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityInvocationFailNotify_proto_rawDescGZIP() []byte {
|
||||
file_AbilityInvocationFailNotify_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityInvocationFailNotify_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityInvocationFailNotify_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityInvocationFailNotify_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityInvocationFailNotify_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityInvocationFailNotify_proto_goTypes = []interface{}{
|
||||
(*AbilityInvocationFailNotify)(nil), // 0: AbilityInvocationFailNotify
|
||||
(*AbilityInvokeEntry)(nil), // 1: AbilityInvokeEntry
|
||||
}
|
||||
var file_AbilityInvocationFailNotify_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityInvocationFailNotify.invoke:type_name -> AbilityInvokeEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityInvocationFailNotify_proto_init() }
|
||||
func file_AbilityInvocationFailNotify_proto_init() {
|
||||
if File_AbilityInvocationFailNotify_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityInvokeEntry_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityInvocationFailNotify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityInvocationFailNotify); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityInvocationFailNotify_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityInvocationFailNotify_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityInvocationFailNotify_proto_depIdxs,
|
||||
MessageInfos: file_AbilityInvocationFailNotify_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityInvocationFailNotify_proto = out.File
|
||||
file_AbilityInvocationFailNotify_proto_rawDesc = nil
|
||||
file_AbilityInvocationFailNotify_proto_goTypes = nil
|
||||
file_AbilityInvocationFailNotify_proto_depIdxs = nil
|
||||
}
|
||||
30
gate-hk4e-api/proto/AbilityInvocationFailNotify.proto
Normal file
30
gate-hk4e-api/proto/AbilityInvocationFailNotify.proto
Normal file
@@ -0,0 +1,30 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityInvokeEntry.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
// CmdId: 1107
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
message AbilityInvocationFailNotify {
|
||||
string reason = 7;
|
||||
uint32 entity_id = 13;
|
||||
AbilityInvokeEntry invoke = 3;
|
||||
}
|
||||
231
gate-hk4e-api/proto/AbilityInvocationFixedNotify.pb.go
Normal file
231
gate-hk4e-api/proto/AbilityInvocationFixedNotify.pb.go
Normal file
@@ -0,0 +1,231 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.7.0
|
||||
// source: AbilityInvocationFixedNotify.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// CmdId: 1172
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
// IsAllowClient: true
|
||||
type AbilityInvocationFixedNotify struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Invoke6Th *AbilityInvokeEntry `protobuf:"bytes,14,opt,name=invoke6th,proto3" json:"invoke6th,omitempty"`
|
||||
Invoke5Th *AbilityInvokeEntry `protobuf:"bytes,8,opt,name=invoke5th,proto3" json:"invoke5th,omitempty"`
|
||||
Invoke4Th *AbilityInvokeEntry `protobuf:"bytes,1,opt,name=invoke4th,proto3" json:"invoke4th,omitempty"`
|
||||
Invoke2Nd *AbilityInvokeEntry `protobuf:"bytes,5,opt,name=invoke2nd,proto3" json:"invoke2nd,omitempty"`
|
||||
Invoke1St *AbilityInvokeEntry `protobuf:"bytes,10,opt,name=invoke1st,proto3" json:"invoke1st,omitempty"`
|
||||
Invoke3Rd *AbilityInvokeEntry `protobuf:"bytes,12,opt,name=invoke3rd,proto3" json:"invoke3rd,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) Reset() {
|
||||
*x = AbilityInvocationFixedNotify{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_AbilityInvocationFixedNotify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AbilityInvocationFixedNotify) ProtoMessage() {}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_AbilityInvocationFixedNotify_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AbilityInvocationFixedNotify.ProtoReflect.Descriptor instead.
|
||||
func (*AbilityInvocationFixedNotify) Descriptor() ([]byte, []int) {
|
||||
return file_AbilityInvocationFixedNotify_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke6Th() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke6Th
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke5Th() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke5Th
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke4Th() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke4Th
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke2Nd() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke2Nd
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke1St() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke1St
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *AbilityInvocationFixedNotify) GetInvoke3Rd() *AbilityInvokeEntry {
|
||||
if x != nil {
|
||||
return x.Invoke3Rd
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_AbilityInvocationFixedNotify_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_AbilityInvocationFixedNotify_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76,
|
||||
0x6f, 0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0,
|
||||
0x02, 0x0a, 0x1c, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12,
|
||||
0x31, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x36, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f,
|
||||
0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x36,
|
||||
0x74, 0x68, 0x12, 0x31, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x35, 0x74, 0x68, 0x18,
|
||||
0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49,
|
||||
0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f,
|
||||
0x6b, 0x65, 0x35, 0x74, 0x68, 0x12, 0x31, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x34,
|
||||
0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69,
|
||||
0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x69,
|
||||
0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x34, 0x74, 0x68, 0x12, 0x31, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f,
|
||||
0x6b, 0x65, 0x32, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62,
|
||||
0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x32, 0x6e, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x69,
|
||||
0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x31, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13,
|
||||
0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x31, 0x73, 0x74, 0x12, 0x31,
|
||||
0x0a, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x33, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x13, 0x2e, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x6b,
|
||||
0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x33, 0x72,
|
||||
0x64, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_AbilityInvocationFixedNotify_proto_rawDescOnce sync.Once
|
||||
file_AbilityInvocationFixedNotify_proto_rawDescData = file_AbilityInvocationFixedNotify_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_AbilityInvocationFixedNotify_proto_rawDescGZIP() []byte {
|
||||
file_AbilityInvocationFixedNotify_proto_rawDescOnce.Do(func() {
|
||||
file_AbilityInvocationFixedNotify_proto_rawDescData = protoimpl.X.CompressGZIP(file_AbilityInvocationFixedNotify_proto_rawDescData)
|
||||
})
|
||||
return file_AbilityInvocationFixedNotify_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_AbilityInvocationFixedNotify_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_AbilityInvocationFixedNotify_proto_goTypes = []interface{}{
|
||||
(*AbilityInvocationFixedNotify)(nil), // 0: AbilityInvocationFixedNotify
|
||||
(*AbilityInvokeEntry)(nil), // 1: AbilityInvokeEntry
|
||||
}
|
||||
var file_AbilityInvocationFixedNotify_proto_depIdxs = []int32{
|
||||
1, // 0: AbilityInvocationFixedNotify.invoke6th:type_name -> AbilityInvokeEntry
|
||||
1, // 1: AbilityInvocationFixedNotify.invoke5th:type_name -> AbilityInvokeEntry
|
||||
1, // 2: AbilityInvocationFixedNotify.invoke4th:type_name -> AbilityInvokeEntry
|
||||
1, // 3: AbilityInvocationFixedNotify.invoke2nd:type_name -> AbilityInvokeEntry
|
||||
1, // 4: AbilityInvocationFixedNotify.invoke1st:type_name -> AbilityInvokeEntry
|
||||
1, // 5: AbilityInvocationFixedNotify.invoke3rd:type_name -> AbilityInvokeEntry
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_AbilityInvocationFixedNotify_proto_init() }
|
||||
func file_AbilityInvocationFixedNotify_proto_init() {
|
||||
if File_AbilityInvocationFixedNotify_proto != nil {
|
||||
return
|
||||
}
|
||||
file_AbilityInvokeEntry_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_AbilityInvocationFixedNotify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AbilityInvocationFixedNotify); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_AbilityInvocationFixedNotify_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_AbilityInvocationFixedNotify_proto_goTypes,
|
||||
DependencyIndexes: file_AbilityInvocationFixedNotify_proto_depIdxs,
|
||||
MessageInfos: file_AbilityInvocationFixedNotify_proto_msgTypes,
|
||||
}.Build()
|
||||
File_AbilityInvocationFixedNotify_proto = out.File
|
||||
file_AbilityInvocationFixedNotify_proto_rawDesc = nil
|
||||
file_AbilityInvocationFixedNotify_proto_goTypes = nil
|
||||
file_AbilityInvocationFixedNotify_proto_depIdxs = nil
|
||||
}
|
||||
34
gate-hk4e-api/proto/AbilityInvocationFixedNotify.proto
Normal file
34
gate-hk4e-api/proto/AbilityInvocationFixedNotify.proto
Normal file
@@ -0,0 +1,34 @@
|
||||
// Sorapointa - A server software re-implementation for a certain anime game, and avoid sorapointa.
|
||||
// Copyright (C) 2022 Sorapointa Team
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
import "AbilityInvokeEntry.proto";
|
||||
|
||||
option go_package = "./;proto";
|
||||
|
||||
// CmdId: 1172
|
||||
// EnetChannelId: 0
|
||||
// EnetIsReliable: true
|
||||
// IsAllowClient: true
|
||||
message AbilityInvocationFixedNotify {
|
||||
AbilityInvokeEntry invoke6th = 14;
|
||||
AbilityInvokeEntry invoke5th = 8;
|
||||
AbilityInvokeEntry invoke4th = 1;
|
||||
AbilityInvokeEntry invoke2nd = 5;
|
||||
AbilityInvokeEntry invoke1st = 10;
|
||||
AbilityInvokeEntry invoke3rd = 12;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user