You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.6 KiB
53 lines
1.6 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using UnityEngine; |
|
using AX.Serialization; |
|
using AX.NetworkSystem; |
|
|
|
public class ROOM_CREATE_SYNC : NetworkMessageBehaviour |
|
{ |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
var room = message.Body.Deserialize<Room>(); |
|
|
|
if (room.Owner.UserInfo.Id == CurrentUserInfo.mySelf.Id) |
|
{ |
|
CurrentUserInfo.room = room; |
|
|
|
UserData data = new UserData() |
|
{ |
|
UserInfo = CurrentUserInfo.mySelf, |
|
Role = CurrentUserInfo.role, |
|
Org = CurrentUserInfo.organization, |
|
IsReady = false |
|
}; |
|
EnterRoomPair pair = new EnterRoomPair() |
|
{ |
|
UserData = data, |
|
RoomId = CurrentUserInfo.room.Id, |
|
PassWord = room.Password, |
|
TargetScene = GoTo.DongYouLiQing |
|
}; |
|
|
|
NetworkManager.Default.SendAsync("ROOM_ENTER_SYNC", pair); |
|
} |
|
else |
|
{ |
|
Lobby.roomList.Add(room); |
|
|
|
//区分演习模式还是练习模式 |
|
List<Room> DataList = new List<Room>(); |
|
foreach (Room r in Lobby.roomList) |
|
{ |
|
if (r.Mode == GameSettings.othersSettings.mode) |
|
{ |
|
DataList.Add(r); |
|
} |
|
} |
|
transform.Find("RoomParent").GetComponent<GET_LOBBY_ROOMLIST_SYNC>().Bind(DataList); |
|
//transform.Find("RoomParent").GetComponent<GET_LOBBY_ROOMLIST_SYNC>().Bind(Lobby.roomList); |
|
} |
|
} |
|
}
|
|
|