private void SendTestMsg() { C2R_Login msg = new C2R_Login(); msg.RpcId = 100; msg.Account = "test"; msg.Password = "******"; HotfixNetManager.Instance.SendMsg(msg); }
public void Update() { if (NetworkManager.Instance.States == ENetworkStates.Connected) { if (_isSendLogin == false) { _isSendLogin = true; C2R_Login msg = new C2R_Login { RpcId = 100, Account = "hello", Password = "******" }; HotfixNetManager.Instance.SendHotfixMsg(msg); } } }
private void OnHandleEventMessage(IEventMessage msg) { if (msg is NetworkEventMessageDefine.ConnectFail) { HotfixLog.Log("连接服务器失败"); } else if (msg is NetworkEventMessageDefine.ConnectSuccess) { HotfixLog.Log("连接服务器成功"); // 发送登录消息 C2R_Login loginMsg = new C2R_Login { RpcId = 100, Account = "hello", Password = "******" }; HotfixNetManager.Instance.SendHotfixMsg(loginMsg); } }