增加登录奖励,活跃奖励

This commit is contained in:
sk 2025-06-21 16:17:24 +08:00
parent 5e2c3acafc
commit 5a5135270e
25 changed files with 979 additions and 518 deletions

11
go.mod
View File

@ -5,7 +5,6 @@ go 1.24
require ( require (
github.com/json-iterator/go v1.1.12 github.com/json-iterator/go v1.1.12
github.com/oylshe1314/framework v1.0.21 github.com/oylshe1314/framework v1.0.21
github.com/xuri/excelize/v2 v2.9.1
go.mongodb.org/mongo-driver v1.17.4 go.mongodb.org/mongo-driver v1.17.4
golang.org/x/crypto v0.39.0 golang.org/x/crypto v0.39.0
google.golang.org/protobuf v1.36.6 google.golang.org/protobuf v1.36.6
@ -19,31 +18,23 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-zookeeper/zk v1.0.4 // indirect github.com/go-zookeeper/zk v1.0.4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/compress v1.16.7 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
github.com/lestrrat-go/strftime v1.1.0 // indirect github.com/lestrrat-go/strftime v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect github.com/montanaflynn/stats v0.7.1 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.13.7 // indirect
github.com/redis/go-redis/v9 v9.7.0 // indirect github.com/redis/go-redis/v9 v9.7.0 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.4 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tiendc/go-deepcopy v1.6.0 // indirect github.com/stretchr/testify v1.10.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xuri/efp v0.0.1 // indirect
github.com/xuri/nfp v0.0.1 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sync v0.15.0 // indirect golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect golang.org/x/text v0.26.0 // indirect

43
go.sum
View File

@ -15,8 +15,6 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I= github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I=
github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@ -32,8 +30,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
@ -48,41 +44,23 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.7 h1:uv+I3nNJvlKZIQGSr8JVQLNHFU9YhhNpvC14Y6KgmSM=
github.com/pkg/sftp v1.13.7/go.mod h1:KMKI0t3T6hfA+lTR/ssZdunHo+uwq7ghoN09/FSu3DY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00=
github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tiendc/go-deepcopy v1.6.0 h1:0UtfV/imoCwlLxVsyfUd4hNHnB3drXsfle+wzSCA5Wo=
github.com/tiendc/go-deepcopy v1.6.0/go.mod h1:toXoeQoUqXOOS/X4sKuiAoSk6elIdqc0pN7MTgOOo2I=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8=
github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.9.1 h1:VdSGk+rraGmgLHGFaGG9/9IWu1nj4ufjJ7uwMDtj8Qw=
github.com/xuri/excelize/v2 v2.9.1/go.mod h1:x7L6pKz2dvo9ejrRuD8Lnl98z4JLt0TGAwjhW+EiP8s=
github.com/xuri/nfp v0.0.1 h1:MDamSGatIvp8uOmDP8FnmjuQpu90NzdJxo7242ANR9Q=
github.com/xuri/nfp v0.0.1/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
@ -90,23 +68,14 @@ go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFX
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -115,31 +84,19 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=

View File

@ -249,6 +249,12 @@ enum MoneyType {
// //
Prestige = 24; Prestige = 24;
//
DailyActive = 101;
//
WeeklyActive = 102;
} }
enum HeroType { enum HeroType {
@ -357,6 +363,70 @@ enum MailStatus {
Deleted = 3; Deleted = 3;
} }
enum TaskType {
//线
TaskMain = 0;
//线
TaskMainChapter = 1;
//
TaskDaily = 2;
//
TaskWeekly = 3;
//
TaskPass = 4;
}
enum TaskArgs {
TaskConditionNone = 0;
// ID2ID3
TaskArgsId = 1;
//23
TaskArgsType = 2;
// 3
TaskSignIn = 3;
//(3)
TaskHeroBook = 4;
//23
TaskHeroLevel = 5;
//23
TaskHeroBreak = 6;
//23
TaskEquipLevel = 7;
//23
TaskEquipRefine = 8;
//23
TaskTreasureLevel = 9;
//23
TaskTreasureRefine = 10;
//23
TaskCopyChapter = 11;
//23
TaskCopyLevel = 12;
}
enum DaysModule {
NaturalDays = 0;
PeriodDays = 1;
}
enum AttrType { enum AttrType {
AttrTypeNone = 0; // AttrTypeNone = 0; //
Attack = 1; // Attack = 1; //

View File

@ -0,0 +1,75 @@
syntax = "proto3";
package Pb;
option go_package = "pb/";
import "enums.proto";
import "mod_item.proto";
// ModId.ModuleReward: 12000
//
// ,
message RewardStatus {
uint32 Id = 2;
AbleStatus Status = 3; //AbleStatus
}
message RewardActive {
MoneyType MoneyType = 1; //
uint32 ActiveValue = 2;
repeated RewardStatus StatusList = 3;
}
// ModId.ModRewardActiveList = 12001;
//
message RewardActiveListAck {
repeated RewardActive ActiveList = 1;
}
// ModId.ModRewardActiveChange = 12002;
//
message RewardActiveChangeAck {
RewardActive RewardActive = 1;
}
// ModId.ModRewardActiveReceive = 12003;
//
message RewardActiveReceiveReq {
uint32 Id = 1;
}
// ModId.ModRewardActiveReceive = 12003;
//
message RewardActiveReceiveAck {
repeated Item ItemList = 1;
}
message RewardLogin {
uint32 SeriesId = 1;
uint32 LoginDays = 2;
repeated RewardStatus StatusList = 3;
}
// ModId.ModRewardLoginList = 12011;
//
message RewardLoginListAck {
repeated RewardLogin LoginList = 1;
}
// ModId.ModRewardLoginChange = 12012;
//
message RewardLoginChangeAck {
RewardLogin RewardLogin = 1;
}
// ModId.ModRewardLoginReceive = 12013;
//
message RewardLoginReceiveReq {
uint32 Id = 1;
}
// ModId.ModRewardLoginReceive = 12013;
//
message RewardLoginReceiveAck {
repeated Item ItemList = 1;
}

46
proto/idl/mod_task.proto Normal file
View File

@ -0,0 +1,46 @@
syntax = "proto3";
package Pb;
option go_package = "pb/";
import "enums.proto";
import "mod_item.proto";
// ModId.ModuleTask = 9000;
//
// ,
message Task {
uint32 Id = 1; //IDID
AbleStatus Status = 3;//0.()1.()2.()
repeated uint32 Process = 2; //
}
//MsgId.ModTaskList = 9001;
//
message MsgTaskListAck {
repeated Task TaskList = 1;
}
message TaskChange {
ChangeType ChangeType = 1;
Task task = 2;
}
//MsgId.ModTaskChange = 9002;
//
message TaskChangeListAck {
repeated TaskChange ChangeList = 1;
}
//MsgId.ModTaskCommit = 9003;
//
message TaskCommitReq {
uint32 Id = 1; //IDID
}
//MsgId.ModTaskCommit = 9003;
//
message TaskCommitAck {
uint32 Id = 1; //IDID
repeated Item ItemList = 2; //
}

View File

@ -42,8 +42,8 @@ enum ModId{
// //
ModuleStore = 110000; ModuleStore = 110000;
// //
ModuleActivity = 12000; ModuleReward = 12000;
} }
// ID // ID
@ -276,4 +276,34 @@ enum MsgId {
// //
ModMailDeleteAll = 8008; ModMailDeleteAll = 8008;
//-------------------------------------------------------------------------- --------------------------------------------------------------------------
//
ModTaskList = 9001;
//
ModTaskChange = 9002;
//
ModTaskCommit = 9003;
//-------------------------------------------------------------------------- --------------------------------------------------------------------------
//
//
ModRewardActiveList = 12001;
//
ModRewardActiveChange = 12002;
//
ModRewardActiveReceive = 12003;
//
ModRewardLoginList = 12011;
//
ModRewardLoginChange = 12012;
//
ModRewardLoginReceive = 12013;
} }

View File

@ -0,0 +1,49 @@
package data
import json "github.com/json-iterator/go"
type RewardActive struct {
Id int `json:"id"`
MoneyType int `json:"money_type"`
ActiveValue int `json:"active_value"`
ItemIds []int `json:"item_ids"`
ItemNums []int `json:"item_nums"`
}
type RewardActiveTable struct {
l []*RewardActive
m1 map[int]*RewardActive
m2 map[int][]*RewardActive
}
func (this *RewardActiveTable) load(buf []byte) error {
var err = json.Unmarshal(buf, &this.l)
if err != nil {
return err
}
this.m1 = make(map[int]*RewardActive)
this.m2 = make(map[int][]*RewardActive)
for i := range this.l {
this.m1[this.l[i].Id] = this.l[i]
this.m2[this.l[i].MoneyType] = append(this.m2[this.l[i].Id], this.l[i])
}
return nil
}
func (this *RewardActiveTable) List() []*RewardActive {
return this.l
}
//func (this *RewardActiveTable) Get(i int) *RewardActive {
// return this.l[i]
//}
func (this *RewardActiveTable) Find1(id int) *RewardActive {
return this.m1[id]
}
func (this *RewardActiveTable) Find2(montyType int) []*RewardActive {
return this.m2[montyType]
}

View File

@ -0,0 +1,69 @@
package data
import (
json "github.com/json-iterator/go"
"github.com/oylshe1314/framework/util"
"time"
)
type RewardDaily struct {
Id int `json:"id"`
SeriesId int `json:"series_id"`
BeginTime string `json:"begin_time"`
BeginTimeRaw int64 `json:"-"`
EndTime string `json:"end_time"`
EndTimeRaw int64 `json:"-"`
ItemIds []int `json:"item_ids"`
ItemNums []int `json:"item_nums"`
AllowNums int `json:"allow_nums"`
}
type RewardDailyTable struct {
l []*RewardDaily
m1 map[int]*RewardDaily
m2 map[int][]*RewardDaily
}
func (this *RewardDailyTable) load(buf []byte) error {
var err = json.Unmarshal(buf, &this.l)
if err != nil {
return err
}
this.m1 = make(map[int]*RewardDaily)
this.m2 = make(map[int][]*RewardDaily)
for i := range this.l {
if this.l[i].BeginTime != "" {
this.l[i].BeginTimeRaw, err = util.ParseUnix(time.TimeOnly, this.l[i].BeginTime)
if err != nil {
return err
}
}
if this.l[i].EndTime != "" {
this.l[i].EndTimeRaw, err = util.ParseUnix(time.TimeOnly, this.l[i].EndTime)
if err != nil {
return err
}
}
this.m1[this.l[i].Id] = this.l[i]
this.m2[this.l[i].SeriesId] = append(this.m2[this.l[i].Id], this.l[i])
}
return nil
}
func (this *RewardDailyTable) List() []*RewardDaily {
return this.l
}
//func (this *RewardDailyTable) Get(i int) *RewardDaily {
// return this.l[i]
//}
func (this *RewardDailyTable) Find1(id int) *RewardDaily {
return this.m1[id]
}
func (this *RewardDailyTable) Find2(seriesId int) []*RewardDaily {
return this.m2[seriesId]
}

View File

@ -0,0 +1,69 @@
package data
import (
json "github.com/json-iterator/go"
"github.com/oylshe1314/framework/util"
)
type RewardLogin struct {
Id int `json:"id"`
SeriesId int `json:"series_id"`
Days int `json:"days"`
DaysModule int `json:"days_module"`
ItemIds []interface{} `json:"item_ids"`
ItemNums []interface{} `json:"item_nums"`
VipLevel int `json:"vip_level"`
VipMultiple int `json:"vip_multiple"`
}
type RewardLoginTable struct {
l []*RewardLogin
m1 map[int]*RewardLogin
m2 map[int][]*RewardLogin
m3 map[int]int
}
func (this *RewardLoginTable) load(buf []byte) error {
var err = json.Unmarshal(buf, &this.l)
if err != nil {
return err
}
this.m1 = make(map[int]*RewardLogin)
this.m2 = make(map[int][]*RewardLogin)
this.m3 = make(map[int]int)
for i := range this.l {
this.m1[this.l[i].Id] = this.l[i]
this.m2[this.l[i].SeriesId] = append(this.m2[this.l[i].Id], this.l[i])
if this.l[i].Days > this.m3[this.l[i].SeriesId] {
this.m3[this.l[i].SeriesId] = this.l[i].Days
}
}
return nil
}
func (this *RewardLoginTable) List() []*RewardLogin {
return this.l
}
//func (this *RewardLoginTable) Get(i int) *RewardLogin {
// return this.l[i]
//}
func (this *RewardLoginTable) Find1(id int) *RewardLogin {
return this.m1[id]
}
func (this *RewardLoginTable) Find2(seriesId int) []*RewardLogin {
return this.m2[seriesId]
}
func (this *RewardLoginTable) SeriesIds() []int {
return util.MapKeys(this.m3)
}
func (this *RewardLoginTable) MaxDays(seriesId int) (days int, ok bool) {
days, ok = this.m3[seriesId]
return
}

View File

@ -33,10 +33,14 @@ type Tables struct {
FunctionOpen FunctionOpenTable FunctionOpen FunctionOpenTable
Item ItemTable Item ItemTable
Monster MonsterTable Monster MonsterTable
RewardActive RewardActiveTable
RewardDaily RewardDailyTable
RewardLogin RewardLoginTable
Scene SceneTable Scene SceneTable
ServerConfig ServerConfigTable ServerConfig ServerConfigTable
Skill SkillTable Skill SkillTable
SkillBuff SkillBuffTable SkillBuff SkillBuffTable
Task TaskTable
Treasure TreasureTable Treasure TreasureTable
TreasureLevel TreasureLevelTable TreasureLevel TreasureLevelTable
TreasureRefine TreasureRefineTable TreasureRefine TreasureRefineTable

56
servers/game/data/task.go Normal file
View File

@ -0,0 +1,56 @@
package data
import json "github.com/json-iterator/go"
type Task struct {
Id int `json:"id"`
Type int `json:"type"`
RearId int `json:"rear_id"`
Sort int `json:"sort"`
ActiveValue int `json:"active_value"`
ExpMultiple int `json:"exp_multiple"`
CoinMultiple int `json:"coin_multiple"`
ItemIds []int `json:"item_ids"`
ItemNums []int `json:"item_nums"`
TaskArgs1 []int `json:"task_args1"`
TaskArgs2 []int `json:"task_args2"`
TaskArgs3 []int `json:"task_args3"`
}
type TaskTable struct {
l []*Task
m1 map[int]*Task
m2 map[int][]*Task
}
func (this *TaskTable) load(buf []byte) error {
var err = json.Unmarshal(buf, &this.l)
if err != nil {
return err
}
this.m1 = make(map[int]*Task)
this.m2 = make(map[int][]*Task)
for i := range this.l {
this.m1[this.l[i].Id] = this.l[i]
this.m2[this.l[i].Type] = append(this.m2[this.l[i].Id], this.l[i])
}
return nil
}
func (this *TaskTable) List() []*Task {
return this.l
}
//func (this *TaskTable) Get(i int) *Task {
// return this.l[i]
//}
func (this *TaskTable) Find1(id int) *Task {
return this.m1[id]
}
func (this *TaskTable) Find2(tipe int) []*Task {
return this.m2[tipe]
}

View File

@ -1,6 +1,8 @@
package logic package logic
import "github.com/oylshe1314/framework/util" import (
"github.com/oylshe1314/framework/util"
)
const GameDailyResetHour int64 = 0 const GameDailyResetHour int64 = 0
const GameDailyResetTime int64 = 3600 * GameDailyResetHour const GameDailyResetTime int64 = 3600 * GameDailyResetHour
@ -27,6 +29,8 @@ func NewGameTime(timestamp int64) *GameTime {
return gt return gt
} }
util.Unix()
gt.Days, gt.Weeks, gt.Months, gt.Years = absDate(gt.Timestamp) gt.Days, gt.Weeks, gt.Months, gt.Years = absDate(gt.Timestamp)
return gt return gt
} }

