优化
This commit is contained in:
parent
4a7a02238b
commit
46b93a0a5d
@ -2,6 +2,7 @@ package orderCfg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"server/gamedata"
|
"server/gamedata"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -77,6 +78,9 @@ func GetStartOrderByStep(id int) []*gamedata.StartOrderData {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sort.Slice(ret, func(i, j int) bool {
|
||||||
|
return ret[i].Id < ret[j].Id
|
||||||
|
})
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -307,6 +307,7 @@ func HandleFriendMsg(p *Player, m *msg.Msg) error {
|
|||||||
Time: int32(GoUtil.Now()),
|
Time: int32(GoUtil.Now()),
|
||||||
})
|
})
|
||||||
case msg.HANDLE_TYPE_REFUSE: // 拒绝好友申请
|
case msg.HANDLE_TYPE_REFUSE: // 拒绝好友申请
|
||||||
|
FriendMod.RefuseApply(m.From)
|
||||||
p.PushClientRes(&proto.ResFriendApplyNotify{
|
p.PushClientRes(&proto.ResFriendApplyNotify{
|
||||||
Player: PlayerSimpleData,
|
Player: PlayerSimpleData,
|
||||||
Type: friend.FRIEND_NOTIFY_REFUSE,
|
Type: friend.FRIEND_NOTIFY_REFUSE,
|
||||||
@ -383,9 +384,14 @@ func FriendListBackData(p *Player) {
|
|||||||
fl = append(fl, ps)
|
fl = append(fl, ps)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ReqFriendList := make([]int64, 0)
|
||||||
|
for k := range FriendMod.SendApply {
|
||||||
|
ReqFriendList = append(ReqFriendList, int64(k))
|
||||||
|
}
|
||||||
p.PushClientRes(&proto.ResFriendList{
|
p.PushClientRes(&proto.ResFriendList{
|
||||||
FriendList: fl,
|
FriendList: fl,
|
||||||
Npc: GoUtil.IntToInt32(FriendMod.GetNpc()),
|
ReqApplyList: ReqFriendList,
|
||||||
|
Npc: GoUtil.IntToInt32(FriendMod.GetNpc()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1547,7 +1547,7 @@ func ReqRefuseFriend(player *Player, buf []byte) error {
|
|||||||
Uid: req.Uid,
|
Uid: req.Uid,
|
||||||
})
|
})
|
||||||
m := &MsqMod.Msg{
|
m := &MsqMod.Msg{
|
||||||
Type: MsqMod.HANDLE_TYPE_DEL,
|
Type: MsqMod.HANDLE_TYPE_REFUSE,
|
||||||
From: int(player.M_DwUin),
|
From: int(player.M_DwUin),
|
||||||
To: Uid,
|
To: Uid,
|
||||||
SendT: GoUtil.Now(),
|
SendT: GoUtil.Now(),
|
||||||
@ -3461,6 +3461,9 @@ func ReqPlayroomUpvote(player *Player, buf []byte) error {
|
|||||||
Type: MsqMod.HANDLE_TYPE_PLAYROOM_UPVOTE,
|
Type: MsqMod.HANDLE_TYPE_PLAYROOM_UPVOTE,
|
||||||
SendT: GoUtil.Now(),
|
SendT: GoUtil.Now(),
|
||||||
})
|
})
|
||||||
|
player.TeLog("playroom_upvote", map[string]interface{}{
|
||||||
|
"player_id": req.Id,
|
||||||
|
})
|
||||||
player.PlayMod.save()
|
player.PlayMod.save()
|
||||||
player.PushClientRes(&msg.ResPlayroomUpvote{
|
player.PushClientRes(&msg.ResPlayroomUpvote{
|
||||||
Code: msg.RES_CODE_SUCCESS,
|
Code: msg.RES_CODE_SUCCESS,
|
||||||
@ -4001,6 +4004,9 @@ func ReqCatTrickReward(player *Player, buf []byte) error {
|
|||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
player.TeLog("cat_trick_reward", map[string]interface{}{
|
||||||
|
"Items": Items,
|
||||||
|
})
|
||||||
player.PlayMod.save()
|
player.PlayMod.save()
|
||||||
player.PushClientRes(LimitedTimeEventMod.BackData())
|
player.PushClientRes(LimitedTimeEventMod.BackData())
|
||||||
player.PushClientRes(&msg.ResCatTrickReward{
|
player.PushClientRes(&msg.ResCatTrickReward{
|
||||||
@ -4091,6 +4097,9 @@ func ReqGetWish(player *Player, buf []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
player.TeLog("wish_get", map[string]interface{}{
|
||||||
|
"wish": Items,
|
||||||
|
})
|
||||||
player.PlayMod.save()
|
player.PlayMod.save()
|
||||||
player.PushClientRes(&msg.ResGetWish{
|
player.PushClientRes(&msg.ResGetWish{
|
||||||
Code: msg.RES_CODE_SUCCESS,
|
Code: msg.RES_CODE_SUCCESS,
|
||||||
@ -4118,6 +4127,9 @@ func ReqSendWishBeg(player *Player, buf []byte) error {
|
|||||||
SendT: GoUtil.Now(),
|
SendT: GoUtil.Now(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
player.TeLog("wish_send", map[string]interface{}{
|
||||||
|
"Uid": req.Uid,
|
||||||
|
})
|
||||||
player.PlayMod.save()
|
player.PlayMod.save()
|
||||||
player.PushClientRes(&msg.ResSendWishBeg{
|
player.PushClientRes(&msg.ResSendWishBeg{
|
||||||
Code: msg.RES_CODE_SUCCESS,
|
Code: msg.RES_CODE_SUCCESS,
|
||||||
@ -4167,6 +4179,9 @@ func ReqWishApply(player *Player, buf []byte) error {
|
|||||||
Type: MsqMod.HANDLE_TYPE_WISHLIST_AGREE,
|
Type: MsqMod.HANDLE_TYPE_WISHLIST_AGREE,
|
||||||
SendT: GoUtil.Now(),
|
SendT: GoUtil.Now(),
|
||||||
})
|
})
|
||||||
|
player.TeLog("wish_apply", map[string]interface{}{
|
||||||
|
"Uid": int(req.Uid),
|
||||||
|
})
|
||||||
player.PlayMod.save()
|
player.PlayMod.save()
|
||||||
player.PushClientRes(&msg.ResWishApply{
|
player.PushClientRes(&msg.ResWishApply{
|
||||||
Code: msg.RES_CODE_SUCCESS,
|
Code: msg.RES_CODE_SUCCESS,
|
||||||
|
|||||||
@ -149,6 +149,7 @@ func (f *FriendMod) CheckFriend(Uid int) bool {
|
|||||||
|
|
||||||
func (f *FriendMod) RefuseApply(id int) {
|
func (f *FriendMod) RefuseApply(id int) {
|
||||||
delete(f.ApplyList, id)
|
delete(f.ApplyList, id)
|
||||||
|
delete(f.SendApply, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FriendMod) CheckApply(id int) bool {
|
func (f *FriendMod) CheckApply(id int) bool {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user