예제 #1
0
    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);
        }
    }
예제 #2
0
    private void SendAuth()
    {
        MceAuth auth = new MceAuth();

        auth.id   = inputField.text;
        auth.pass = "******";
        SSSocketManager.getInstance().SendProto(NetProtoType.MceAuth, auth);
    }
예제 #3
0
    public void onBtnLogin()
    {
        var s = SSSocketManager.getInstance();

        s.SetIP("127.0.0.1", 1443);
        s.SetProtobufToID(new TestProtobufToID());
        s.Connect();
        if (s.IsConnected())
        {
            SendAuth();
        }
    }
예제 #4
0
    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();
    }
예제 #5
0
    public void onBtnDisconnect()
    {
        var s = SSSocketManager.getInstance();

        s.Close();
    }
예제 #6
0
 void OnApplicationQuit()
 {
     Debug.Log("Application ending after " + Time.time + " seconds");
     SSSocketManager.getInstance().Close();
 }
예제 #7
0
 // Update is called once per frame
 void Update()
 {
     SSSocketManager.getInstance().UpdateReceive();
 }
예제 #8
0
    void sendEnterGame()
    {
        MceEnterGame msg = new MceEnterGame();

        SSSocketManager.getInstance().SendProto(NetProtoType.MceEnterGame, msg);
    }
예제 #9
0
 // Update is called once per frame
 void Update()
 {
     SSSocketManager.getInstance().UpdateReceive();
     keyControl.Update();
     ActionManager.GetInstance().Update();
 }