Skip to content

Commit

Permalink
代码包修改成GitHub地址
Browse files Browse the repository at this point in the history
代码包修改成GitHub地址,b站有卖课的不标注代码出处
  • Loading branch information
dummyuser committed Sep 17, 2022
1 parent dc44af5 commit b90702c
Show file tree
Hide file tree
Showing 85 changed files with 500 additions and 463 deletions.
1 change: 1 addition & 0 deletions .idea/slgserver.iml

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

6 changes: 3 additions & 3 deletions db/conn.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

package db

import (
"database/sql"
"errors"
"fmt"
_ "github.com/go-sql-driver/mysql"
"os"
"slgserver/config"

_ "github.com/go-sql-driver/mysql"
"github.com/llr104/slgserver/config"
"xorm.io/xorm"
"xorm.io/xorm/log"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module slgserver
module github.com/llr104/slgserver

go 1.14

Expand Down
12 changes: 0 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBK
github.com/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8 h1:1TrMV1HmBApBbM+Hy7RCKZD6UlYWYIPPfoeXomG7+zE=
github.com/Unknwon/goconfig v0.0.0-20200908083735-df7de6a44db8/go.mod h1:wngxua9XCNjvHjDiTiV26DaKDT+0c63QR6H5hjVUUxw=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
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/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzqk8QCaRC4os14xoKDdbHqqlJtJA0oc1ZAjg=
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
Expand All @@ -22,9 +20,7 @@ github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gG
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goinggo/mapstructure v0.0.0-20140717182941-194205d9b4a9 h1:wqckanyE9qc/XnvnybC6SHOb8Nyd62QXAZOzA8twFig=
github.com/goinggo/mapstructure v0.0.0-20140717182941-194205d9b4a9/go.mod h1:64ikIrMv84B+raz7akXOqbF7cK3/OQQ/6cClY10oy7A=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand All @@ -49,7 +45,6 @@ github.com/labstack/echo/v4 v4.1.17 h1:PQIBaRplyRy3OjwILGkPg89JRtH2x5bssi59G2EL3
github.com/labstack/echo/v4 v4.1.17/go.mod h1:Tn2yRQL/UclUalpb5rPdXDevbkJ+lp/2svdyFBg6CHQ=
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY=
github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
Expand All @@ -76,7 +71,6 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
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/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -87,7 +81,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand All @@ -112,11 +105,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -126,11 +117,9 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8=
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -142,7 +131,6 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
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/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
9 changes: 5 additions & 4 deletions log/log.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package log

import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"path/filepath"
"slgserver/config"
"strings"

"github.com/llr104/slgserver/config"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
)

var DefaultLog *zap.Logger
Expand Down
7 changes: 4 additions & 3 deletions main/chatserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package main
import (
"fmt"
"os"
"slgserver/config"
"slgserver/net"
"slgserver/server/chatserver"

"github.com/llr104/slgserver/config"
"github.com/llr104/slgserver/net"
"github.com/llr104/slgserver/server/chatserver"
)

func getChatServerAddr() string {
Expand Down
9 changes: 5 additions & 4 deletions main/gateserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"fmt"
"os"
"slgserver/config"
"slgserver/net"
"slgserver/server/gateserver"
"slgserver/server/gateserver/controller"

"github.com/llr104/slgserver/config"
"github.com/llr104/slgserver/net"
"github.com/llr104/slgserver/server/gateserver"
"github.com/llr104/slgserver/server/gateserver/controller"
)

func getGateServerAddr() string {
Expand Down
9 changes: 5 additions & 4 deletions main/httpserver.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
"log"

"github.com/labstack/echo/v4"
mw "github.com/labstack/echo/v4/middleware"
"log"
"slgserver/config"
"slgserver/db"
"slgserver/server/httpserver/controller"
"github.com/llr104/slgserver/config"
"github.com/llr104/slgserver/db"
"github.com/llr104/slgserver/server/httpserver/controller"
)

