| | |
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | mainSocket = new ClientSocket(SocketType.Main);
|
| | | mainSocket = new ClientSocket(ServerType.Main);
|
| | | mainProtocolQueue.Clear();
|
| | |
|
| | | mainSocket.Connect(ip, port, (bool ok) =>
|
| | |
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | crossServerSocket = new ClientSocket(SocketType.CrossSever);
|
| | | crossServerSocket = new ClientSocket(ServerType.CrossSever);
|
| | | crossSeverProtocolQueue.Clear();
|
| | | this.crossServerSocket.Connect(ip, port, (bool ok) =>
|
| | | {
|
| | |
| | | {
|
| | | if (crossServerSocket != null)
|
| | | {
|
| | | protocol.socketType = SocketType.CrossSever;
|
| | | protocol.socketType = ServerType.CrossSever;
|
| | | crossServerSocket.SendInfo(protocol);
|
| | | DebugPkgCache.Push(protocol);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PushPackage(GameNetPackBasic protocol, SocketType type)
|
| | | public void PushPackage(GameNetPackBasic protocol, ServerType type)
|
| | | {
|
| | | lock (this)
|
| | | {
|
| | |
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case SocketType.Main:
|
| | | case ServerType.Main:
|
| | | mainProtocolQueue.Enqueue(protocol);
|
| | | break;
|
| | | case SocketType.CrossSever:
|
| | | case ServerType.CrossSever:
|
| | | crossSeverProtocolQueue.Enqueue(protocol);
|
| | | break;
|
| | | default:
|
| | |
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | | loginModel.busy = false;
|
| | | WindowJumpMgr.Instance.ClearJumpData();
|
| | | StageManager.Instance.LoadLoginStage();
|
| | |
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = 1,
|
| | | toLineId = 0,
|
| | | needEmpty = false,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
|
| | | NetLinkWin.Hide();
|
| | | }
|
| | | }
|
| | |
| | | DisConnected = 6,
|
| | | }
|
| | |
|
| | | public enum SocketType
|
| | | {
|
| | | Main = 1,
|
| | | CrossSever = 2,
|
| | | }
|
| | |
|
| | | public struct CrossServerData
|
| | | {
|
| | | public string ip;
|
| | |
| | | Error = 2,
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public enum ServerType
|
| | | {
|
| | | Main = 1,
|
| | | CrossSever = 2,
|
| | | }
|