forked from sin365/AxibugEmuOnline
登录成功失败事件
This commit is contained in:
parent
9fa862441a
commit
b6292f1d4d
@ -43,6 +43,8 @@ namespace AxibugEmuOnline.Client.ClientCore
|
|||||||
#endif
|
#endif
|
||||||
public static void Init(Initer initer, bool isTest = false, string testSrvIP = "")
|
public static void Init(Initer initer, bool isTest = false, string testSrvIP = "")
|
||||||
{
|
{
|
||||||
|
PlayerPrefs.DeleteAll();
|
||||||
|
|
||||||
settings = new AppSettings();
|
settings = new AppSettings();
|
||||||
|
|
||||||
log = new LogManager();
|
log = new LogManager();
|
||||||
|
@ -3,6 +3,18 @@
|
|||||||
public enum EEvent
|
public enum EEvent
|
||||||
{
|
{
|
||||||
// 添加你自己需要的事件类型
|
// 添加你自己需要的事件类型
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 登录成功
|
||||||
|
/// </summary>
|
||||||
|
OnLoginSucceed,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 登录失败
|
||||||
|
/// </summary>
|
||||||
|
OnLoginFailed,
|
||||||
|
|
||||||
OnChatMsg,
|
OnChatMsg,
|
||||||
|
|
||||||
//自己的信息更新(比如改名更新)
|
//自己的信息更新(比如改名更新)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using AxibugEmuOnline.Client.ClientCore;
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
using AxibugEmuOnline.Client.Common;
|
using AxibugEmuOnline.Client.Common;
|
||||||
|
using AxibugEmuOnline.Client.Event;
|
||||||
using AxibugEmuOnline.Client.Network;
|
using AxibugEmuOnline.Client.Network;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using System;
|
using System;
|
||||||
@ -50,15 +51,21 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
{
|
{
|
||||||
App.log.Info("登录成功");
|
App.log.Info("登录成功");
|
||||||
App.user.InitMainUserData(App.user.userdata.Account, msg.UID);
|
App.user.InitMainUserData(App.user.userdata.Account, msg.UID);
|
||||||
|
OverlayManager.PopTip("登录成功");
|
||||||
|
|
||||||
|
|
||||||
App.log.Info("获取Room列表");
|
App.log.Info("获取Room列表");
|
||||||
App.roomMgr.SendGetRoomList();
|
App.roomMgr.SendGetRoomList();
|
||||||
App.log.Info("获取在线玩家列表");
|
App.log.Info("获取在线玩家列表");
|
||||||
App.user.Send_GetUserList();
|
App.user.Send_GetUserList();
|
||||||
|
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnLoginSucceed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
App.log.Info("登录失败");
|
App.log.Info("登录失败");
|
||||||
|
OverlayManager.PopTip("登录失败");
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnLoginFailed);
|
||||||
}
|
}
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
//TestCreate();
|
//TestCreate();
|
||||||
|
@ -295,7 +295,10 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
Protobuf_Room_Join_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Join_RESP>(reqData);
|
Protobuf_Room_Join_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_Join_RESP>(reqData);
|
||||||
mineRoomMiniInfo = msg.RoomMiniInfo;
|
mineRoomMiniInfo = msg.RoomMiniInfo;
|
||||||
InitRePlay();
|
InitRePlay();
|
||||||
Eventer.Instance.PostEvent(EEvent.OnMineJoinRoom);
|
{
|
||||||
|
OverlayManager.PopTip($"已进入[{msg.RoomMiniInfo.GetHostNickName()}]的房间");
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnMineJoinRoom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -322,6 +325,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
ReleaseRePlay();
|
ReleaseRePlay();
|
||||||
mineRoomMiniInfo = null;
|
mineRoomMiniInfo = null;
|
||||||
Eventer.Instance.PostEvent(EEvent.OnMineLeavnRoom);
|
Eventer.Instance.PostEvent(EEvent.OnMineLeavnRoom);
|
||||||
|
OverlayManager.PopTip($"已经离开房间");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecvRoomMyRoomStateChange(byte[] reqData)
|
void RecvRoomMyRoomStateChange(byte[] reqData)
|
||||||
@ -341,7 +345,10 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
{
|
{
|
||||||
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer);
|
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer);
|
||||||
if (NewPlayer > 0)//而且害换了一个玩家
|
if (NewPlayer > 0)//而且害换了一个玩家
|
||||||
|
{
|
||||||
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
|
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
|
||||||
|
OverlayManager.PopTip($"其他人进入了房间");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else //之前没人
|
else //之前没人
|
||||||
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
|
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
|
||||||
|
@ -163,7 +163,10 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
Protobuf_UserJoin_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_UserJoin_RESP>(reqData);
|
Protobuf_UserJoin_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_UserJoin_RESP>(reqData);
|
||||||
UpdateOrAddUser(msg.UserInfo, out bool isNewUser);
|
UpdateOrAddUser(msg.UserInfo, out bool isNewUser);
|
||||||
if (isNewUser)
|
if (isNewUser)
|
||||||
|
{
|
||||||
Eventer.Instance.PostEvent(EEvent.OnUserLogin, msg.UserInfo.UID, msg.UserInfo.NickName);
|
Eventer.Instance.PostEvent(EEvent.OnUserLogin, msg.UserInfo.UID, msg.UserInfo.NickName);
|
||||||
|
OverlayManager.PopTip($"玩家[{msg.UserInfo.NickName}]上线了");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RecvGetUserLeave(byte[] reqData)
|
public void RecvGetUserLeave(byte[] reqData)
|
||||||
|
Loading…
Reference in New Issue
Block a user