Commit 3b36841133d80e75d32af130c2501aa62813f205

Authored by 陆恒
1 parent d34447d5
Exists in master

提交

src/HttpServer/logic/constdef.go
@@ -20,3 +20,22 @@ const ( @@ -20,3 +20,22 @@ const (
20 FRIEND_RECOMMAND_NUM = 3 //推荐好友数量 20 FRIEND_RECOMMAND_NUM = 3 //推荐好友数量
21 TEAM_MAXNUM = 4 //队伍最大人数 21 TEAM_MAXNUM = 4 //队伍最大人数
22 ) 22 )
  23 +
  24 +var RandChatList = []string{
  25 + "点点猫咖怎么升级呀",
  26 + "你们都是哪里的呀",
  27 + "你们都多大呀",
  28 + "你们的故事都解锁了吗",
  29 + "小猫好可爱啊",
  30 + "有没有人理我呀",
  31 + "客服在吗?",
  32 + "有人在吗?都是机器人吗",
  33 + "你们都是真人吗?",
  34 + "怎么私聊你们都不说话呀",
  35 + "加好友呀",
  36 + "你们都什么星座啊!我能帮你们占卜哦",
  37 + "这些猫咪怎么都这么像啊",
  38 + "你们还有什么好游戏推荐吗",
  39 + "你们都玩了多久了?猫咪都几只了",
  40 + "有没有什么推荐的电视剧和动漫呀",
  41 +}
src/HttpServer/logic/function.go
@@ -8,6 +8,7 @@ import ( @@ -8,6 +8,7 @@ import (
8 "encoding/hex" 8 "encoding/hex"
9 "encoding/json" 9 "encoding/json"
10 "errors" 10 "errors"
  11 + "math/rand"
11 "mysql" 12 "mysql"
12 "net/http" 13 "net/http"
13 "sort" 14 "sort"
@@ -1305,7 +1306,8 @@ func PrivateChat(message string, uuid int, taruid int) (int, string) { @@ -1305,7 +1306,8 @@ func PrivateChat(message string, uuid int, taruid int) (int, string) {
1305 } 1306 }
1306 1307
1307 func GetRandChatMessage() string { 1308 func GetRandChatMessage() string {
1308 - return "小赤佬" 1309 + index := rand.Int() % len(RandChatList)
  1310 + return RandChatList[index]
1309 } 1311 }
1310 1312
1311 func HandleRandWorldChat() { 1313 func HandleRandWorldChat() {