Skip to content

Commit

Permalink
v4
Browse files Browse the repository at this point in the history
大改本版,有问题及时反馈
  • Loading branch information
qtgolang committed Dec 19, 2024
1 parent ffd6f4c commit 87b7aa9
Show file tree
Hide file tree
Showing 16,539 changed files with 3,255,382 additions and 29,172 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion Api/CertificateManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package Api

import "C"
import (
"github.com/qtgolang/SunnyNet/public"
"github.com/qtgolang/SunnyNet/src/Certificate"
"github.com/qtgolang/SunnyNet/src/public"
)

// CreateCertificate 创建 证书管理器 对象
Expand Down Expand Up @@ -115,6 +115,17 @@ func AddClientAuth(Context, val int) bool {
return c.AddClientAuth(val)
}

// SetCipherSuites 证书管理器 设置CipherSuites
func SetCipherSuites(Context int, val string) bool {
Certificate.Lock.Lock()
defer Certificate.Lock.Unlock()
c := Certificate.LoadCertificateContext(Context)
if c == nil {
return false
}
return c.SetCipherSuites(val)
}

// CreateCA 证书管理器 创建证书
func CreateCA(Context int, Country, Organization, OrganizationalUnit, Province, CommonName, Locality string, bits, NotAfter int) bool {
Certificate.Lock.Lock()
Expand Down
3 changes: 2 additions & 1 deletion Api/Compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package Api

import "C"
import (
"github.com/qtgolang/SunnyNet/public"
"github.com/qtgolang/SunnyNet/src/Compress"
"github.com/qtgolang/SunnyNet/src/public"
)

// DeflateCompress Deflate压缩 (可能等同于zlib压缩)
Expand Down Expand Up @@ -110,6 +110,7 @@ func GzipUnCompress(data uintptr, dataLen int) uintptr {
if len(bin) < 1 {
return 0
}

b := Compress.GzipUnCompress(bin)
if len(b) < 1 {
return 0
Expand Down
44 changes: 3 additions & 41 deletions Api/OtherApi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,22 @@ package Api
import (
"bytes"
"encoding/binary"
"github.com/qtgolang/SunnyNet/Call"
"github.com/qtgolang/SunnyNet/public"
"github.com/qtgolang/SunnyNet/src/encoding/hex"
"github.com/qtgolang/SunnyNet/src/public"
"strings"
)

//HexDump
/* 字节数组转字符串 返回格式如下
00000000 53 75 6E 6E 79 4E 65 74 54 65 73 74 45 78 61 6D |SunnyNetTestExam|
00000010 70 6C 65 |ple|
*/

func HexDump(data uintptr, dataLen int) uintptr {
bin := public.CStringToBytes(data, dataLen)
hexStr := strings.ReplaceAll(hex.Dump(bin), "\n", "\r\n")
return public.PointerPtr(hexStr)
}

//BytesToInt 将Go int的Bytes 转为int
// BytesToInt 将Go int的Bytes 转为int
func BytesToInt(data uintptr, dataLen int) int {
bys := public.CStringToBytes(data, dataLen)
buff := bytes.NewBuffer(bys)
var B int64
_ = binary.Read(buff, binary.BigEndian, &B)
return int(B)
}

//GoCall 适配火山PC CALL 火山直接CALL X64没有问题,X86环境下有问题,所以搞了这个命令
func GoCall(address, a1, a2, a3, a4, a5, a6, a7, a8, a9 int) int {
if a1 == -1 {
return Call.Call(address)
}
if a2 == -1 {
return Call.Call(address, a1)
}
if a3 == -1 {
return Call.Call(address, a1, a2)
}
if a4 == -1 {
return Call.Call(address, a1, a2, a3)
}
if a5 == -1 {
return Call.Call(address, a1, a2, a3, a4)
}
if a6 == -1 {
return Call.Call(address, a1, a2, a3, a4, a5)
}
if a7 == -1 {
return Call.Call(address, a1, a2, a3, a4, a5, a6)
}
if a8 == -1 {
return Call.Call(address, a1, a2, a3, a4, a5, a6, a7)
}
if a9 == -1 {
return Call.Call(address, a1, a2, a3, a4, a5, a6, a7, a8)
}
return Call.Call(address, a1, a2, a3, a4, a5, a6, a7, a8, a9)
}
73 changes: 0 additions & 73 deletions Api/OtherCommands.go

This file was deleted.

2 changes: 1 addition & 1 deletion Api/Queue.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Api

import (
"github.com/qtgolang/SunnyNet/public"
"github.com/qtgolang/SunnyNet/src/public"
"sync"
)

Expand Down
4 changes: 2 additions & 2 deletions Api/Redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/qtgolang/SunnyNet/Call"
"github.com/qtgolang/SunnyNet/public"
"github.com/qtgolang/SunnyNet/src/Call"
redis "github.com/qtgolang/SunnyNet/src/Redis"
"github.com/qtgolang/SunnyNet/src/public"
"strings"
"sync"
)
Expand Down
20 changes: 0 additions & 20 deletions Api/Script.go

This file was deleted.

Loading

0 comments on commit 87b7aa9

Please sign in to comment.