func main() {
Expand Down
7 changes: 4 additions & 3 deletions main/loginserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package main
import (
"fmt"
"os"
"slgserver/config"
"slgserver/net"
"slgserver/server/loginserver"

"github.com/llr104/slgserver/config"
"github.com/llr104/slgserver/net"
"github.com/llr104/slgserver/server/loginserver"
)

func getLoginServerAddr() string {
Expand Down
7 changes: 4 additions & 3 deletions main/slgserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package main
import (
"fmt"
"os"
"slgserver/config"
"slgserver/net"
"slgserver/server/slgserver/run"

"github.com/llr104/slgserver/config"
"github.com/llr104/slgserver/net"
"github.com/llr104/slgserver/server/slgserver/run"
)


Expand Down
9 changes: 5 additions & 4 deletions main/wstest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package main

import (
"fmt"
"time"

"github.com/forgoer/openssl"
"github.com/goinggo/mapstructure"
"github.com/gorilla/websocket"
"slgserver/net"
proto2 "slgserver/server/loginserver/proto"
"slgserver/util"
"time"
"github.com/llr104/slgserver/net"
proto2 "github.com/llr104/slgserver/server/loginserver/proto"
"github.com/llr104/slgserver/util"
)

var origin = "httpserver://127.0.0.1:8002/"
Expand Down
6 changes: 3 additions & 3 deletions middleware/check_login.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package middleware

import (
"github.com/llr104/slgserver/constant"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/net"
"go.uber.org/zap"
"slgserver/constant"
"slgserver/log"
"slgserver/net"
)

func CheckLogin() net.MiddlewareFunc {
Expand Down
6 changes: 3 additions & 3 deletions middleware/check_rid.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package middleware

import (
"github.com/llr104/slgserver/constant"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/net"
"go.uber.org/zap"
"slgserver/constant"
"slgserver/log"
"slgserver/net"
)

func CheckRId() net.MiddlewareFunc {
Expand Down
6 changes: 3 additions & 3 deletions middleware/check_role.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package middleware

import (
"github.com/llr104/slgserver/constant"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/net"
"go.uber.org/zap"
"slgserver/constant"
"slgserver/log"
"slgserver/net"
)

func CheckRole() net.MiddlewareFunc {
Expand Down
7 changes: 4 additions & 3 deletions middleware/elapsed_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package middleware

import (
"fmt"
"go.uber.org/zap"
"slgserver/log"
"slgserver/net"
"time"

"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/net"
"go.uber.org/zap"
)

func ElapsedTime() net.MiddlewareFunc {
Expand Down
5 changes: 3 additions & 2 deletions middleware/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package middleware

import (
"fmt"

"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/net"
"go.uber.org/zap"
"slgserver/log"
"slgserver/net"
)

func Log() net.MiddlewareFunc {
Expand Down
11 changes: 6 additions & 5 deletions net/clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"context"
"errors"
"fmt"
"sync"
"time"

"github.com/forgoer/openssl"
"github.com/goinggo/mapstructure"
"github.com/gorilla/websocket"
"github.com/llr104/slgserver/constant"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/util"
"go.uber.org/zap"
"slgserver/constant"
"slgserver/log"
"slgserver/util"
"sync"
"time"
)

// 客户端连接
Expand Down
9 changes: 5 additions & 4 deletions net/connMgr.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package net

import (
"sync"

"github.com/gorilla/websocket"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/server/slgserver/conn"
"github.com/llr104/slgserver/server/slgserver/pos"
"go.uber.org/zap"
"slgserver/log"
"slgserver/server/slgserver/conn"
"slgserver/server/slgserver/pos"
"sync"
)

var ConnMgr = Mgr{}
Expand Down
5 changes: 3 additions & 2 deletions net/router.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package net

import (
"go.uber.org/zap"
"slgserver/log"
"strings"

"github.com/llr104/slgserver/log"
"go.uber.org/zap"
)

type HandlerFunc func(req *WsMsgReq, rsp *WsMsgRsp)
Expand Down
5 changes: 3 additions & 2 deletions net/server.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package net

import (
"net/http"

"github.com/gorilla/websocket"
"github.com/llr104/slgserver/log"
"go.uber.org/zap"
"net/http"
"slgserver/log"
)

// http升级websocket协议的配置
Expand Down
11 changes: 5 additions & 6 deletions net/serverconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ package net
import (
"errors"
"fmt"
"sync"
"time"

"github.com/forgoer/openssl"
"github.com/goinggo/mapstructure"
"github.com/gorilla/websocket"
"github.com/llr104/slgserver/log"
"github.com/llr104/slgserver/util"
"go.uber.org/zap"
"slgserver/log"
"slgserver/util"
"sync"
"time"
)



// 客户端连接
type ServerConn struct {
wsSocket *websocket.Conn // 底层websocket
Expand Down
Loading

0 comments on commit b90702c

Please sign in to comment.