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.
50 lines
1.6 KiB
50 lines
1.6 KiB
4 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using AX.Network.Protocols;
|
||
|
using UnityEngine;
|
||
|
using AX.Serialization;
|
||
|
using AX.NetworkSystem;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
|
||
|
public class LOGOUT_SYNC : NetworkMessageBehaviour
|
||
|
{
|
||
|
protected override void Execute(BinaryMessage message)
|
||
|
{
|
||
|
var Udata = message.Body.Deserialize<UserData>();
|
||
|
//在房间登出,删除此人UI
|
||
|
if (SceneManager.GetActiveScene().name == GoTo.DongYouLiQing.ToString()&&GameObject.Find("RoomWaiting"))
|
||
|
{
|
||
|
UserData userdata= CurrentUserInfo.room.FindUserById(Udata.UserInfo.Id);
|
||
|
if (userdata == null)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
CurrentUserInfo.room.UserList.Remove(userdata);
|
||
|
//刷新UI
|
||
|
GetComponent<MainPanel>().RemoveRoleItem(userdata);
|
||
|
GetComponent<MainPanel>().hideuselessPanel(CurrentUserInfo.room.UserList);
|
||
|
//刷新房间信息
|
||
|
//FindObjectOfType<RoomInfoPanel>().SetRoomInfo();
|
||
|
transform.parent.Find("RoomInfoPanel").GetComponent<RoomInfoPanel>().SetRoomInfo();
|
||
|
}
|
||
|
//从大厅登出
|
||
|
if (SceneManager.GetActiveScene().name== GoTo.Lobby.ToString())
|
||
|
{
|
||
|
if (Lobby.GetUserDataById(Udata.UserInfo.Id) == null)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
Lobby.userList.Remove(Lobby.GetUserDataById(Udata.UserInfo.Id));
|
||
|
}
|
||
|
|
||
|
if (CurrentUserInfo.mySelf.Id == Udata.UserInfo.Id)
|
||
|
{
|
||
|
CurrentUserInfo.CurrentUserInfoReset();
|
||
|
|
||
|
SceneManager.LoadScene(GoTo.Login.ToString());
|
||
|
}
|
||
|
}
|
||
|
}
|