View File

@ -252,19 +252,11 @@ func (this *PlayerManager) NewPlayer() *Player {
//MonthlyCard: map[uint32]*PlayerMonthlyCard{}, //MonthlyCard: map[uint32]*PlayerMonthlyCard{},
//Planet: map[uint32]*PlayerPlanet{}, //Planet: map[uint32]*PlayerPlanet{},
//RawStone: map[uint32]*PlayerRawStone{}, //RawStone: map[uint32]*PlayerRawStone{},
//RigCharacter: map[uint32]*PlayerRigCharacter{}, RewardActive: map[uint32]*PlayerRewardActive{},
//RigComponent: map[uint32]*PlayerRigComponent{}, RewardLogin: map[uint32]*PlayerRewardLogin{},
//RigCore: map[uint32]*PlayerRigCore{},
//RigEquip: map[uint32]*PlayerRigEquip{},
//RigPendant: map[uint32]*PlayerRigPendant{},
//RigRemains: map[uint32]*PlayerRigRemains{},
//RigSmelter: map[uint32]*PlayerRigSmelter{},
//RigTrammels: map[uint32]*PlayerRigTrammels{},
//RigWarship: map[uint32]*PlayerRigWarship{},
//RoleTalent: map[uint32]*PlayerRoleTalent{}, //RoleTalent: map[uint32]*PlayerRoleTalent{},
//StorePool: map[uint32]*PlayerStorePool{}, //StorePool: map[uint32]*PlayerStorePool{},
//Task: map[uint32]*PlayerTask{}, Task: map[uint32]*PlayerTask{},
//TaskActive: map[uint32]*PlayerTaskActive{},
Treasure: map[uint64]*PlayerTreasure{}, Treasure: map[uint64]*PlayerTreasure{},
} }
} }

