package main

import (
 	"math/rand"
)

 var (
 	trash_str = []byte("123r45f67890~!@#$%^&*()_+|}{:L?><bxcnz2caasuD234DYCTDGHSAWEXXBVM>><?:L{}PITEQQ!~456abcedfsfsfdilekso")
)

func GetTranshBytesByLen(num int) (tmp []byte){
	all_len := len(trash_str)
	for i := 0; i < num; i ++{
		r := rand.Intn(all_len)
		tmp = append(tmp, trash_str[r])
	}
	return
}

func GetAnotherID(uid, rid uint32) uint32{
	v := m_map_rooms.Get(rid)
	if v == nil{
		return uid
	}
	room, _ := v.(*RoomInfo)
	r := rand.Intn(len(room.ids))
	if r < 0{
		return uid
	}
	for _, id := range room.ids{
		if uid != id{
			return id
		}
	}
	return uid
}