private void mseSceneObjAppearListProtoEventHandler(EventArgs e)
    {
        ProtoEventArgs <MseSceneObjAppearList> pe = (ProtoEventArgs <MseSceneObjAppearList>)e;

        foreach (var sceneObj in pe.Proto.sceneObjAppear)
        {
            createUser(sceneObj);
        }
    }
    private void ReceivePackType <T>(short msgType, byte[] msgBytes)
    {
        MemoryStream       ms        = new MemoryStream(msgBytes);
        T                  t         = ProtoBuf.Serializer.Deserialize <T>(ms);
        ProtoEventArgs <T> eventArgs = new ProtoEventArgs <T>();

        eventArgs.Proto = t;
        eventArgs.MsgID = msgType;
        MessageManager.GetIncestance().SendMessage(SSSocketTool.TransMsgDefToStr(msgType), eventArgs);
    }
Exemple #3
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();
    }
Exemple #4
0
    public void mseUserInfoProtoEventHandler(EventArgs e)
    {
        ProtoEventArgs <MseUserInfo> pe = (ProtoEventArgs <MseUserInfo>)e;

        UpdateByMseUserInfo(pe.Proto);
    }
    private void mseSceneObjMoveProtoEventHandler(EventArgs e)
    {
        ProtoEventArgs <MseSceneObjMove> pe = (ProtoEventArgs <MseSceneObjMove>)e;

        runUser(pe.Proto);
    }
    private void mseSceneObjAppearProtoEventHandler(EventArgs e)
    {
        ProtoEventArgs <MseSceneObjAppear> pe = (ProtoEventArgs <MseSceneObjAppear>)e;

        createUser(pe.Proto);
    }