View File

@ -79,19 +79,11 @@ type Player struct {
//MonthlyCard map[uint32]*PlayerMonthlyCard `bson:"monthly_card"` //MonthlyCard map[uint32]*PlayerMonthlyCard `bson:"monthly_card"`
//Planet map[uint32]*PlayerPlanet `bson:"planet"` //Planet map[uint32]*PlayerPlanet `bson:"planet"`
//RawStone map[uint32]*PlayerRawStone `bson:"raw_stone"` //RawStone map[uint32]*PlayerRawStone `bson:"raw_stone"`
//RigCharacter map[uint32]*PlayerRigCharacter `bson:"rig_character"` RewardActive map[uint32]*PlayerRewardActive `bson:"reward_active"`
//RigComponent map[uint32]*PlayerRigComponent `bson:"rig_component"` RewardLogin map[uint32]*PlayerRewardLogin `bson:"reward_login"`
//RigCore map[uint32]*PlayerRigCore `bson:"rig_core"`
//RigEquip map[uint32]*PlayerRigEquip `bson:"rig_equip"`
//RigPendant map[uint32]*PlayerRigPendant `bson:"rig_pendant"`
//RigRemains map[uint32]*PlayerRigRemains `bson:"rig_remains"`
//RigSmelter map[uint32]*PlayerRigSmelter `bson:"rig_smelter"`
//RigTrammels map[uint32]*PlayerRigTrammels `bson:"rig_trammels"`
//RigWarship map[uint32]*PlayerRigWarship `bson:"rig_warship"`
//RoleTalent map[uint32]*PlayerRoleTalent `bson:"role_talent"` //RoleTalent map[uint32]*PlayerRoleTalent `bson:"role_talent"`
//StorePool map[uint32]*PlayerStorePool `bson:"store_pool"` //StorePool map[uint32]*PlayerStorePool `bson:"store_pool"`
//Task map[uint32]*PlayerTask `bson:"task"` Task map[uint32]*PlayerTask `bson:"task"`
//TaskActive map[uint32]*PlayerTaskActive `bson:"task_active"`
Treasure map[uint64]*PlayerTreasure `bson:"treasure"` Treasure map[uint64]*PlayerTreasure `bson:"treasure"`
//Temporary //Temporary

View File

@ -96,42 +96,14 @@ func (this *Player) checkCorrectModules(cur *GameTime) {
// this.RawStone = make(map[uint32]*PlayerRawStone) // this.RawStone = make(map[uint32]*PlayerRawStone)
// this.SaveField("raw_stone", this.RawStone) // this.SaveField("raw_stone", this.RawStone)
//} //}
//if this.RigCharacter == nil { if this.RewardActive == nil {
// this.RigCharacter = make(map[uint32]*PlayerRigCharacter) this.RewardActive = make(map[uint32]*PlayerRewardActive)
// this.SaveField("rig_character", this.RigCharacter) this.SaveField("reward_active", this.RewardActive)
//} }
//if this.RigComponent == nil { if this.RewardLogin == nil {
// this.RigComponent = make(map[uint32]*PlayerRigComponent) this.RewardLogin = make(map[uint32]*PlayerRewardLogin)
// this.SaveField("rig_component", this.RigComponent) this.SaveField("reward_active", this.RewardLogin)
//} }
//if this.RigCore == nil {
// this.RigCore = make(map[uint32]*PlayerRigCore)
// this.SaveField("rig_core", this.RigCore)
//}
//if this.RigEquip == nil {
// this.RigEquip = make(map[uint32]*PlayerRigEquip)
// this.SaveField("rig_equip", this.RigEquip)
//}
//if this.RigPendant == nil {
// this.RigPendant = make(map[uint32]*PlayerRigPendant)
// this.SaveField("rig_pendant", this.RigPendant)
//}
//if this.RigRemains == nil {
// this.RigRemains = make(map[uint32]*PlayerRigRemains)
// this.SaveField("rig_remains", this.RigRemains)
//}
//if this.RigSmelter == nil {
// this.RigSmelter = make(map[uint32]*PlayerRigSmelter)
// this.SaveField("rig_smelter", this.RigSmelter)
//}
//if this.RigTrammels == nil {
// this.RigTrammels = make(map[uint32]*PlayerRigTrammels)
// this.SaveField("rig_trammels", this.RigTrammels)
//}
//if this.RigWarship == nil {
// this.RigWarship = make(map[uint32]*PlayerRigWarship)
// this.SaveField("rig_warship", this.RigWarship)
//}
//if this.RoleTalent == nil { //if this.RoleTalent == nil {
// this.RoleTalent = make(map[uint32]*PlayerRoleTalent) // this.RoleTalent = make(map[uint32]*PlayerRoleTalent)
// this.SaveField("role_talent", this.RoleTalent) // this.SaveField("role_talent", this.RoleTalent)
@ -144,10 +116,6 @@ func (this *Player) checkCorrectModules(cur *GameTime) {
// this.Task = make(map[uint32]*PlayerTask) // this.Task = make(map[uint32]*PlayerTask)
// this.SaveField("task", this.Task) // this.SaveField("task", this.Task)
//} //}
//if this.TaskActive == nil {
// this.TaskActive = make(map[uint32]*PlayerTaskActive)
// this.SaveField("task_active", this.TaskActive)
//}
if this.Treasure == nil { if this.Treasure == nil {
this.Treasure = make(map[uint64]*PlayerTreasure) this.Treasure = make(map[uint64]*PlayerTreasure)
this.SaveField("achievement", this.Treasure) this.SaveField("achievement", this.Treasure)

View File

@ -47,7 +47,7 @@ func (this *Player) checkRefresh(login bool, pre, cur *GameTime) {
this.checkPerSecond(login, pre, cur) this.checkPerSecond(login, pre, cur)
if this.checkAcrossTime(login, pre, cur, if this.checkAcrossTime(login, pre, cur,
this.checkLoginDays, this.checkLoginDays,
//this.checkTaskRefresh, this.checkTaskRefresh,
//this.checkMonthlyCard, //this.checkMonthlyCard,
//this.checkIdleBattle, //this.checkIdleBattle,
//this.checkCopyRefresh, //this.checkCopyRefresh,
@ -71,29 +71,29 @@ func (this *Player) checkLoginDays(login bool, pre, cur *GameTime) bool {
this.ChangeProperty(util.NewPair(pb.RolePropertyType_LoginDays, int64(this.LoginDays+1))) this.ChangeProperty(util.NewPair(pb.RolePropertyType_LoginDays, int64(this.LoginDays+1)))
//this.checkLoginReward() //this.CheckRewardLogin()
//this.CheckTask(proto.TaskSection1LoginDays, 0, 1) //this.CheckTask(proto.TaskSection1LoginDays, 0, 1)
//this.CheckAchievement(proto.AchievementTypeLoginDays, 0, 1) //this.CheckAchievement(proto.AchievementTypeLoginDays, 0, 1)
return true return true
} }
//func (this *Player) checkTaskRefresh(login bool, pre, cur *GameTime) (changed bool) { func (this *Player) checkTaskRefresh(login bool, pre, cur *GameTime) (changed bool) {
// if login { if login {
// changed = this.checkTaskDeprecated() || changed changed = this.checkTaskDeprecated()
// } }
//
// if pre.Days != cur.Days { if pre.Days != cur.Days {
// changed = this.ActivationReset() || changed changed = this.MoneyActiveValueReset(pb.MoneyType_DailyActive) || changed
// changed = this.checkTaskReset(proto.TaskTypeDaily) || changed changed = this.checkTaskReset(pb.TaskType_TaskDaily) || changed
// } }
//
// if pre.Weeks != cur.Weeks { if pre.Weeks != cur.Weeks {
// changed = this.checkTaskReset(proto.TaskTypeWeekly) || changed changed = this.checkTaskReset(pb.TaskType_TaskWeekly) || changed
// } }
//
// return changed return changed
//} }
//func (this *Player) checkMonthlyCard(login bool, pre, cur *GameTime) (changed bool) { //func (this *Player) checkMonthlyCard(login bool, pre, cur *GameTime) (changed bool) {
// if cur.Days == pre.Days { // if cur.Days == pre.Days {

View File

@ -1,51 +0,0 @@
package logic
//type PlayerLoginReward struct {
// StatusList []uint32 `bson:"status_list"`
//}
//
//func (this *Player) checkLoginReward() (changed bool) {
// var days = this.manager.tables.LoginRewardExtend.Days()
// if days == 0 {
// return false
// }
//
// if this.LoginReward == nil || len(this.LoginReward.StatusList) != days {
// this.LoginReward = &PlayerLoginReward{StatusList: make([]uint32, days)}
// this.LoginReward.StatusList[0] = uint32(proto.RewardStatusCanGet)
// this.SaveField("login_reward", this.LoginReward)
//
// _ = this.Send(proto.ModIdActivity, proto.MsgIdLoginRewardInfo, this.BuildMsgLoginRewardInfoAck())
// return true
// } else {
// var index = int(this.Role.LoginDays-1) % days
// if index == 0 {
// for i := range this.LoginReward.StatusList {
// this.LoginReward.StatusList[i] = uint32(proto.RewardStatusUnable)
// }
//
// this.LoginReward.StatusList[0] = uint32(proto.RewardStatusCanGet)
// this.SaveField("login_reward.status_list", this.LoginReward.StatusList)
//
// _ = this.Send(proto.ModIdActivity, proto.MsgIdLoginRewardInfo, this.BuildMsgLoginRewardInfoAck())
// return true
// } else {
// if proto.RewardStatus(this.LoginReward.StatusList[index]) == proto.RewardStatusUnable {
// this.LoginReward.StatusList[index] = uint32(proto.RewardStatusCanGet)
// this.SaveArray("login_reward.status_list", index, this.LoginReward.StatusList[index])
//
// _ = this.Send(proto.ModIdActivity, proto.MsgIdLoginRewardInfo, this.BuildMsgLoginRewardInfoAck())
// return true
// }
// }
// }
// return false
//}
//
//func (this *Player) BuildMsgLoginRewardInfoAck() *proto.MsgLoginRewardInfoAck {
// if this.LoginReward == nil {
// return &proto.MsgLoginRewardInfoAck{}
// } else {
// return &proto.MsgLoginRewardInfoAck{LoginDays: this.Role.LoginDays, StatusList: this.LoginReward.StatusList}
// }
//}

View File

@ -24,12 +24,22 @@ func (this *Player) GetMoney(moneyType pb.MoneyType) *PlayerMoney {
return money return money
} }
func (this *Player) GetMoneyValue(moneyType pb.MoneyType) uint32 {
var money = this.Money[uint32(moneyType)]
if money == nil {
return 0
}
return money.Value
}
func (this *Player) AddMoney(moneyType pb.MoneyType, value uint32, logType LogType) bool { func (this *Player) AddMoney(moneyType pb.MoneyType, value uint32, logType LogType) bool {
switch moneyType { switch moneyType {
case pb.MoneyType_Exp: case pb.MoneyType_Exp:
this.addExp(value, logType) this.addExp(value, logType)
case pb.MoneyType_Power: case pb.MoneyType_Power:
this.addPower(value, logType) this.addPower(value, logType)
case pb.MoneyType_DailyActive:
this.addActiveValue(moneyType, value, logType)
default: default:
this.addMoney(moneyType, value, logType) this.addMoney(moneyType, value, logType)
} }
@ -187,50 +197,33 @@ func (this *Player) reducePower(value uint32, logType LogType) {
//} //}
} }
//func (this *Player) updateActiveReward(moneyActivation *PlayerMoney) { func (this *Player) addActiveValue(moneyType pb.MoneyType, value uint32, logType LogType) {
// for _, active := range this.TaskActive { var money = this.GetMoney(pb.MoneyType_Power)
// if proto.RewardStatus(active.Status) == proto.RewardStatusUnable { money.Value += value
// var activeTable = this.manager.tables.Active.Get(int(active.Id)) this.SaveModel(money)
// if activeTable == nil {
// this.WipeModel(active) _ = this.Send(pb.ModId_ModuleRole, pb.MsgId_ModRoleMoneyChange, &pb.MoneyListAck{MoneyList: []*pb.Money{money.BuildMsgMoney()}})
// delete(this.TaskActive, active.Id)
// } else { this.checkRewardActive(money)
// if moneyActivation.Value >= uint32(activeTable.ActiveValue) { }
// active.Status = uint32(proto.RewardStatusCanGet)
// this.SaveModel(active) func (this *Player) MoneyActiveValueReset(moneyType pb.MoneyType) bool {
// } var money = this.GetMoney(moneyType)
// } if money.Value == 0 {
// } return false
// } }
//}
// money.Value = 0
//func (this *Player) resetActiveReward() { this.SaveModel(money)
// var activeTables = this.manager.tables.Active.List()
// _ = this.Send(pb.ModId_ModuleRole, pb.MsgId_ModRoleMoneyChange, &pb.MoneyListAck{MoneyList: []*pb.Money{money.BuildMsgMoney()}})
// this.TaskActive = map[uint32]*PlayerTaskActive{}
// for _, activeTable := range activeTables { var rewardActive = this.newRewardActive(money)
// var active = &PlayerTaskActive{Id: uint32(activeTable.Id), Status: uint32(proto.RewardStatusUnable)}
// this.TaskActive[active.Id] = active _ = this.Send(pb.ModId_ModuleReward, pb.MsgId_ModRewardActiveChange, &pb.RewardActiveChangeAck{RewardActive: rewardActive.BuildMsgRewardActive()})
// }
//} return true
// }
//func (this *Player) ActivationReset() bool {
// var money = this.GetMoney(proto.MoneyTypeActivation)
// if money.Value == 0 {
// return false
// }
//
// money.Value = 0
// this.SaveModel(money)
//
// _ = this.Send(proto.ModIdRole, proto.MsgIdRoleMoneyChange, &proto.MsgRoleMoneyListAck{List: []*proto.RoleMoney{money.BuildMsgMoney()}})
//
// this.resetActiveReward()
//
// _ = this.Send(proto.ModIdTask, proto.MsgIdActiveInfo, this.BuildMsgActiveInfoAck())
//
// return true
//}
func (this *Player) BuildMsgMoneyListAck() *pb.MoneyListAck { func (this *Player) BuildMsgMoneyListAck() *pb.MoneyListAck {
var list []*pb.Money var list []*pb.Money

View File

@ -0,0 +1,76 @@
package logic
import (
"ecs/proto/pb"
"github.com/oylshe1314/framework/util"
)
type PlayerRewardActive struct {
MoneyType uint32 `bson:"money_type" key:"1"`
RewardStatus [][2]uint32 `bson:"reward_status"`
}
func (this *PlayerRewardActive) BuildMsgRewardActive() *pb.RewardActive {
var msg = &pb.RewardActive{MoneyType: pb.MoneyType(this.MoneyType)}
for _, status := range this.RewardStatus {
msg.StatusList = append(msg.StatusList, &pb.RewardStatus{Id: status[0], Status: pb.AbleStatus(status[1])})
}
return msg
}
func (this *Player) checkRewardActive(money *PlayerMoney) bool {
var changed = false
var rewardActive = this.RewardActive[money.Type]
if rewardActive == nil {
rewardActive = this.newRewardActive(money)
if rewardActive == nil {
return false
}
this.RewardActive[rewardActive.MoneyType] = rewardActive
changed = true
} else {
for i := range rewardActive.RewardStatus {
if pb.AbleStatus(rewardActive.RewardStatus[i][1]) == pb.AbleStatus_Unable {
var activeTable = this.manager.tables.RewardActive.Find1(int(rewardActive.RewardStatus[i][0]))
if activeTable != nil {
if money.Value >= uint32(activeTable.ActiveValue) {
rewardActive.RewardStatus[i][1] = uint32(pb.AbleStatus_Able)
changed = true
}
}
}
}
}
if changed {
this.SaveModel(rewardActive)
_ = this.Send(pb.ModId_ModuleReward, pb.MsgId_ModRewardActiveChange, &pb.RewardActiveChangeAck{RewardActive: rewardActive.BuildMsgRewardActive()})
}
return changed
}
func (this *Player) newRewardActive(money *PlayerMoney) *PlayerRewardActive {
var rewardTables = this.manager.tables.RewardActive.Find2(int(money.Type))
if len(rewardTables) == 0 {
return nil
}
var rewardActive = &PlayerRewardActive{MoneyType: money.Type, RewardStatus: make([][2]uint32, len(rewardTables))}
for i, rewardTable := range rewardTables {
rewardActive.RewardStatus[i] = [2]uint32{
uint32(rewardTable.Id),
util.If(money.Value >= uint32(rewardTable.ActiveValue), uint32(pb.AbleStatus_Able), uint32(pb.AbleStatus_Unable)),
}
}
return rewardActive
}
func (this *Player) BuildMsgRewardActiveListAck() *pb.RewardActiveListAck {
var activeList []*pb.RewardActive
for _, rewardStatus := range this.RewardActive {
activeList = append(activeList, rewardStatus.BuildMsgRewardActive())
}
return &pb.RewardActiveListAck{ActiveList: activeList}
}

View File

@ -0,0 +1,122 @@
package logic
import (
"ecs/proto/pb"
"github.com/oylshe1314/framework/util"
)
type PlayerRewardLogin struct {
SeriesId uint32 `bson:"series_id" key:"1"`
RewardStatus [][2]uint32 `bson:"reward_status"`
}
func (this *PlayerRewardLogin) BuildMsgRewardLogin() *pb.RewardLogin {
var msg = &pb.RewardLogin{SeriesId: this.SeriesId}
for _, status := range this.RewardStatus {
msg.StatusList = append(msg.StatusList, &pb.RewardStatus{Id: status[0], Status: pb.AbleStatus(status[1])})
}
return msg
}
func (this *Player) CheckRewardLogin() bool {
var changed = false
for _, seriesId := range this.manager.tables.RewardLogin.SeriesIds() {
changed = this.checkRewardLogin(uint32(seriesId)) || changed
}
return changed
}
func (this *Player) checkRewardLogin(seriesId uint32) bool {
var changed = false
var rewardLogin = this.RewardLogin[seriesId]
if rewardLogin == nil {
rewardLogin = this.newRewardLogin(seriesId)
if rewardLogin == nil {
return false
}
this.RewardLogin[rewardLogin.SeriesId] = rewardLogin
changed = true
} else {
var rewardTables = this.manager.tables.RewardLogin.Find2(int(seriesId))
if len(rewardTables) == 0 {
return false
}
_, _, days := util.YMD()
if pb.DaysModule(rewardTables[0].DaysModule) == pb.DaysModule_PeriodDays {
maxDays, ok := this.manager.tables.RewardLogin.MaxDays(int(seriesId))
if !ok {
maxDays = len(rewardTables)
}
days = int(this.LoginDays-1)%maxDays + 1
}
if len(rewardLogin.RewardStatus) != len(rewardTables) {
var newRewardStatus = make([][2]uint32, len(rewardTables))
for i := range rewardLogin.RewardStatus {
if i >= len(newRewardStatus) {
break
}
if rewardLogin.RewardStatus[i][0] == newRewardStatus[i][0] &&
pb.AbleStatus(rewardLogin.RewardStatus[i][1]) == pb.AbleStatus_Able {
newRewardStatus[i][1] = uint32(pb.AbleStatus_Able)
}
}
rewardLogin.RewardStatus = newRewardStatus
changed = true
}
for i := range rewardLogin.RewardStatus {
if pb.AbleStatus(rewardLogin.RewardStatus[i][1]) == pb.AbleStatus_Unable {
var activeTable = this.manager.tables.RewardLogin.Find1(int(rewardLogin.RewardStatus[i][0]))
if activeTable != nil {
if days >= activeTable.Days {
rewardLogin.RewardStatus[i][1] = uint32(pb.AbleStatus_Able)
changed = true
}
}
}
}
}
if changed {
this.SaveModel(rewardLogin)
_ = this.Send(pb.ModId_ModuleReward, pb.MsgId_ModRewardLoginChange, &pb.RewardLoginChangeAck{RewardLogin: rewardLogin.BuildMsgRewardLogin()})
}
return changed
}
func (this *Player) newRewardLogin(seriesId uint32) *PlayerRewardLogin {
var rewardTables = this.manager.tables.RewardLogin.Find2(int(seriesId))
if len(rewardTables) == 0 {
return nil
}
_, _, days := util.YMD()
if pb.DaysModule(rewardTables[0].DaysModule) == pb.DaysModule_PeriodDays {
maxDays, ok := this.manager.tables.RewardLogin.MaxDays(int(seriesId))
if !ok {
maxDays = len(rewardTables)
}
days = int(this.LoginDays-1)%maxDays + 1
}
var rewardLogin = &PlayerRewardLogin{SeriesId: seriesId, RewardStatus: make([][2]uint32, len(rewardTables))}
for i, rewardTable := range rewardTables {
rewardLogin.RewardStatus[i] = [2]uint32{
uint32(rewardTable.Id),
util.If(days < rewardTable.Days, uint32(pb.AbleStatus_Unable), uint32(pb.AbleStatus_Able)),
}
}
return rewardLogin
}
func (this *Player) BuildMsgRewardLoginListAck() *pb.RewardLoginListAck {
var activeList []*pb.RewardLogin
for _, rewardStatus := range this.RewardLogin {
activeList = append(activeList, rewardStatus.BuildMsgRewardLogin())
}
return &pb.RewardLoginListAck{LoginList: activeList}
}

View File

@ -1,271 +1,238 @@
package logic package logic
//type PlayerTask struct { import (
// Id uint32 `bson:"id" key:"1"` "ecs/proto/pb"
// Process []int `bson:"process"` //进度 "ecs/servers/game/data"
// Okay []bool `bson:"nice"` //点赞 )
// Status uint32 `bson:"status"` //任务状态0.未完成1.已完成2.已提交(已领取)
//} type PlayerTask struct {
// Id uint32 `bson:"id" key:"1"`
//func (this *PlayerTask) BuildMsgTask() *proto.Task { Status uint32 `bson:"status"` //任务状态见pb.AbleStatus - 0.不可提交(未完成)1.可提交(已完成)2.已提交(奖励已领取)
// return &proto.Task{Id: this.Id, Process: this.Process, Status: this.Status} Okayed []bool `bson:"okayed"` //点赞
//} Process []uint32 `bson:"process"` //进度
// }
//func (this *Player) checkTaskCompetedAhead(task *PlayerTask, taskTable *data.Task) {
// if proto.TaskType(taskTable.TaskType) != proto.TaskTypeMainline { func (this *PlayerTask) BuildMsgTask() *pb.Task {
// return return &pb.Task{Id: this.Id, Process: this.Process, Status: pb.AbleStatus(this.Status)}
// } }
//
// var changed = false func (this *Player) checkTaskCompetedAhead(task *PlayerTask, taskTable *data.Task) {
// var completed = true if pb.TaskType(taskTable.Type) != pb.TaskType_TaskMain && pb.TaskType(taskTable.Type) != pb.TaskType_TaskMainChapter {
// for i := range taskTable.Section1 { return
// switch proto.TaskSection1(taskTable.Section1[i]) { }
// case proto.TaskSection1PassSpecificScene:
// if len(taskTable.Section2) > 0 && taskTable.Section2[i] > 0 { var changed = false
// changed = this.processTask(task, taskTable, i, int(this.GetCopyPassedNum(uint32(taskTable.Section2[i])))) || changed var completed = true
// } for i := range taskTable.TaskArgs1 {
// case proto.TaskSection1HeadComponentMaxLevel: var arg1 = taskTable.TaskArgs1[i]
// changed = this.processTask(task, taskTable, i, int(this.GetRigCompnentLevels(proto.EquipTypeHead))) || changed switch pb.TaskArgs(arg1) {
// case proto.TaskSection1BodyComponentMaxLevel: case pb.TaskArgs_TaskArgsId:
// changed = this.processTask(task, taskTable, i, int(this.GetRigCompnentLevels(proto.EquipTypeBody))) || changed changed = this.processTask(task, taskTable, i, this.GetCounterTotal(pb.CounterType_TaskCompleted, uint64(taskTable.TaskArgs2[i]))) || changed
// case proto.TaskSection1TailComponentMaxLevel: case pb.TaskArgs_TaskArgsType:
// changed = this.processTask(task, taskTable, i, int(this.GetRigCompnentLevels(proto.EquipTypeTail))) || changed case pb.TaskArgs_TaskSignIn:
// case proto.TaskSection1ComponentsAllLevels: case pb.TaskArgs_TaskHeroBook:
// changed = this.processTask(task, taskTable, i, int(this.GetAllRigCompnentLevels())) || changed case pb.TaskArgs_TaskHeroLevel:
// default: case pb.TaskArgs_TaskHeroBreak:
// return case pb.TaskArgs_TaskEquipLevel:
// } case pb.TaskArgs_TaskEquipRefine:
// completed = completed && task.Okay[i] case pb.TaskArgs_TaskTreasureLevel:
// } case pb.TaskArgs_TaskTreasureRefine:
// if completed { case pb.TaskArgs_TaskCopyChapter:
// task.Status = uint32(proto.TaskStatusCompleted) case pb.TaskArgs_TaskCopyLevel:
// } default:
//} continue
// }
//func (this *Player) addTask(taskTable *data.Task) *PlayerTask { completed = completed && task.Okayed[i]
// }
// if taskTable.Id == 200002 { if completed {
// this.manager.logger.Error("200002") task.Status = uint32(pb.AbleStatus_Able)
// } }
// }
// var task = &PlayerTask{Id: uint32(taskTable.Id), Process: make([]int, len(taskTable.Section1)), Okay: make([]bool, len(taskTable.Section1))}
// this.Task[task.Id] = task func (this *Player) addTask(taskTable *data.Task) *PlayerTask {
// this.checkTaskCompetedAhead(task, taskTable) var task = &PlayerTask{
// this.SaveModel(task) Id: uint32(taskTable.Id),
// Status: uint32(pb.AbleStatus_Unable),
Okayed: make([]bool, len(taskTable.TaskArgs1)),
Process: make([]uint32, len(taskTable.TaskArgs1)),
}
this.Task[task.Id] = task
this.checkTaskCompetedAhead(task, taskTable)
this.SaveModel(task)
//this.manager.eventManager.PlayerTaskLog(this, LogTypeTaskAdd, uint32(taskTable.Id), taskTable.Section1, taskTable.Section2, taskTable.Section3) //this.manager.eventManager.PlayerTaskLog(this, LogTypeTaskAdd, uint32(taskTable.Id), taskTable.Section1, taskTable.Section2, taskTable.Section3)
// return task return task
//} }
//
//func (this *Player) AddTask(taskIds ...int) { func (this *Player) AddTask(taskIds ...int) {
// if len(taskIds) == 0 { if len(taskIds) == 0 {
// return return
// } }
//
// var changeList []*proto.TaskChange var changeList []*pb.TaskChange
// for _, taskId := range taskIds { for _, taskId := range taskIds {
// var task = this.Task[uint32(taskId)] var task = this.Task[uint32(taskId)]
// if task != nil { if task != nil {
// continue continue
// } }
//
// var taskTable = this.manager.tables.Task.Get(taskId) var taskTable = this.manager.tables.Task.Find1(taskId)
// if taskTable == nil { if taskTable == nil {
// continue continue
// } }
//
// task = this.addTask(taskTable) for i := range taskTable.TaskArgs1 {
// changeList = append(changeList, &proto.TaskChange{Task: task.BuildMsgTask(), ChangeType: uint32(proto.ChangeTypeAdd)}) if pb.TaskArgs(taskTable.TaskArgs1[i]) == pb.TaskArgs_TaskArgsId {
// } var subTaskTable = this.manager.tables.Task.Find1(taskTable.TaskArgs1[i])
// if len(changeList) > 0 { if subTaskTable != nil {
// _ = this.Send(proto.ModIdTask, proto.MsgIdTaskChange, &proto.MsgTaskChangeListAck{List: changeList}) var subTask = this.addTask(taskTable)
// } changeList = append(changeList, &pb.TaskChange{ChangeType: pb.ChangeType_Add, Task: subTask.BuildMsgTask()})
//} }
// }
//func (this *Player) checkTaskDeprecated() (changed bool) { }
// for id, task := range this.Task {
// if taskTable := this.manager.tables.Task.Get(int(id)); taskTable == nil { task = this.addTask(taskTable)
// delete(this.Task, id) changeList = append(changeList, &pb.TaskChange{ChangeType: pb.ChangeType_Add, Task: task.BuildMsgTask()})
// this.WipeModel(task) }
// changed = true if len(changeList) > 0 {
// } _ = this.Send(pb.ModId_ModuleTask, pb.MsgId_ModTaskChange, &pb.TaskChangeListAck{ChangeList: changeList})
// } }
// return }
//}
// func (this *Player) checkTaskDeprecated() (changed bool) {
//func (this *Player) checkTaskReset(taskType proto.TaskType) (changed bool) { for id, task := range this.Task {
// if taskType == proto.TaskTypeLevelJudge { if taskTable := this.manager.tables.Task.Find1(int(id)); taskTable == nil {
// return false delete(this.Task, id)
// } this.WipeModel(task)
// changed = true
// var list []*proto.TaskChange }
// var taskTables = this.manager.tables.TaskExtend.Get(int(taskType)) }
// for _, taskTable := range taskTables { return
// var task = this.Task[uint32(taskTable.Id)] }
// if task != nil {
// task.Process = make([]int, len(taskTable.Section1)) func (this *Player) checkTaskReset(taskType pb.TaskType) (changed bool) {
// task.Okay = make([]bool, len(taskTable.Section1)) var changeList []*pb.TaskChange
// task.Status = uint32(proto.TaskStatusIncomplete) var taskTables = this.manager.tables.Task.Find2(int(taskType))
// list = append(list, &proto.TaskChange{Task: task.BuildMsgTask(), ChangeType: uint32(proto.ChangeTypeChange)}) for _, taskTable := range taskTables {
// } else { var task = this.Task[uint32(taskTable.Id)]
// task = this.addTask(taskTable) if task != nil {
// list = append(list, &proto.TaskChange{Task: task.BuildMsgTask(), ChangeType: uint32(proto.ChangeTypeAdd)}) task.Okayed = make([]bool, len(taskTable.TaskArgs1))
// } task.Process = make([]uint32, len(taskTable.TaskArgs1))
// task.Status = uint32(pb.AbleStatus_Unable)
// this.SaveModel(task) changeList = append(changeList, &pb.TaskChange{ChangeType: pb.ChangeType_Changed, Task: task.BuildMsgTask()})
// this.ResetCounterDaily(proto.CounterTypeTaskCompleted, task.Id) } else {
// changed = true task = this.addTask(taskTable)
// } changeList = append(changeList, &pb.TaskChange{ChangeType: pb.ChangeType_Add, Task: task.BuildMsgTask()})
// }
// _ = this.Send(proto.ModIdTask, proto.MsgIdTaskChange, &proto.MsgTaskChangeListAck{List: list})
// return this.SaveModel(task)
//} this.ResetCounterDaily(pb.CounterType_TaskCompleted, uint64(task.Id))
// changed = true
//func (this *Player) CheckTask(section1 proto.TaskSection1, section2, value int) bool { }
// var changeList []*proto.TaskChange
// for _, task := range this.Task { _ = this.Send(pb.ModId_ModuleTask, pb.MsgId_ModTaskChange, &pb.TaskChangeListAck{ChangeList: changeList})
// var taskTable = this.manager.tables.Task.Get(int(task.Id)) return
// if taskTable == nil { }
// continue
// } func (this *Player) CheckTask(arg1 pb.TaskArgs, arg2 int, value uint32) bool {
// var changeList []*pb.TaskChange
// if proto.TaskType(taskTable.TaskType) == proto.TaskTypeLevelJudge {
// continue for _, task := range this.Task {
// } var taskTable = this.manager.tables.Task.Find1(int(task.Id))
// if taskTable == nil {
// if proto.TaskStatus(task.Status) >= proto.TaskStatusCompleted { continue
// continue }
// }
// if pb.AbleStatus(task.Status) >= pb.AbleStatus_Able {
// var changed = false continue
// if len(task.Process) != len(taskTable.Section1) { }
// var process = task.Process
// var okay = task.Okay var changed = false
// if len(task.Process) != len(taskTable.TaskArgs1) {
// task.Process = make([]int, len(taskTable.Section1)) var process = task.Process
// task.Okay = make([]bool, len(taskTable.Section1)) var okay = task.Okayed
//
// copy(task.Process, process) task.Process = make([]uint32, len(taskTable.TaskArgs1))
// copy(task.Okay, okay) task.Okayed = make([]bool, len(taskTable.TaskArgs1))
//
// changed = true copy(task.Process, process)
// } copy(task.Okayed, okay)
//
// var completed = true changed = true
// for i := range taskTable.Section1 { }
// if task.Okay[i] {
// continue var completed = true
// } for i := range taskTable.TaskArgs1 {
// if task.Okayed[i] {
// if proto.TaskSection1(taskTable.Section1[i]) != section1 { continue
// completed = false }
// continue
// } if pb.TaskArgs(taskTable.TaskArgs1[i]) != arg1 {
// completed = false
// if len(taskTable.Section2) > 0 && taskTable.Section2[i] > 0 { continue
// if section2 != taskTable.Section2[i] { }
// completed = false
// continue if len(taskTable.TaskArgs2) > i && taskTable.TaskArgs2[i] > 0 {
// } if arg2 != taskTable.TaskArgs2[i] {
// } completed = false
// continue
// changed = this.processTask(task, taskTable, i, value) || changed }
// completed = completed && task.Okay[i] }
// }
// changed = this.processTask(task, taskTable, i, value) || changed
// if changed { completed = completed && task.Okayed[i]
// if completed { }
// task.Status = uint32(proto.TaskStatusCompleted)
// } if changed {
// this.SaveModel(task) if completed {
// changeList = append(changeList, &proto.TaskChange{Task: task.BuildMsgTask(), ChangeType: uint32(proto.ChangeTypeChange)}) task.Status = uint32(pb.AbleStatus_Able)
// } }
// } this.SaveModel(task)
// changeList = append(changeList, &pb.TaskChange{ChangeType: pb.ChangeType_Changed, Task: task.BuildMsgTask()})
// if len(changeList) == 0 { }
// return false }
// }
// if len(changeList) == 0 {
// _ = this.Send(proto.ModIdTask, proto.MsgIdTaskChange, &proto.MsgTaskChangeListAck{List: changeList}) return false
// return true }
//}
// _ = this.Send(pb.ModId_ModuleTask, pb.MsgId_ModTaskChange, &pb.TaskChangeListAck{ChangeList: changeList})
//func (this *Player) processTask(task *PlayerTask, taskTable *data.Task, i, value int) bool { return true
// switch proto.TaskSection1(taskTable.Section1[i]) { }
// case proto.TaskSection1PassSpecificScene,
// proto.TaskSection1PassAnyScene, func (this *Player) processTask(task *PlayerTask, taskTable *data.Task, i int, value uint32) bool {
// proto.TaskSection1CollectSpecificItem, switch pb.TaskArgs(taskTable.TaskArgs1[i]) {
// proto.TaskSection1PassedClassifyCopies, case pb.TaskArgs_TaskArgsType:
// proto.TaskSection1KillSpecificMonster, if task.Process[i] >= uint32(taskTable.TaskArgs3[i]) {
// proto.TaskSection1LoginDays, return false
// proto.TaskSection1BoughtInSpecificStore, }
// proto.TaskSection1SmelterSmeltTimes,
// proto.TaskSection1InfrastructureProduce, task.Process[i] += value
// proto.TaskSection1GetIdleBattleRewards, if task.Process[i] >= uint32(taskTable.TaskArgs3[i]) {
// proto.TaskSection1KillClassifyMonsters, task.Process[i] = uint32(taskTable.TaskArgs3[i])
// proto.TaskSection1UpgradeHeadComponents, task.Okayed[i] = true
// proto.TaskSection1UpgradeBodyComponents, }
// proto.TaskSection1UpgradeTailComponents, case pb.TaskArgs_TaskArgsId:
// proto.TaskSection1LevelBattleScore, if task.Process[i] >= uint32(taskTable.TaskArgs3[i]) {
// proto.TaskSection1UpgradeComponents, return false
// proto.TaskSection1UpgradeComponentStars, }
// proto.TaskSection1UpgradeCharacters,
// proto.TaskSection1UpgradeCharacterStars, task.Process[i] = value
// proto.TaskSection1UpgradeRemains, if task.Process[i] >= uint32(taskTable.TaskArgs3[i]) {
// proto.TaskSection1ArenaChallengeTimes, task.Process[i] = uint32(taskTable.TaskArgs3[i])
// proto.TaskSection1PlanetMineTimes, task.Okayed[i] = true
// proto.TaskSection1BuildCivilizations: }
// if task.Process[i] >= taskTable.Section3[i] { default:
// return false return false
// } }
// return true
// task.Process[i] += value }
// if task.Process[i] >= taskTable.Section3[i] {
// task.Process[i] = taskTable.Section3[i] func (this *Player) BuildMsgTaskListAck() *pb.MsgTaskListAck {
// task.Okay[i] = true var list []*pb.Task
// } for _, task := range this.Task {
// case proto.TaskSection1ArriveSpecificDepth, list = append(list, task.BuildMsgTask())
// proto.TaskSection1HeadComponentMaxLevel, }
// proto.TaskSection1BodyComponentMaxLevel, return &pb.MsgTaskListAck{TaskList: list}
// proto.TaskSection1TailComponentMaxLevel, }
// proto.TaskSection1ComponentsAllLevels:
// if task.Process[i] >= taskTable.Section3[i] {
// return false
// }
//
// task.Process[i] = value
// if task.Process[i] >= taskTable.Section3[i] {
// task.Process[i] = taskTable.Section3[i]
// task.Okay[i] = true
// }
// case proto.TaskSection1ArrivedDesignatedArea:
// task.Process[i] = value
// if len(taskTable.Section2) == 0 {
// return false
// }
//
// switch taskTable.Section2[i] {
// case 1, 2:
// if task.Process[i] >= taskTable.Section3[i] {
// task.Process[i] = taskTable.Section3[i]
// task.Okay[i] = true
// }
// case 3, 4:
// if task.Process[i] <= taskTable.Section3[i] {
// task.Process[i] = taskTable.Section3[i]
// task.Okay[i] = true
// }
// }
// default:
// return false
// }
// return true
//}
//
//func (this *Player) BuildMsgTaskListAck() *proto.MsgTaskListAck {
// var list []*proto.Task
// for _, task := range this.Task {
// list = append(list, task.BuildMsgTask())
// }
// return &proto.MsgTaskListAck{List: list}
//}

View File

@ -1,18 +0,0 @@
package logic
//type PlayerTaskActive struct {
// Id uint32 `bson:"id" key:"1"`
// Status uint32 `bson:"status"`
//}
//
//func (this *PlayerTaskActive) BuildActiveReward() *proto.ActiveReward {
// return &proto.ActiveReward{Id: this.Id, Status: this.Status}
//}
//
//func (this *Player) BuildMsgActiveInfoAck() *proto.MsgActiveInfoAck {
// var statusList []*proto.ActiveReward
// for _, avtive := range this.TaskActive {
// statusList = append(statusList, avtive.BuildActiveReward())
// }
// return &proto.MsgActiveInfoAck{Value: this.GetMoney(proto.MoneyTypeActivation).Value, StatusList: statusList}
//}