|
@@ -178,23 +178,6 @@ func generateRoomID() int32 {
|
|
return int32(len(gameConfig.RoomMap) + 1)
|
|
return int32(len(gameConfig.RoomMap) + 1)
|
|
}
|
|
}
|
|
|
|
|
|
-func getPlayerCount(room_info *msg.RoomInfo) int {
|
|
|
|
- if room_info.RoomType == msg.RoomType_SHUANG_REN {
|
|
|
|
- return 2
|
|
|
|
- }
|
|
|
|
- return 4
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-func setPlayersRoomId(room_info *msg.RoomInfo) {
|
|
|
|
- for i := range room_info.Colors {
|
|
|
|
- user_id := room_info.Colors[i].MId
|
|
|
|
- user_agent := getAgentByUserId(user_id)
|
|
|
|
- if user_agent != nil {
|
|
|
|
- user_agent.SetUserData(&msg.UserInfo{})
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func initRoles(room_info *msg.RoomInfo) {
|
|
func initRoles(room_info *msg.RoomInfo) {
|
|
for i := range room_info.Colors {
|
|
for i := range room_info.Colors {
|
|
color_data := room_info.Colors[i]
|
|
color_data := room_info.Colors[i]
|
|
@@ -218,10 +201,6 @@ func setFirstColor(room_info *msg.RoomInfo) {
|
|
room_info.CurRoundColor = room_info.Colors[0].MColor
|
|
room_info.CurRoundColor = room_info.Colors[0].MColor
|
|
}
|
|
}
|
|
|
|
|
|
-func getCurColorEventKey(room_info *msg.RoomInfo) string {
|
|
|
|
- return fmt.Sprintf("%d_%s", room_info.Id, room_info.CurRoundColor)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func getRoomAllPlayerNameList(room_info *msg.RoomInfo) []string {
|
|
func getRoomAllPlayerNameList(room_info *msg.RoomInfo) []string {
|
|
var temp []string = make([]string, 0)
|
|
var temp []string = make([]string, 0)
|
|
for _, v := range room_info.Colors {
|
|
for _, v := range room_info.Colors {
|