上传编辑器模块代码
This commit is contained in:
parent
f3327b05ad
commit
33f54010b0
@ -17,6 +17,8 @@ import (
|
|||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
"go_dreamfactory/sys/db"
|
"go_dreamfactory/sys/db"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -97,7 +99,27 @@ func Test_Comment(t *testing.T) {
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
defer connect.Close()
|
|
||||||
|
go func() {
|
||||||
|
var (
|
||||||
|
data []byte
|
||||||
|
msg *pb.BattleRpcMessage = &pb.BattleRpcMessage{}
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
locp:
|
||||||
|
for {
|
||||||
|
if _, data, err = connect.ReadMessage(); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
break locp
|
||||||
|
}
|
||||||
|
if err = proto.Unmarshal(data, msg); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
break locp
|
||||||
|
}
|
||||||
|
fmt.Println(msg)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
msg := &pb.BattleRpcMessage{
|
msg := &pb.BattleRpcMessage{
|
||||||
Rid: 1,
|
Rid: 1,
|
||||||
Method: "test",
|
Method: "test",
|
||||||
@ -105,5 +127,18 @@ func Test_Comment(t *testing.T) {
|
|||||||
msg.Data, _ = anypb.New(&pb.BattleTestMessage{})
|
msg.Data, _ = anypb.New(&pb.BattleTestMessage{})
|
||||||
data, _ := proto.Marshal(msg)
|
data, _ := proto.Marshal(msg)
|
||||||
connect.WriteMessage(websocket.BinaryMessage, data)
|
connect.WriteMessage(websocket.BinaryMessage, data)
|
||||||
|
//监听外部关闭服务信号
|
||||||
|
c := make(chan os.Signal, 1)
|
||||||
|
//添加进程结束信号
|
||||||
|
signal.Notify(c,
|
||||||
|
os.Interrupt, //退出信号 ctrl+c退出
|
||||||
|
syscall.SIGHUP, //终端控制进程结束(终端连接断开)
|
||||||
|
syscall.SIGINT, //用户发送INTR字符(Ctrl+C)触发
|
||||||
|
syscall.SIGTERM, //结束程序(可以被捕获、阻塞或忽略)
|
||||||
|
syscall.SIGQUIT) //用户发送QUIT字符(Ctrl+/)触发
|
||||||
|
select {
|
||||||
|
case sig := <-c:
|
||||||
|
fmt.Printf("signal = %v\n", sig)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ func (this *apiComp) ChallengeReceive(session comm.IUserSession, req *pb.CombatC
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.module.DispenseRes(session, manster.Award, true)
|
this.module.DispenseRes(session, manster.Award, true)
|
||||||
|
pass = true
|
||||||
for _, v := range level.Passdroplist {
|
for _, v := range level.Passdroplist {
|
||||||
ispass := false
|
ispass := false
|
||||||
for _, v1 := range info.Passdrop {
|
for _, v1 := range info.Passdrop {
|
||||||
|
Loading…
Reference in New Issue
Block a user