private void ChangeAndSend(E_DIR dir, bool isMove) { bool isChange = false; if (this.dir != dir) { this.dir = dir; isChange = true; } if (this.isMove != isMove) { this.isMove = isMove; isChange = true; } if (isChange) { MceControl msg = new MceControl(); msg.dir = dir; msg.isMove = isMove; SSDebug.Log("send isMove = " + msg.isMove); SSSocketManager.getInstance().SendProto(NetProtoType.MceControl, msg); } }
private void SendAuth() { MceAuth auth = new MceAuth(); auth.id = inputField.text; auth.pass = "******"; SSSocketManager.getInstance().SendProto(NetProtoType.MceAuth, auth); }
public void onBtnLogin() { var s = SSSocketManager.getInstance(); s.SetIP("127.0.0.1", 1443); s.SetProtobufToID(new TestProtobufToID()); s.Connect(); if (s.IsConnected()) { SendAuth(); } }
public void mseAuthProtoEventHandler(EventArgs e) { ProtoEventArgs <MseAuth> pe = (ProtoEventArgs <MseAuth>)e; if (!pe.Proto.succ) { SSSocketManager.getInstance().Close(); return; } ModelManager.user.UID = pe.Proto.uid; GlobalServerTime.setServerTime(pe.Proto.serverTime); SceneManager.LoadScene("battle"); // test(); }
public void onBtnDisconnect() { var s = SSSocketManager.getInstance(); s.Close(); }
void OnApplicationQuit() { Debug.Log("Application ending after " + Time.time + " seconds"); SSSocketManager.getInstance().Close(); }
// Update is called once per frame void Update() { SSSocketManager.getInstance().UpdateReceive(); }
void sendEnterGame() { MceEnterGame msg = new MceEnterGame(); SSSocketManager.getInstance().SendProto(NetProtoType.MceEnterGame, msg); }
// Update is called once per frame void Update() { SSSocketManager.getInstance().UpdateReceive(); keyControl.Update(); ActionManager.GetInstance().Update(); }