问题描述
房间设置相同,为什么每次已有一个已创建的房间时,播放器都不会在那里连接,而是创建一个新房间?我收到此警告:操作失败:OperationResponse 225:ReturnCode:32760(未找到匹配项)。参数:{}
public void StartMatchMaking(){
Debug.LogError(CreateRoomProperties());
PhotonNetwork.JoinRandomroom(CreateRoomProperties(),4);
}
ExitGames.Client.Photon.Hashtable CreateRoomProperties()
{
return new ExitGames.Client.Photon.Hashtable
{
{"bet",bet}
};
}
private void OnPhotonRandomJoinFailed(object[] codeAndMsg)
{
CreateRoom();
}
public void CreateRoom(){
ExitGames.Client.Photon.Hashtable ht = new ExitGames.Client.Photon.Hashtable();
RoomOptions ro = new RoomOptions();
ht.Add("bet",bet);
ro.CustomroomProperties = ht;
Debug.LogError(ro.CustomroomProperties);
PhotonNetwork.CreateRoom(""+PhotonNetwork.player.NickName,ro,TypedLobby.Default);
}
void OnPhotonPlayerConnected(PhotonPlayer otherPlayer)
{
Debug.Log("New player: " + otherPlayer.NickName);
}
解决方法
需要向房间设置添加属性
# Python3
import time
def main():
maxS,n = map(int,raw_input().split())
S = maxS
q = []
unprocessed = 0
last_end_time = 0
top = 0
printout = ''
inlist = []
for i in range(n): # loop through all incoming packets
incominga,incomingb = map(int,raw_input().split())
incoming = [incominga,incomingb,0]
inlist.append(incoming)
start_time = time.time()
for i in range(n):
incoming = inlist[i]
while True: # allocation update
if unprocessed == top: ## processing queue is empty/nothing to deallocate
break
elif q[unprocessed][2] == -1: ## this packet was not processed
unprocessed = unprocessed + 1
elif q[unprocessed][3] <= incoming[0]: # unprocessed packet finished before we rcv/deallocate
S = min(S+1,maxS)
unprocessed = unprocessed + 1
else: ## we cant process anymore packets
break
if S > 0: # there is room to add this packet into the queue
incoming[2] = max(incoming[0],last_end_time)
incoming[3] = incoming[2] + incoming[1]
last_end_time = incoming[3]
S = S - 1
else:
incoming[2] = -1
incoming[3] = -1
q.append(incoming)
top = top + 1
printout = printout + str(incoming[2]) + '\n'
end_time = time.time()
print("--- %s seconds ---" % (end_time - start_time))
if __name__ == "__main__":
#profile.run("main()")
main()