Ejemplo n.º 1
0
        public ValueResult <SessionID> JoinSession(SessionID currentSession, int senderId, SessionID sid)       //(ValueResult<RoomModel> session)
        {
            try
            {
                // Session verlassen
                MessageBuffer mb = new MessageBuffer();
                SharedStateSerializer.serialize(ref mb, currentSession);
                Message m = new Message(mb, Message.MessagesType.COVISE_MESSAGE_VRBC_UNOBSERVE_SESSION);
                tcpSocket.send_msg(m);


                //neue Session setzen und Senden
                MessageBuffer mb2 = new MessageBuffer();
                SharedStateSerializer.serialize(ref mb2, sid);
                mb2.add(senderId);
                Message m2 = new Message(mb2, Message.MessagesType.COVISE_MESSAGE_VRBC_SET_SESSION);
                tcpSocket.send_msg(m2);

                return(new ValueResult <SessionID>(sid));
            }
            catch (Exception e)
            {
                log.Error("Method JoinSession is crashed!" + e);

                return(new ValueResult <SessionID>(e));
            }
        }
Ejemplo n.º 2
0
        public BaseResult SendDisconnectedUser(TcpSocketManager tcpSocketManager, int userId)
        {
            try
            {
                MessageBuffer mb   = new MessageBuffer();
                int           type = 103;
                mb.add(type);
                mb.add(userId);
                Message msg = new Message(mb, Message.MessagesType.COVISE_MESSAGE_VRB_MESSAGE);
                tcpSocketManager.send_msg(msg);
                return(new BaseResult());
            }
            catch (Exception e)
            {
                log.Error("Method SendDisconnectedUser is crashed!" + e);

                return(new BaseResult(e));
            }
        }