Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8050f7a77d
BIN
bin/gateway
Executable file
BIN
bin/gateway
Executable file
Binary file not shown.
BIN
bin/mainte
Executable file
BIN
bin/mainte
Executable file
Binary file not shown.
0
bin/start.sh
Normal file → Executable file
0
bin/start.sh
Normal file → Executable file
0
bin/stop.sh
Normal file → Executable file
0
bin/stop.sh
Normal file → Executable file
15
bin/stup.sh
15
bin/stup.sh
@ -1,10 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
SERVICE=$2
|
SERVICE=$2
|
||||||
CMD="./$2 -conf $3"
|
CMD="./$3 -conf $4"
|
||||||
|
|
||||||
start(){
|
start(){
|
||||||
echo "starting..."
|
echo "starting $SERVICE..."
|
||||||
nohup $CMD > /dev/null 2>&1 &
|
|
||||||
|
num=`ps -ef | grep $SERVICE | grep -v grep | wc -l`
|
||||||
|
if [ $num -eq 0 ]
|
||||||
|
then
|
||||||
|
nohup $CMD > /dev/null 2>&1 &
|
||||||
# nohup $CMD >output.log 2>&1 &
|
# nohup $CMD >output.log 2>&1 &
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
@ -14,6 +18,11 @@
|
|||||||
echo $! > $SERVICE.pid
|
echo $! > $SERVICE.pid
|
||||||
echo "start success"
|
echo "start success"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "$SERVICE is already running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
stop(){
|
stop(){
|
||||||
echo "stopping..."
|
echo "stopping..."
|
||||||
|
BIN
bin/vsdebug_gateway
Executable file
BIN
bin/vsdebug_gateway
Executable file
Binary file not shown.
BIN
bin/vsdebug_mainte
Executable file
BIN
bin/vsdebug_mainte
Executable file
Binary file not shown.
BIN
bin/vsdebug_worker
Executable file
BIN
bin/vsdebug_worker
Executable file
Binary file not shown.
BIN
bin/worker
Executable file
BIN
bin/worker
Executable file
Binary file not shown.
@ -52,6 +52,7 @@ func ReadBigFloatForString(buf []byte) (ret *big.Float, n int, err error) {
|
|||||||
func ReadFloat32ForString(buf []byte) (ret float32, n int, err error) {
|
func ReadFloat32ForString(buf []byte) (ret float32, n int, err error) {
|
||||||
if buf[0] == '-' {
|
if buf[0] == '-' {
|
||||||
ret, n, err = readPositiveFloat32(buf[1:])
|
ret, n, err = readPositiveFloat32(buf[1:])
|
||||||
|
n++
|
||||||
ret = -ret
|
ret = -ret
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -60,6 +61,7 @@ func ReadFloat32ForString(buf []byte) (ret float32, n int, err error) {
|
|||||||
func ReadFloat64ForString(buf []byte) (ret float64, n int, err error) {
|
func ReadFloat64ForString(buf []byte) (ret float64, n int, err error) {
|
||||||
if buf[0] == '-' {
|
if buf[0] == '-' {
|
||||||
ret, n, err = readPositiveFloat64(buf[1:])
|
ret, n, err = readPositiveFloat64(buf[1:])
|
||||||
|
n++
|
||||||
ret = -ret
|
ret = -ret
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ func ReadInt8ForString(buf []byte) (ret int8, n int, err error) {
|
|||||||
c := buf[0]
|
c := buf[0]
|
||||||
if c == '-' {
|
if c == '-' {
|
||||||
val, n, err = ReadUint32ForString(buf[1:])
|
val, n, err = ReadUint32ForString(buf[1:])
|
||||||
|
n++
|
||||||
if val > math.MaxInt8+1 {
|
if val > math.MaxInt8+1 {
|
||||||
err = errors.New("ReadInt8ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
err = errors.New("ReadInt8ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
||||||
return
|
return
|
||||||
@ -64,6 +65,7 @@ func ReadInt16ForString(buf []byte) (ret int16, n int, err error) {
|
|||||||
c := buf[0]
|
c := buf[0]
|
||||||
if c == '-' {
|
if c == '-' {
|
||||||
val, n, err = ReadUint32ForString(buf[1:])
|
val, n, err = ReadUint32ForString(buf[1:])
|
||||||
|
n++
|
||||||
if val > math.MaxInt16+1 {
|
if val > math.MaxInt16+1 {
|
||||||
err = errors.New("ReadInt16ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
err = errors.New("ReadInt16ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
||||||
return
|
return
|
||||||
@ -87,6 +89,7 @@ func ReadInt32ForString(buf []byte) (ret int32, n int, err error) {
|
|||||||
c := buf[0]
|
c := buf[0]
|
||||||
if c == '-' {
|
if c == '-' {
|
||||||
val, n, err = ReadUint32ForString(buf[1:])
|
val, n, err = ReadUint32ForString(buf[1:])
|
||||||
|
n++
|
||||||
if val > math.MaxInt32+1 {
|
if val > math.MaxInt32+1 {
|
||||||
err = errors.New("ReadInt32ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
err = errors.New("ReadInt32ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
||||||
return
|
return
|
||||||
@ -110,6 +113,7 @@ func ReadInt64ForString(buf []byte) (ret int64, n int, err error) {
|
|||||||
c := buf[0]
|
c := buf[0]
|
||||||
if c == '-' {
|
if c == '-' {
|
||||||
val, n, err = ReadUint64ForString(buf[1:])
|
val, n, err = ReadUint64ForString(buf[1:])
|
||||||
|
n++
|
||||||
if val > math.MaxInt64+1 {
|
if val > math.MaxInt64+1 {
|
||||||
err = errors.New("ReadInt64ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
err = errors.New("ReadInt64ForString overflow: " + strconv.FormatInt(int64(val), 10))
|
||||||
return
|
return
|
||||||
@ -154,6 +158,7 @@ func ReadUint16ForString(buf []byte) (ret uint16, n int, err error) {
|
|||||||
|
|
||||||
func ReadUint32ForString(buf []byte) (ret uint32, n int, err error) {
|
func ReadUint32ForString(buf []byte) (ret uint32, n int, err error) {
|
||||||
ind := intDigits[buf[0]]
|
ind := intDigits[buf[0]]
|
||||||
|
n = 1
|
||||||
if ind == 0 {
|
if ind == 0 {
|
||||||
err = assertInteger(buf[1:])
|
err = assertInteger(buf[1:])
|
||||||
return
|
return
|
||||||
@ -163,7 +168,6 @@ func ReadUint32ForString(buf []byte) (ret uint32, n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
ret = uint32(ind)
|
ret = uint32(ind)
|
||||||
n = 1
|
|
||||||
if len(buf) > 10 {
|
if len(buf) > 10 {
|
||||||
i := 1
|
i := 1
|
||||||
ind2 := intDigits[buf[i]]
|
ind2 := intDigits[buf[i]]
|
||||||
@ -252,6 +256,7 @@ func ReadUint32ForString(buf []byte) (ret uint32, n int, err error) {
|
|||||||
|
|
||||||
func ReadUint64ForString(buf []byte) (ret uint64, n int, err error) {
|
func ReadUint64ForString(buf []byte) (ret uint64, n int, err error) {
|
||||||
ind := intDigits[buf[0]]
|
ind := intDigits[buf[0]]
|
||||||
|
n = 1
|
||||||
if ind == 0 {
|
if ind == 0 {
|
||||||
err = assertInteger(buf[1:])
|
err = assertInteger(buf[1:])
|
||||||
return
|
return
|
||||||
@ -261,7 +266,6 @@ func ReadUint64ForString(buf []byte) (ret uint64, n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
ret = uint64(ind)
|
ret = uint64(ind)
|
||||||
n = 1
|
|
||||||
if len(buf) > 10 {
|
if len(buf) > 10 {
|
||||||
i := 0
|
i := 0
|
||||||
ind2 := intDigits[buf[i]]
|
ind2 := intDigits[buf[i]]
|
||||||
|
@ -96,6 +96,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
} else {
|
} else {
|
||||||
subsit = false //辅套装没有
|
subsit = false //辅套装没有
|
||||||
}
|
}
|
||||||
|
hero.EquipID[i] = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,6 +120,6 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "equip", &pb.EquipmentEquipResp{Equipments: equipments})
|
session.SendMsg(string(this.module.GetType()), "equip", &pb.EquipmentEquipResp{Equipments: updatequipment})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,8 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
|||||||
)
|
)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), FriendSubTypeApply, req, Resp)
|
|
||||||
|
// utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), FriendSubTypeApply, req, Resp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
@ -3,7 +3,6 @@ package hero
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -23,7 +22,6 @@ func (this *apiComp) Chouka(session comm.IUserSession, req *pb.HeroChoukaReq) (c
|
|||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), HeroSubTypeChouka, req, rsp)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
heroCfgIds := req.HeroIds
|
heroCfgIds := req.HeroIds
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -29,7 +28,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.HeroInfoReq) (code
|
|||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), HeroSubTypeInfo, req, rsp)
|
// utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), HeroSubTypeInfo, req, rsp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
hero := this.module.modelHero.getOneHero(session.GetUserId(), req.HeroId)
|
hero := this.module.modelHero.getOneHero(session.GetUserId(), req.HeroId)
|
||||||
|
@ -3,7 +3,6 @@ package hero
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -21,7 +20,7 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.HeroListReq) (code
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), HeroSubTypeList, req, rsp)
|
// utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), HeroSubTypeList, req, rsp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
rsp.List = this.module.GetHeroList(session.GetUserId())
|
rsp.List = this.module.GetHeroList(session.GetUserId())
|
||||||
|
@ -30,6 +30,8 @@ func (this *modelShopComp) Init(service core.IService, module core.IModule, comp
|
|||||||
//查询用户装备数据
|
//查询用户装备数据
|
||||||
func (this *modelShopComp) QueryUserShopData(uId string) (data *pb.DBShop, err error) {
|
func (this *modelShopComp) QueryUserShopData(uId string) (data *pb.DBShop, err error) {
|
||||||
data = &pb.DBShop{}
|
data = &pb.DBShop{}
|
||||||
err = this.Get(uId, data)
|
if err = this.Get(uId, data); err != nil {
|
||||||
|
this.module.Errorf("err:%v", err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package task
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -28,7 +27,7 @@ func (this *apiComp) ActiveList(session comm.IUserSession, req *pb.TaskActiveLis
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeActiveList, req, resp)
|
// utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeActiveList, req, resp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
resp.Active = this.moduleTask.modelTask.countActive(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
resp.Active = this.moduleTask.modelTask.countActive(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
||||||
|
@ -3,7 +3,6 @@ package task
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -29,7 +28,7 @@ func (this *apiComp) ActiveReceive(session comm.IUserSession, req *pb.TaskActive
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeActiveReceive, req, resp)
|
// utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeActiveReceive, req, resp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
ua := this.moduleTask.modelTaskActive.getUserActive(session.GetUserId(), req.Id, comm.TaskTag(req.TaskTag))
|
ua := this.moduleTask.modelTaskActive.getUserActive(session.GetUserId(), req.Id, comm.TaskTag(req.TaskTag))
|
||||||
|
@ -3,7 +3,6 @@ package task
|
|||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -26,7 +25,7 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.TaskListReq) (code
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeList, req, rsp)
|
// utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeList, req, rsp)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
rsp.List = this.moduleTask.modelTask.getTaskList(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
rsp.List = this.moduleTask.modelTask.getTaskList(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@ -28,7 +27,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeReceive, req, resp)
|
// utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeReceive, req, resp)
|
||||||
}()
|
}()
|
||||||
userTask := this.moduleTask.modelTask.getUserTask(session.GetUserId(), req.Id)
|
userTask := this.moduleTask.modelTask.getUserTask(session.GetUserId(), req.Id)
|
||||||
if userTask != nil {
|
if userTask != nil {
|
||||||
|
@ -18,9 +18,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//打印函数处理信息
|
//打印函数处理信息
|
||||||
func TraceFunc(uid string, module string, funcName string, funcArgs interface{}, rsp interface{}) {
|
// func TraceFunc(uid string, module string, funcName string, funcArgs interface{}, rsp interface{}) {
|
||||||
log.Debugf("traceFunc uid:%s module:%s funcName:%s funcArgs:%v", uid, module, funcName, funcArgs)
|
// log.Debugf("traceFunc uid:%s module:%s funcName:%s funcArgs:%v", uid, module, funcName, funcArgs)
|
||||||
}
|
// }
|
||||||
|
|
||||||
//打印函数处理时间
|
//打印函数处理时间
|
||||||
func TraceTimeCost(funcName string, invocation time.Time) {
|
func TraceTimeCost(funcName string, invocation time.Time) {
|
||||||
|
Loading…
Reference in New Issue
Block a user